aboutsummaryrefslogtreecommitdiffstats
path: root/components/plugins/lints
diff options
context:
space:
mode:
Diffstat (limited to 'components/plugins/lints')
-rw-r--r--components/plugins/lints/inheritance_integrity.rs5
-rw-r--r--components/plugins/lints/transmute_type.rs2
-rw-r--r--components/plugins/lints/unrooted_must_root.rs6
3 files changed, 7 insertions, 6 deletions
diff --git a/components/plugins/lints/inheritance_integrity.rs b/components/plugins/lints/inheritance_integrity.rs
index d806b1cad1c..d8cf22a102b 100644
--- a/components/plugins/lints/inheritance_integrity.rs
+++ b/components/plugins/lints/inheritance_integrity.rs
@@ -41,8 +41,9 @@ impl LintPass 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 ast::TyPath(_, ty_id) = f.node.ty.node {
- if let Some(def::DefTy(def_id, _)) = cx.tcx.def_map.borrow().get(&ty_id).cloned() {
+ if let ast::TyPath(..) = f.node.ty.node {
+ if let Some(&def::PathResolution { base_def: def::DefTy(def_id, _), .. }) =
+ cx.tcx.def_map.borrow().get(&f.node.ty.id) {
if ty::has_attr(cx.tcx, def_id, "_dom_struct_marker") {
// If the field is not the first, it's probably
// being misused (a)
diff --git a/components/plugins/lints/transmute_type.rs b/components/plugins/lints/transmute_type.rs
index 6facd362108..25b931bce87 100644
--- a/components/plugins/lints/transmute_type.rs
+++ b/components/plugins/lints/transmute_type.rs
@@ -26,7 +26,7 @@ impl LintPass for TransmutePass {
match ex.node {
ast::ExprCall(ref expr, ref args) => {
match expr.node {
- ast::ExprPath(ref path) => {
+ ast::ExprPath(_, ref path) => {
if path.segments.last()
.map_or(false, |ref segment| segment.identifier.name.as_str() == "transmute")
&& args.len() == 1 {
diff --git a/components/plugins/lints/unrooted_must_root.rs b/components/plugins/lints/unrooted_must_root.rs
index 80b37a714ba..a0a9706bf7a 100644
--- a/components/plugins/lints/unrooted_must_root.rs
+++ b/components/plugins/lints/unrooted_must_root.rs
@@ -33,9 +33,9 @@ fn lint_unrooted_ty(cx: &Context, ty: &ast::Ty, warning: &str) {
match ty.node {
ast::TyVec(ref t) | ast::TyFixedLengthVec(ref t, _) |
ast::TyPtr(ast::MutTy { ty: ref t, ..}) | ast::TyRptr(_, ast::MutTy { ty: ref t, ..}) => lint_unrooted_ty(cx, &**t, warning),
- ast::TyPath(_, id) => {
- match cx.tcx.def_map.borrow()[id].clone() {
- def::DefTy(def_id, _) => {
+ ast::TyPath(..) => {
+ match cx.tcx.def_map.borrow()[ty.id] {
+ def::PathResolution{ base_def: def::DefTy(def_id, _), .. } => {
if ty::has_attr(cx.tcx, def_id, "must_root") {
cx.span_lint(UNROOTED_MUST_ROOT, ty.span, warning);
}