From 705b8807d531348d05ed3e941b3af695abc24f85 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Thu, 10 Mar 2022 01:50:47 -0800 Subject: [PATCH] The `Clone::clone` call is now a `ConstantKind::Val`, not a `ConstantKind::Ty` --- compiler/rustc_middle/src/mir/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } } }