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 ca18301 commit cb55ce1Copy full SHA for cb55ce1
src/constant.rs
@@ -186,8 +186,7 @@ pub(crate) fn codegen_const_value<'tcx>(
186
ConstValue::Slice { data, meta } => {
187
let alloc_id = fx.tcx.reserve_and_set_memory_alloc(data);
188
let ptr = pointer_for_allocation(fx, alloc_id).get_addr(fx);
189
- // FIXME: the `try_from` here can actually fail, e.g. for very long ZST slices.
190
- let len = fx.bcx.ins().iconst(fx.pointer_type, i64::try_from(meta).unwrap());
+ let len = fx.bcx.ins().iconst(fx.pointer_type, meta as i64);
191
CValue::by_val_pair(ptr, len, layout)
192
}
193
0 commit comments