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.
write_cvalue_maybe_transmute
1 parent b70ad2d commit 4fb3c4bCopy full SHA for 4fb3c4b
src/value_and_place.rs
@@ -677,8 +677,10 @@ impl<'tcx> CPlace<'tcx> {
677
let to_addr = to_ptr.get_addr(fx);
678
let src_layout = from.1;
679
let size = dst_layout.size.bytes();
680
- let src_align = src_layout.align.abi.bytes() as u8;
681
- let dst_align = dst_layout.align.abi.bytes() as u8;
+ // `emit_small_memory_copy` uses `u8` for alignments, just use the maximum
+ // alignment that fits in a `u8` if the actual alignment is larger.
682
+ let src_align = src_layout.align.abi.bytes().try_into().unwrap_or(128);
683
+ let dst_align = dst_layout.align.abi.bytes().try_into().unwrap_or(128);
684
fx.bcx.emit_small_memory_copy(
685
fx.target_config,
686
to_addr,
0 commit comments