diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-06-19 16:34:37 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-06-22 19:16:17 +0200 |
| commit | 0b2837dc07f88577bee8a6c614d9971ed2aa46b1 (patch) | |
| tree | e70477f71899a715f315b79d134ea6fd932df17e | |
| parent | 8276dac08183e374d27b2c3165d10b9dfcde09b3 (diff) | |
| download | rust-0b2837dc07f88577bee8a6c614d9971ed2aa46b1.tar.gz rust-0b2837dc07f88577bee8a6c614d9971ed2aa46b1.zip | |
Simplify match.
| -rw-r--r-- | compiler/rustc_passes/src/dead.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_passes/src/dead.rs b/compiler/rustc_passes/src/dead.rs index 648090f2b4d..1f73a1d90fd 100644 --- a/compiler/rustc_passes/src/dead.rs +++ b/compiler/rustc_passes/src/dead.rs @@ -82,8 +82,8 @@ impl<'tcx> MarkSymbolVisitor<'tcx> { fn handle_res(&mut self, res: Res) { match res { - Res::Def(DefKind::Const | DefKind::AssocConst | DefKind::TyAlias, _) => { - self.check_def_id(res.def_id()); + Res::Def(DefKind::Const | DefKind::AssocConst | DefKind::TyAlias, def_id) => { + self.check_def_id(def_id); } _ if self.in_pat => {} Res::PrimTy(..) | Res::SelfCtor(..) | Res::Local(..) => {} @@ -102,6 +102,7 @@ impl<'tcx> MarkSymbolVisitor<'tcx> { self.check_def_id(variant_id); } } + Res::Def(_, def_id) => self.check_def_id(def_id), Res::SelfTy { trait_: t, alias_to: i } => { if let Some(t) = t { self.check_def_id(t); @@ -111,9 +112,6 @@ impl<'tcx> MarkSymbolVisitor<'tcx> { } } Res::ToolMod | Res::NonMacroAttr(..) | Res::Err => {} - _ => { - self.check_def_id(res.def_id()); - } } } |
