diff options
| author | Oli Scherer <github35764891676564198441@oli-obk.de> | 2021-03-04 12:21:36 +0000 |
|---|---|---|
| committer | Oli Scherer <github35764891676564198441@oli-obk.de> | 2021-03-04 12:21:36 +0000 |
| commit | 0559e50a6c87ca1ff17cce320be5354e318f7468 (patch) | |
| tree | 9b80618eba50c5374ea7d00e56fd30d304f45ce7 | |
| parent | 7f32f62aa5ceba1b795f3702e502d8473238be6b (diff) | |
| download | rust-0559e50a6c87ca1ff17cce320be5354e318f7468.tar.gz rust-0559e50a6c87ca1ff17cce320be5354e318f7468.zip | |
Remove a dead code path
| -rw-r--r-- | compiler/rustc_middle/src/mir/query.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 5 |
2 files changed, 4 insertions, 13 deletions
diff --git a/compiler/rustc_middle/src/mir/query.rs b/compiler/rustc_middle/src/mir/query.rs index c293fbe4ef8..f2f7242a8fd 100644 --- a/compiler/rustc_middle/src/mir/query.rs +++ b/compiler/rustc_middle/src/mir/query.rs @@ -439,18 +439,6 @@ impl<'tcx> TyCtxt<'tcx> { } #[inline] - pub fn optimized_mir_or_const_arg_mir( - self, - def: ty::WithOptConstParam<DefId>, - ) -> &'tcx Body<'tcx> { - if let Some((did, param_did)) = def.as_const_arg() { - self.mir_for_ctfe_of_const_arg((did, param_did)) - } else { - self.optimized_mir(def.did) - } - } - - #[inline] pub fn mir_for_ctfe_opt_const_arg(self, def: ty::WithOptConstParam<DefId>) -> &'tcx Body<'tcx> { if let Some((did, param_did)) = def.as_const_arg() { self.mir_for_ctfe_of_const_arg((did, param_did)) diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 2e077827873..c27a337554e 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -2963,7 +2963,10 @@ impl<'tcx> TyCtxt<'tcx> { | DefKind::AnonConst => self.mir_for_ctfe_opt_const_arg(def), // If the caller wants `mir_for_ctfe` of a function they should not be using // `instance_mir`, so we'll assume const fn also wants the optimized version. - _ => self.optimized_mir_or_const_arg_mir(def), + _ => { + assert_eq!(def.const_param_did, None); + self.optimized_mir(def.did) + } }, ty::InstanceDef::VtableShim(..) | ty::InstanceDef::ReifyShim(..) |
