Skip to content

Commit fd426a6

Browse files
committed
Explain existance of Align field
1 parent fb37bf0 commit fd426a6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc/mir/interpret/value.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ pub enum ConstValue<'tcx> {
4646
/// An allocation together with a pointer into the allocation.
4747
/// Invariant: the pointer's `AllocId` resolves to the allocation.
4848
/// The alignment exists to allow `const_field` to have `ByRef` access to nonprimitive fields
49-
/// of packed structs.
49+
/// of packed structs. The alignment may be lower than the alignment of the `Allocation` and
50+
/// allow reads with lower alignment than what the allocation would normally permit.
51+
/// FIXME(RalfJ,oli-obk): The alignment checks are part of miri, but const eval doesn't really
52+
/// need them. Disabling them may be too hard though.
5053
ByRef(Pointer, Align, &'tcx Allocation),
5154

5255
/// Used in the HIR by using `Unevaluated` everywhere and later normalizing to one of the other

0 commit comments

Comments
 (0)