Skip to content

Commit

Permalink
remove an unnecessary use of loc_place.ptr.into_pointer_or_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Apr 18, 2022
1 parent c83241a commit 55f0977
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/const_eval/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 55f0977

Please sign in to comment.