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::*;
|
||||
|
||||
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 {
|
||||
false
|
||||
};
|
||||
|
|
|
@ -68,7 +68,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LenZero {
|
|||
}
|
||||
|
||||
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),
|
||||
_ => (),
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
|
|||
hir::ItemGlobalAsm(..) => "an assembly blob",
|
||||
hir::ItemTy(..) => "a type alias",
|
||||
hir::ItemUnion(..) => "a union",
|
||||
hir::ItemDefaultImpl(..) |
|
||||
hir::ItemAutoImpl(..) |
|
||||
hir::ItemExternCrate(..) |
|
||||
hir::ItemForeignMod(..) |
|
||||
hir::ItemImpl(..) |
|
||||
|
|
|
@ -87,7 +87,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
|
|||
|
||||
// Exclude non-inherent impls
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -397,14 +397,14 @@ fn print_item(cx: &LateContext, item: &hir::Item) {
|
|||
},
|
||||
hir::ItemTrait(..) => {
|
||||
println!("trait decl");
|
||||
if cx.tcx.trait_has_default_impl(did) {
|
||||
println!("trait has a default impl");
|
||||
if cx.tcx.trait_is_auto(did) {
|
||||
println!("trait is auto");
|
||||
} else {
|
||||
println!("trait has no default impl");
|
||||
println!("trait is not auto");
|
||||
}
|
||||
},
|
||||
hir::ItemDefaultImpl(_, ref _trait_ref) => {
|
||||
println!("default impl");
|
||||
hir::ItemAutoImpl(_, ref _trait_ref) => {
|
||||
println!("auto impl");
|
||||
},
|
||||
hir::ItemImpl(_, _, _, _, Some(ref _trait_ref), _, _) => {
|
||||
println!("trait impl");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue