Skip to content

Commit 10946b7

Browse files
committed
ensure size_of matches its docs
1 parent b0c72aa commit 10946b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_mir/interpret/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ crate fn eval_nullary_intrinsic<'tcx>(
7070
let n = match name {
7171
"pref_align_of" => layout.pref_pos.align.pref.bytes(),
7272
"min_align_of" => layout.pref_pos.align.abi.bytes(),
73-
"size_of" => layout.pref_pos.size.bytes(),
73+
"size_of" => layout.pref_pos.stride().bytes(),
7474
_ => bug!(),
7575
};
7676
ty::Const::from_usize(tcx, n)

0 commit comments

Comments
 (0)