summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-04-30 23:05:27 +0200
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-07-01 21:16:25 +0200
commit3019c1cb2a6e3f599fd0d71a7ddc5f2f8b46385c (patch)
treec032f8d7aedd19b4b583fd272a7a846dca525ae9 /compiler/rustc_const_eval/src/interpret
parent6162f6f12339aa81fe16b8a64644ead497e411b2 (diff)
downloadrust-3019c1cb2a6e3f599fd0d71a7ddc5f2f8b46385c.tar.gz
rust-3019c1cb2a6e3f599fd0d71a7ddc5f2f8b46385c.zip
Put `LayoutError` behind reference to shrink result
`LayoutError` is 24 bytes, which is bigger than the `Ok` types, so let's
shrink that.
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
-rw-r--r--compiler/rustc_const_eval/src/interpret/intrinsics.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics.rs b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
index 8f4cf23770e..4f10e4837ce 100644
--- a/compiler/rustc_const_eval/src/interpret/intrinsics.rs
+++ b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
@@ -72,7 +72,7 @@ pub(crate) fn eval_nullary_intrinsic<'tcx>(
         }
         sym::pref_align_of => {
             // Correctly handles non-monomorphic calls, so there is no need for ensure_monomorphic_enough.
-            let layout = tcx.layout_of(param_env.and(tp_ty)).map_err(|e| err_inval!(Layout(e)))?;
+            let layout = tcx.layout_of(param_env.and(tp_ty)).map_err(|e| err_inval!(Layout(*e)))?;
             ConstValue::from_target_usize(layout.align.pref.bytes(), &tcx)
         }
         sym::type_id => {