diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index fc438edc7229e..18c2dd71ad3d0 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -2214,7 +2214,7 @@ impl<'tcx> Operand<'tcx> { /// While this is unlikely in general, it's the normal case of what you'll /// find as the `func` in a [`TerminatorKind::Call`]. pub fn const_fn_def(&self) -> Option<(DefId, SubstsRef<'tcx>)> { - let const_ty = self.constant()?.literal.const_for_ty()?.ty(); + let const_ty = self.constant()?.literal.ty(); if let ty::FnDef(def_id, substs) = *const_ty.kind() { Some((def_id, substs)) } else { None } } }