Skip to content

Commit

Permalink
The Clone::clone call is now a ConstantKind::Val, not a `Constant…
Browse files Browse the repository at this point in the history
…Kind::Ty`
  • Loading branch information
scottmcm committed Mar 10, 2022
1 parent 697464a commit 705b880
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
}
Expand Down

0 comments on commit 705b880

Please sign in to comment.