This commit is contained in:
Manish Goregaokar 2019-06-25 14:41:10 -07:00
parent 4a6914bb8c
commit e3619a6507
3 changed files with 3 additions and 15 deletions

View File

@ -107,11 +107,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
span: Span,
hir_id: hir::HirId,
) {
let is_impl = if let Some(hir::Node::Item(item)) = cx
.tcx
.hir()
.find(cx.tcx.hir().get_parent_node(hir_id))
{
let is_impl = if let Some(hir::Node::Item(item)) = cx.tcx.hir().find(cx.tcx.hir().get_parent_node(hir_id)) {
matches!(item.node, hir::ItemKind::Impl(_, _, _, _, Some(_), _, _))
} else {
false

View File

@ -88,11 +88,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
}
// Exclude non-inherent impls
if let Some(Node::Item(item)) = cx
.tcx
.hir()
.find(cx.tcx.hir().get_parent_node(hir_id))
{
if let Some(Node::Item(item)) = cx.tcx.hir().find(cx.tcx.hir().get_parent_node(hir_id)) {
if matches!(item.node, ItemKind::Impl(_, _, _, _, Some(_), _, _) |
ItemKind::Trait(..))
{

View File

@ -179,11 +179,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TriviallyCopyPassByRef {
}
// Exclude non-inherent impls
if let Some(Node::Item(item)) = cx
.tcx
.hir()
.find(cx.tcx.hir().get_parent_node(hir_id))
{
if let Some(Node::Item(item)) = cx.tcx.hir().find(cx.tcx.hir().get_parent_node(hir_id)) {
if matches!(item.node, ItemKind::Impl(_, _, _, _, Some(_), _, _) |
ItemKind::Trait(..))
{