From d3718823ba920db1707ba1d137fcf00ce2f467b1 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sat, 6 Jul 2019 13:45:21 +0200 Subject: [PATCH] Upgrade to rustc 1.38.0-nightly (4b65a86eb 2019-07-15) --- components/script_plugins/lib.rs | 4 ++++ components/script_plugins/unrooted_must_root.rs | 6 +++--- components/script_plugins/utils.rs | 4 ++-- components/script_plugins/webidl_must_inherit.rs | 4 ++-- rust-toolchain | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs index b6a6ba542723..f17556f2eab7 100644 --- a/components/script_plugins/lib.rs +++ b/components/script_plugins/lib.rs @@ -22,6 +22,10 @@ #[macro_use] extern crate rustc; +// Work around TLS failure: https://github.com/rust-lang/rust/issues/62717#issuecomment-511876555 +#[allow(unused)] +extern crate rustc_driver; + extern crate rustc_plugin; extern crate syntax; diff --git a/components/script_plugins/unrooted_must_root.rs b/components/script_plugins/unrooted_must_root.rs index ae278cb820d2..f813f3ecad04 100644 --- a/components/script_plugins/unrooted_must_root.rs +++ b/components/script_plugins/unrooted_must_root.rs @@ -161,7 +161,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass { .all(|a| !a.check_name(self.symbols.must_root)) { for ref field in def.fields() { - let def_id = cx.tcx.hir().local_def_id_from_hir_id(field.hir_id); + let def_id = cx.tcx.hir().local_def_id(field.hir_id); if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) { cx.span_lint(UNROOTED_MUST_ROOT, field.span, "Type must be rooted, use #[must_root] on the struct definition to propagate") @@ -182,7 +182,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass { match var.node.data { hir::VariantData::Tuple(ref fields, ..) => { for ref field in fields { - let def_id = cx.tcx.hir().local_def_id_from_hir_id(field.hir_id); + let def_id = cx.tcx.hir().local_def_id(field.hir_id); if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) { cx.span_lint( UNROOTED_MUST_ROOT, @@ -215,7 +215,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass { }; if !in_derive_expn(span) { - let def_id = cx.tcx.hir().local_def_id_from_hir_id(id); + let def_id = cx.tcx.hir().local_def_id(id); let sig = cx.tcx.type_of(def_id).fn_sig(cx.tcx); for (arg, ty) in decl.inputs.iter().zip(sig.inputs().skip_binder().iter()) { diff --git a/components/script_plugins/utils.rs b/components/script_plugins/utils.rs index e6398de35e1b..0c22f2246472 100644 --- a/components/script_plugins/utils.rs +++ b/components/script_plugins/utils.rs @@ -4,7 +4,7 @@ use rustc::hir::def_id::DefId; use rustc::lint::LateContext; -use syntax::source_map::{ExpnFormat, Span}; +use syntax::source_map::{ExpnKind, MacroKind, Span}; use syntax::symbol::Symbol; /// check if a DefId's path matches the given absolute type path @@ -31,7 +31,7 @@ pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool pub fn in_derive_expn(span: Span) -> bool { if let Some(i) = span.ctxt().outer().expn_info() { - if let ExpnFormat::MacroAttribute(n) = i.format { + if let ExpnKind::Macro(MacroKind::Attr, n) = i.kind { n.as_str().contains("derive") } else { false diff --git a/components/script_plugins/webidl_must_inherit.rs b/components/script_plugins/webidl_must_inherit.rs index 7706d052d4cb..dc05a15f6b15 100644 --- a/components/script_plugins/webidl_must_inherit.rs +++ b/components/script_plugins/webidl_must_inherit.rs @@ -185,7 +185,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for WebIdlPass { _gen: &'tcx hir::Generics, id: HirId, ) { - let def_id = cx.tcx.hir().local_def_id_from_hir_id(id); + let def_id = cx.tcx.hir().local_def_id(id); if !is_webidl_ty(&self.symbols, cx, cx.tcx.type_of(def_id)) { return; } @@ -196,7 +196,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for WebIdlPass { }; let parent_name = def.fields().iter().next().map(|field| { - let def_id = cx.tcx.hir().local_def_id_from_hir_id(field.hir_id); + let def_id = cx.tcx.hir().local_def_id(field.hir_id); let ty = cx.tcx.type_of(def_id).to_string(); get_ty_name(&ty).to_string() }); diff --git a/rust-toolchain b/rust-toolchain index bb6f6b24446f..664d9426cd4b 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2019-07-04 +nightly-2019-07-16