diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-11-29 12:20:58 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-29 12:20:58 -0800 |
commit | f159b5cb1028bf4d2f75b0b48055fe19a8032f8e (patch) | |
tree | 64a760a7bd69d65251ae915773300429b3867723 /components/plugins/lints/inheritance_integrity.rs | |
parent | a88487f96a5e17dfbaf02acd3a2af49456013b6e (diff) | |
parent | 1d56087188cebc518253d123594135ee1e2f92f1 (diff) | |
download | servo-f159b5cb1028bf4d2f75b0b48055fe19a8032f8e.tar.gz servo-f159b5cb1028bf4d2f75b0b48055fe19a8032f8e.zip |
Auto merge of #14292 - servo:rustup, r=KiChjang
Update to Rust 1.15.0-nightly (1c448574b 2016-11-28)
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14292)
<!-- Reviewable:end -->
Diffstat (limited to 'components/plugins/lints/inheritance_integrity.rs')
-rw-r--r-- | components/plugins/lints/inheritance_integrity.rs | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/components/plugins/lints/inheritance_integrity.rs b/components/plugins/lints/inheritance_integrity.rs index 96a93dec809..a47b6313db0 100644 --- a/components/plugins/lints/inheritance_integrity.rs +++ b/components/plugins/lints/inheritance_integrity.rs @@ -44,22 +44,19 @@ impl LateLintPass for InheritancePass { .map(|(_, f)| f.span); // Find all #[dom_struct] fields let dom_spans: Vec<_> = def.fields().iter().enumerate().filter_map(|(ctr, f)| { - if let hir::TyPath(..) = f.ty.node { - if let Some(&def::PathResolution { base_def: def, .. }) = - cx.tcx.def_map.borrow().get(&f.ty.id) { - if let def::Def::PrimTy(_) = def { - return None; - } - if cx.tcx.has_attr(def.def_id(), "_dom_struct_marker") { - // If the field is not the first, it's probably - // being misused (a) - if ctr > 0 { - cx.span_lint(INHERITANCE_INTEGRITY, f.span, - "Bare DOM structs should only be used as the first field of a \ - DOM struct. Consider using JS<T> instead."); - } - return Some(f.span) + if let hir::TyPath(hir::QPath::Resolved(_, ref path)) = f.ty.node { + if let def::Def::PrimTy(_) = path.def { + return None; + } + if cx.tcx.has_attr(path.def.def_id(), "_dom_struct_marker") { + // If the field is not the first, it's probably + // being misused (a) + if ctr > 0 { + cx.span_lint(INHERITANCE_INTEGRITY, f.span, + "Bare DOM structs should only be used as the first field of a \ + DOM struct. Consider using JS<T> instead."); } + return Some(f.span) } } None |