diff --git a/components/plugins/lints/unrooted_must_root.rs b/components/plugins/lints/unrooted_must_root.rs index d6ecacc25dd..5b6e16c99e9 100644 --- a/components/plugins/lints/unrooted_must_root.rs +++ b/components/plugins/lints/unrooted_must_root.rs @@ -129,17 +129,18 @@ impl LateLintPass for UnrootedPass { visit::FnKind::Closure => return, }; - if !in_new_function { - for arg in &decl.inputs { - cx.tcx.ast_ty_to_ty_cache.borrow().get(&arg.ty.id).map(|t| { - if is_unrooted_ty(cx, t, false) { - if in_derive_expn(cx, span) { - return; - } - cx.span_lint(UNROOTED_MUST_ROOT, arg.ty.span, "Type must be rooted") + for arg in &decl.inputs { + cx.tcx.ast_ty_to_ty_cache.borrow().get(&arg.ty.id).map(|t| { + if is_unrooted_ty(cx, t, false) { + if in_derive_expn(cx, span) { + return; } - }); - } + cx.span_lint(UNROOTED_MUST_ROOT, arg.ty.span, "Type must be rooted") + } + }); + } + + if !in_new_function { if let hir::Return(ref ty) = decl.output { cx.tcx.ast_ty_to_ty_cache.borrow().get(&ty.id).map(|t| { if is_unrooted_ty(cx, t, false) { diff --git a/components/script/dom/filelist.rs b/components/script/dom/filelist.rs index 57542b0a51d..d695ac8f43a 100644 --- a/components/script/dom/filelist.rs +++ b/components/script/dom/filelist.rs @@ -18,6 +18,7 @@ pub struct FileList { } impl FileList { + #[allow(unrooted_must_root)] fn new_inherited(files: Vec>) -> FileList { FileList { reflector_: Reflector::new(), @@ -25,6 +26,7 @@ impl FileList { } } + #[allow(unrooted_must_root)] pub fn new(window: &Window, files: Vec>) -> Root { reflect_dom_object(box FileList::new_inherited(files), GlobalRef::Window(window), FileListBinding::Wrap) } diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs index dda2bd9b3b8..4ddc0fef6dd 100644 --- a/components/script/dom/htmlcollection.rs +++ b/components/script/dom/htmlcollection.rs @@ -32,6 +32,7 @@ pub struct HTMLCollection { } impl HTMLCollection { + #[allow(unrooted_must_root)] fn new_inherited(collection: Collection) -> HTMLCollection { HTMLCollection { reflector_: Reflector::new(), @@ -39,6 +40,7 @@ impl HTMLCollection { } } + #[allow(unrooted_must_root)] pub fn new(window: &Window, collection: Collection) -> Root { reflect_dom_object(box HTMLCollection::new_inherited(collection), GlobalRef::Window(window), HTMLCollectionBinding::Wrap) diff --git a/components/script/dom/nodelist.rs b/components/script/dom/nodelist.rs index 2ed127dd2dc..490df73bd56 100644 --- a/components/script/dom/nodelist.rs +++ b/components/script/dom/nodelist.rs @@ -27,6 +27,7 @@ pub struct NodeList { } impl NodeList { + #[allow(unrooted_must_root)] fn new_inherited(list_type: NodeListType) -> NodeList { NodeList { reflector_: Reflector::new(), @@ -34,6 +35,7 @@ impl NodeList { } } + #[allow(unrooted_must_root)] pub fn new(window: &Window, list_type: NodeListType) -> Root { reflect_dom_object(box NodeList::new_inherited(list_type),