diff options
-rw-r--r-- | components/script_plugins/lib.rs | 20 | ||||
-rw-r--r-- | rust-toolchain | 2 | ||||
-rw-r--r-- | tests/unit/script/size_of.rs | 16 |
3 files changed, 21 insertions, 17 deletions
diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs index 79d1a5282ef..5259366c7fd 100644 --- a/components/script_plugins/lib.rs +++ b/components/script_plugins/lib.rs @@ -110,7 +110,7 @@ fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function continue; }, }; - let recur_into_subtree = match t.kind { + let recur_into_subtree = match t.kind() { ty::Adt(did, substs) => { let has_attr = |did, name| has_lint_attr(sym, &cx.tcx.get_attrs(did), name); if has_attr(did.did, sym.must_root) { @@ -121,7 +121,7 @@ fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function } else if match_def_path(cx, did.did, &[sym.alloc, sym.rc, sym.Rc]) { // Rc<Promise> is okay let inner = substs.type_at(0); - if let ty::Adt(did, _) = inner.kind { + if let ty::Adt(did, _) = inner.kind() { if has_attr(did.did, sym.allow_unrooted_in_rc) { false } else { @@ -132,8 +132,12 @@ fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function } } else if match_def_path(cx, did.did, &[sym::core, sym.cell, sym.Ref]) || match_def_path(cx, did.did, &[sym::core, sym.cell, sym.RefMut]) || - match_def_path(cx, did.did, &[sym::core, sym.slice, sym.Iter]) || - match_def_path(cx, did.did, &[sym::core, sym.slice, sym.IterMut]) || + match_def_path(cx, did.did, &[sym::core, sym::slice, sym::iter, sym.Iter]) || + match_def_path( + cx, + did.did, + &[sym::core, sym::slice, sym::iter, sym.IterMut], + ) || match_def_path(cx, did.did, &[sym.accountable_refcell, sym.Ref]) || match_def_path(cx, did.did, &[sym.accountable_refcell, sym.RefMut]) || match_def_path( @@ -383,13 +387,14 @@ impl<'a, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'tcx> { /// usage e.g. with /// `match_def_path(cx, id, &["core", "option", "Option"])` fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool { - let krate = &cx.tcx.crate_name(def_id.krate); + let def_path = cx.tcx.def_path(def_id); + let krate = &cx.tcx.crate_name(def_path.krate); if krate != &path[0] { return false; } let path = &path[1..]; - let other = cx.tcx.def_path(def_id).data; + let other = def_path.data; if other.len() != path.len() { return false; @@ -398,7 +403,7 @@ fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool { other .into_iter() .zip(path) - .all(|(e, p)| e.data.as_symbol() == *p) + .all(|(e, p)| e.data.get_opt_name().as_ref() == Some(p)) } fn in_derive_expn(span: Span) -> bool { @@ -438,7 +443,6 @@ symbols! { accountable_refcell Ref RefMut - slice Iter IterMut collections diff --git a/rust-toolchain b/rust-toolchain index 40973dae63e..5bc8eb6009c 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-07-27 +nightly-2020-09-27 diff --git a/tests/unit/script/size_of.rs b/tests/unit/script/size_of.rs index e46848e5cf1..c6849956124 100644 --- a/tests/unit/script/size_of.rs +++ b/tests/unit/script/size_of.rs @@ -29,11 +29,11 @@ macro_rules! sizeof_checker ( ); // Update the sizes here -sizeof_checker!(size_event_target, EventTarget, 56); -sizeof_checker!(size_node, Node, 192); -sizeof_checker!(size_element, Element, 368); -sizeof_checker!(size_htmlelement, HTMLElement, 384); -sizeof_checker!(size_div, HTMLDivElement, 384); -sizeof_checker!(size_span, HTMLSpanElement, 384); -sizeof_checker!(size_text, Text, 224); -sizeof_checker!(size_characterdata, CharacterData, 224); +sizeof_checker!(size_event_target, EventTarget, 48); +sizeof_checker!(size_node, Node, 184); +sizeof_checker!(size_element, Element, 360); +sizeof_checker!(size_htmlelement, HTMLElement, 376); +sizeof_checker!(size_div, HTMLDivElement, 376); +sizeof_checker!(size_span, HTMLSpanElement, 376); +sizeof_checker!(size_text, Text, 216); +sizeof_checker!(size_characterdata, CharacterData, 216); |