Skip to content

Commit 095fca2

Browse files
committed
check_static_ptr change
1 parent 0b6ec3a commit 095fca2

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+1
-1
lines changed

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2534,7 +2534,7 @@ pub enum ConstantKind<'tcx> {
25342534

25352535
impl<'tcx> Constant<'tcx> {
25362536
pub fn check_static_ptr(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
2537-
match self.literal.const_for_ty()?.val().try_to_scalar() {
2537+
match self.literal.try_to_scalar() {
25382538
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance) {
25392539
GlobalAlloc::Static(def_id) => {
25402540
assert!(!tcx.is_thread_local_static(def_id));

0 commit comments

Comments
 (0)