Update to Rust 1.15.0-nightly (1c448574b 2016-11-28)

This commit is contained in:
Anthony Ramine 2016-11-12 12:55:51 +01:00
parent 7be32770b1
commit 1d56087188
14 changed files with 207 additions and 228 deletions

View file

@ -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