Skip to content

Commit 50628b7

Browse files
committed
Only defined bits are relevant
1 parent c6d25dc commit 50628b7

File tree

1 file changed

+3
-2
lines changed
  • src/librustc_mir/hair/pattern

1 file changed

+3
-2
lines changed

src/librustc_mir/hair/pattern/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,9 +1104,10 @@ pub fn compare_const_vals<'a, 'tcx>(
11041104
defined: defined_b,
11051105
},
11061106
))
1107-
) if size_a == size_b && defined_a == defined_b &&
1107+
) if size_a == size_b &&
11081108
ptr_a.offset.bytes() == 0 && ptr_b.offset.bytes() == 0 &&
1109-
tcx.data_layout.pointer_size.bits() == defined_a.into() => {
1109+
tcx.data_layout.pointer_size.bits() <= defined_a.into() &&
1110+
tcx.data_layout.pointer_size.bits() <= defined_b.into() => {
11101111
let map = tcx.alloc_map.lock();
11111112
let alloc_a = map.unwrap_memory(ptr_a.alloc_id);
11121113
let alloc_b = map.unwrap_memory(ptr_b.alloc_id);

0 commit comments

Comments
 (0)