diff --git a/src/librustc_mir/interpret/intrinsics.rs b/src/librustc_mir/interpret/intrinsics.rs index 246f8d9d9a44f..9837d5865d9de 100644 --- a/src/librustc_mir/interpret/intrinsics.rs +++ b/src/librustc_mir/interpret/intrinsics.rs @@ -70,7 +70,7 @@ crate fn eval_nullary_intrinsic<'tcx>( let n = match name { "pref_align_of" => layout.pref_pos.align.pref.bytes(), "min_align_of" => layout.pref_pos.align.abi.bytes(), - "size_of" => layout.pref_pos.size.bytes(), + "size_of" => layout.pref_pos.stride().bytes(), _ => bug!(), }; ty::Const::from_usize(tcx, n)