Unused tuple fields in rustc_infer.

This commit is contained in:
Camille GILLOT 2022-07-25 19:45:10 +02:00
parent 2a990f7c0f
commit ec83476748

View File

@ -2410,9 +2410,9 @@ fn binding_suggestion<'tcx, S: fmt::Display>(
#[derive(Debug)]
enum SubOrigin<'hir> {
GAT(&'hir hir::Generics<'hir>),
Impl(&'hir hir::Generics<'hir>),
Trait(&'hir hir::Generics<'hir>),
Fn(&'hir hir::Generics<'hir>),
Impl,
Trait,
Fn,
Unknown,
}
let sub_origin = 'origin: {
@ -2427,34 +2427,30 @@ enum SubOrigin<'hir> {
kind: hir::ImplItemKind::TyAlias(..),
generics,
..
}) => SubOrigin::GAT(generics),
Node::ImplItem(hir::ImplItem {
kind: hir::ImplItemKind::Fn(..),
generics,
..
}) => SubOrigin::Fn(generics),
Node::TraitItem(hir::TraitItem {
})
| Node::TraitItem(hir::TraitItem {
kind: hir::TraitItemKind::Type(..),
generics,
..
}) => SubOrigin::GAT(generics),
Node::TraitItem(hir::TraitItem {
Node::ImplItem(hir::ImplItem {
kind: hir::ImplItemKind::Fn(..),
..
})
| Node::TraitItem(hir::TraitItem {
kind: hir::TraitItemKind::Fn(..),
generics,
..
}) => SubOrigin::Fn(generics),
})
| Node::Item(hir::Item {
kind: hir::ItemKind::Fn(..), ..
}) => SubOrigin::Fn,
Node::Item(hir::Item {
kind: hir::ItemKind::Trait(_, _, generics, _, _),
kind: hir::ItemKind::Trait(..),
..
}) => SubOrigin::Trait(generics),
}) => SubOrigin::Trait,
Node::Item(hir::Item {
kind: hir::ItemKind::Impl(hir::Impl { generics, .. }),
..
}) => SubOrigin::Impl(generics),
Node::Item(hir::Item {
kind: hir::ItemKind::Fn(_, generics, _),
..
}) => SubOrigin::Fn(generics),
kind: hir::ItemKind::Impl(..), ..
}) => SubOrigin::Impl,
_ => continue,
};
}