diff options
Diffstat (limited to 'components/plugins')
-rw-r--r-- | components/plugins/jstraceable.rs | 2 | ||||
-rw-r--r-- | components/plugins/lints/inheritance_integrity.rs | 4 | ||||
-rw-r--r-- | components/plugins/lints/privatize.rs | 2 | ||||
-rw-r--r-- | components/plugins/lints/unrooted_must_root.rs | 6 |
4 files changed, 7 insertions, 7 deletions
diff --git a/components/plugins/jstraceable.rs b/components/plugins/jstraceable.rs index 2d6a71fbcf3..39df8614784 100644 --- a/components/plugins/jstraceable.rs +++ b/components/plugins/jstraceable.rs @@ -80,7 +80,7 @@ fn jstraceable_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substru _ => cx.span_bug(trait_span, "impossible substructure in `jstraceable`") }; - for &FieldInfo { ref self_, span, .. } in fields.iter() { + for &FieldInfo { ref self_, span, .. } in fields { stmts.push(call_trace(span, self_.clone())); } diff --git a/components/plugins/lints/inheritance_integrity.rs b/components/plugins/lints/inheritance_integrity.rs index fbb0c0c65df..0e48a198fa2 100644 --- a/components/plugins/lints/inheritance_integrity.rs +++ b/components/plugins/lints/inheritance_integrity.rs @@ -69,7 +69,7 @@ impl LintPass for InheritancePass { if cx.current_level(INHERITANCE_INTEGRITY) != Level::Allow { let sess = cx.sess(); sess.span_note(sp, "Reflector found here"); - for span in dom_spans.iter() { + for span in &dom_spans { sess.span_note(*span, "Bare DOM struct found here"); } } @@ -79,7 +79,7 @@ impl LintPass for InheritancePass { cx.span_lint(INHERITANCE_INTEGRITY, cx.tcx.map.expect_item(id).span, "This DOM struct has multiple DOM struct members, only one is allowed"); if cx.current_level(INHERITANCE_INTEGRITY) != Level::Allow { - for span in dom_spans.iter() { + for span in &dom_spans { cx.sess().span_note(*span, "Bare DOM struct found here"); } } diff --git a/components/plugins/lints/privatize.rs b/components/plugins/lints/privatize.rs index 3a96b1873dd..430edf50d30 100644 --- a/components/plugins/lints/privatize.rs +++ b/components/plugins/lints/privatize.rs @@ -28,7 +28,7 @@ impl LintPass for PrivatizePass { _gen: &ast::Generics, id: ast::NodeId) { if cx.tcx.has_attr(ast_util::local_def(id), "privatize") { - for field in def.fields.iter() { + for field in &def.fields { match field.node { ast::StructField_ { kind: ast::NamedField(ident, visibility), .. } if visibility == Public => { cx.span_lint(PRIVATIZE, field.span, diff --git a/components/plugins/lints/unrooted_must_root.rs b/components/plugins/lints/unrooted_must_root.rs index 3bdb94b59ac..190ce92292a 100644 --- a/components/plugins/lints/unrooted_must_root.rs +++ b/components/plugins/lints/unrooted_must_root.rs @@ -88,7 +88,7 @@ impl LintPass for UnrootedPass { _ => cx.tcx.map.expect_item(cx.tcx.map.get_parent(id)), }; if item.attrs.iter().all(|a| !a.check_name("must_root")) { - for ref field in def.fields.iter() { + for ref field in &def.fields { if is_unrooted_ty(cx, cx.tcx.node_id_to_type(field.node.id), false) { cx.span_lint(UNROOTED_MUST_ROOT, field.span, "Type must be rooted, use #[must_root] on the struct definition to propagate") @@ -102,7 +102,7 @@ impl LintPass for UnrootedPass { if map.expect_item(map.get_parent(var.node.id)).attrs.iter().all(|a| !a.check_name("must_root")) { match var.node.kind { ast::TupleVariantKind(ref vec) => { - for ty in vec.iter() { + for ty in vec { ast_ty_to_prim_ty(cx.tcx, &*ty.ty).map(|t| { if is_unrooted_ty(cx, t, false) { cx.span_lint(UNROOTED_MUST_ROOT, ty.ty.span, @@ -141,7 +141,7 @@ impl LintPass for UnrootedPass { match block.rules { ast::DefaultBlock => { - for arg in decl.inputs.iter() { + for arg in &decl.inputs { ast_ty_to_prim_ty(cx.tcx, &*arg.ty).map(|t| { if is_unrooted_ty(cx, t, false) { cx.span_lint(UNROOTED_MUST_ROOT, arg.ty.span, "Type must be rooted") |