Fix compilation errors with rustc 1.23.0-nightly (d762b1d6c
2017-11-04)
Fixes #2204
This commit is contained in:
parent
0c43b60dd4
commit
b778659c42
5 changed files with 9 additions and 9 deletions
|
@ -86,7 +86,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
|
||||||
use rustc::hir::map::Node::*;
|
use rustc::hir::map::Node::*;
|
||||||
|
|
||||||
let is_impl = if let Some(NodeItem(item)) = cx.tcx.hir.find(cx.tcx.hir.get_parent_node(nodeid)) {
|
let is_impl = if let Some(NodeItem(item)) = cx.tcx.hir.find(cx.tcx.hir.get_parent_node(nodeid)) {
|
||||||
matches!(item.node, hir::ItemImpl(_, _, _, _, Some(_), _, _) | hir::ItemDefaultImpl(..))
|
matches!(item.node, hir::ItemImpl(_, _, _, _, Some(_), _, _) | hir::ItemAutoImpl(..))
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
|
@ -68,7 +68,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LenZero {
|
||||||
}
|
}
|
||||||
|
|
||||||
match item.node {
|
match item.node {
|
||||||
ItemTrait(_, _, _, ref trait_items) => check_trait_items(cx, item, trait_items),
|
ItemTrait(_, _, _, _, ref trait_items) => check_trait_items(cx, item, trait_items),
|
||||||
ItemImpl(_, _, _, _, None, _, ref impl_items) => check_impl_items(cx, item, impl_items),
|
ItemImpl(_, _, _, _, None, _, ref impl_items) => check_impl_items(cx, item, impl_items),
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
|
||||||
hir::ItemGlobalAsm(..) => "an assembly blob",
|
hir::ItemGlobalAsm(..) => "an assembly blob",
|
||||||
hir::ItemTy(..) => "a type alias",
|
hir::ItemTy(..) => "a type alias",
|
||||||
hir::ItemUnion(..) => "a union",
|
hir::ItemUnion(..) => "a union",
|
||||||
hir::ItemDefaultImpl(..) |
|
hir::ItemAutoImpl(..) |
|
||||||
hir::ItemExternCrate(..) |
|
hir::ItemExternCrate(..) |
|
||||||
hir::ItemForeignMod(..) |
|
hir::ItemForeignMod(..) |
|
||||||
hir::ItemImpl(..) |
|
hir::ItemImpl(..) |
|
||||||
|
|
|
@ -87,7 +87,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
|
||||||
|
|
||||||
// Exclude non-inherent impls
|
// Exclude non-inherent impls
|
||||||
if let Some(NodeItem(item)) = cx.tcx.hir.find(cx.tcx.hir.get_parent_node(node_id)) {
|
if let Some(NodeItem(item)) = cx.tcx.hir.find(cx.tcx.hir.get_parent_node(node_id)) {
|
||||||
if matches!(item.node, ItemImpl(_, _, _, _, Some(_), _, _) | ItemDefaultImpl(..)) {
|
if matches!(item.node, ItemImpl(_, _, _, _, Some(_), _, _) | ItemAutoImpl(..)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -397,14 +397,14 @@ fn print_item(cx: &LateContext, item: &hir::Item) {
|
||||||
},
|
},
|
||||||
hir::ItemTrait(..) => {
|
hir::ItemTrait(..) => {
|
||||||
println!("trait decl");
|
println!("trait decl");
|
||||||
if cx.tcx.trait_has_default_impl(did) {
|
if cx.tcx.trait_is_auto(did) {
|
||||||
println!("trait has a default impl");
|
println!("trait is auto");
|
||||||
} else {
|
} else {
|
||||||
println!("trait has no default impl");
|
println!("trait is not auto");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hir::ItemDefaultImpl(_, ref _trait_ref) => {
|
hir::ItemAutoImpl(_, ref _trait_ref) => {
|
||||||
println!("default impl");
|
println!("auto impl");
|
||||||
},
|
},
|
||||||
hir::ItemImpl(_, _, _, _, Some(ref _trait_ref), _, _) => {
|
hir::ItemImpl(_, _, _, _, Some(ref _trait_ref), _, _) => {
|
||||||
println!("trait impl");
|
println!("trait impl");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue