We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e989ec5 commit 6e21222Copy full SHA for 6e21222
compiler/rustc_const_eval/src/const_eval/eval_queries.rs
@@ -169,9 +169,7 @@ pub(super) fn op_to_const<'tcx>(
169
let (alloc_id, offset) = a.to_pointer(ecx).expect(msg).into_parts();
170
let alloc_id = alloc_id.expect(msg);
171
let data = ecx.tcx.global_alloc(alloc_id).unwrap_memory();
172
- if offset.bytes() != 0 {
173
- panic!("{}", msg);
174
- }
+ assert!(offset == Size::ZERO, "{}", msg);
175
let meta = b.to_target_usize(ecx).expect(msg);
176
ConstValue::Slice { data, meta }
177
}
0 commit comments