From ec83476748f4fa9dd76c4c60a615e6ef6748e7fe Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Mon, 25 Jul 2022 19:45:10 +0200 Subject: [PATCH] Unused tuple fields in rustc_infer. --- .../src/infer/error_reporting/mod.rs | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index 4e87ec86658..df16d8b2fdb 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -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, }; }