From 55f0977a6baee4a3469826a45ee1308a65498129 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 18 Apr 2022 12:47:38 -0400 Subject: [PATCH] remove an unnecessary use of loc_place.ptr.into_pointer_or_addr --- compiler/rustc_const_eval/src/const_eval/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_const_eval/src/const_eval/mod.rs b/compiler/rustc_const_eval/src/const_eval/mod.rs index 80270f825630f..68f9bee593f65 100644 --- a/compiler/rustc_const_eval/src/const_eval/mod.rs +++ b/compiler/rustc_const_eval/src/const_eval/mod.rs @@ -38,7 +38,7 @@ pub(crate) fn const_caller_location( if intern_const_alloc_recursive(&mut ecx, InternKind::Constant, &loc_place).is_err() { bug!("intern_const_alloc_recursive should not error in this case") } - ConstValue::Scalar(Scalar::from_pointer(loc_place.ptr.into_pointer_or_addr().unwrap(), &tcx)) + ConstValue::Scalar(Scalar::from_maybe_pointer(loc_place.ptr, &tcx)) } /// Convert an evaluated constant to a type level constant