Skip to content

Commit

Permalink
Update compiler/rustc_mir_transform/src/gvn.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Goulet <michael@errs.io>
  • Loading branch information
cjgillot and compiler-errors authored Jul 6, 2024
1 parent b97f83b commit 12edc8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_mir_transform/src/gvn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1396,8 +1396,8 @@ fn op_to_prop_const<'tcx>(
// by `GlobalAlloc::Memory`, so do fall through to copying if needed.
// FIXME: find a way to treat this more uniformly (probably by fixing codegen)
if let GlobalAlloc::Memory(alloc) = ecx.tcx.global_alloc(alloc_id)
// Transmuting a constant is just an offset in the allocation. If the alignement of the
// allocation is noe enough, fallback to copying into a properly aligned value.
// Transmuting a constant is just an offset in the allocation. If the alignment of the
// allocation is not enough, fallback to copying into a properly aligned value.
&& alloc.inner().align >= op.layout.align.abi
{
return Some(ConstValue::Indirect { alloc_id, offset });
Expand Down

0 comments on commit 12edc8d

Please sign in to comment.