Skip to content

Commit 0559e50

Browse files
committed
Remove a dead code path
1 parent 7f32f62 commit 0559e50

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

compiler/rustc_middle/src/mir/query.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -438,18 +438,6 @@ impl<'tcx> TyCtxt<'tcx> {
438438
}
439439
}
440440

441-
#[inline]
442-
pub fn optimized_mir_or_const_arg_mir(
443-
self,
444-
def: ty::WithOptConstParam<DefId>,
445-
) -> &'tcx Body<'tcx> {
446-
if let Some((did, param_did)) = def.as_const_arg() {
447-
self.mir_for_ctfe_of_const_arg((did, param_did))
448-
} else {
449-
self.optimized_mir(def.did)
450-
}
451-
}
452-
453441
#[inline]
454442
pub fn mir_for_ctfe_opt_const_arg(self, def: ty::WithOptConstParam<DefId>) -> &'tcx Body<'tcx> {
455443
if let Some((did, param_did)) = def.as_const_arg() {

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2963,7 +2963,10 @@ impl<'tcx> TyCtxt<'tcx> {
29632963
| DefKind::AnonConst => self.mir_for_ctfe_opt_const_arg(def),
29642964
// If the caller wants `mir_for_ctfe` of a function they should not be using
29652965
// `instance_mir`, so we'll assume const fn also wants the optimized version.
2966-
_ => self.optimized_mir_or_const_arg_mir(def),
2966+
_ => {
2967+
assert_eq!(def.const_param_did, None);
2968+
self.optimized_mir(def.did)
2969+
}
29672970
},
29682971
ty::InstanceDef::VtableShim(..)
29692972
| ty::InstanceDef::ReifyShim(..)

0 commit comments

Comments
 (0)