servo: Merge #8446 - Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08) (from servo:rustup_20151110); r=SimonSapin+Ms2ger+jdm+Manishearth

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (https://github.com/rust-lang/rust/issues/29740) and can crash the OS. Probably will set our CI on fire. </s>

Source-Repo: https://github.com/servo/servo
Source-Revision: f13c72d68e1e7f49e241938bfd6e8a588c68e86b
This commit is contained in:
Manish Goregaokar
2015-11-27 10:17:00 +05:00
parent 4cdc9c76f9
commit 09d3c7ef66
58 changed files with 1092 additions and 965 deletions

View File

@@ -16,7 +16,7 @@ use url::{Url, Host, RelativeSchemeData, SchemeData};
pub fn expand_url(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
-> Box<MacResult + 'static> {
let mut parser = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(), tts.to_vec());
let query_expr = cx.expander().fold_expr(parser.parse_expr());
let query_expr = cx.expander().fold_expr(parser.parse_expr_nopanic().unwrap());
// Ensure a str literal was passed to the macro
let query = match parse_str_lit(&query_expr) {
@@ -114,17 +114,22 @@ impl<'a> ExtCtxtHelpers for ExtCtxt<'a> {
}
}
fn expr_host(&self, sp: Span, host: Host) -> syntax::ptr::P<Expr> {
fn expr_host(&self, _sp: Span, host: Host) -> syntax::ptr::P<Expr> {
match host {
Host::Domain(domain) => quote_expr!(self, ::url::Host::Domain(String::from($domain))),
Host::Ipv6(address) => {
let pieces_expr = self.expr_slice_u16(sp, &address.pieces);
let [a, b, c, d, e, f, g, h] = address.segments();
quote_expr!(self,
::url::Host::Ipv6(
::url::Ipv6Address {
pieces: $pieces_expr.to_owned()
}
))
::url::Host::Ipv6(::std::net::Ipv6Addr::new(
$a, $b, $c, $d, $e, $f, $g, $h
)))
},
Host::Ipv4(address) => {
let [a, b, c, d] = address.octets();
quote_expr!(self,
::url::Host::Ipv4(::std::net::Ipv4Addr::new(
$a, $b, $c, $d
)))
},
}
}