Skip to content

Commit

Permalink
Explain existance of Align field
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jun 19, 2019
1 parent fb37bf0 commit fd426a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc/mir/interpret/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ pub enum ConstValue<'tcx> {
/// An allocation together with a pointer into the allocation.
/// Invariant: the pointer's `AllocId` resolves to the allocation.
/// The alignment exists to allow `const_field` to have `ByRef` access to nonprimitive fields
/// of packed structs.
/// of packed structs. The alignment may be lower than the alignment of the `Allocation` and
/// allow reads with lower alignment than what the allocation would normally permit.
/// FIXME(RalfJ,oli-obk): The alignment checks are part of miri, but const eval doesn't really
/// need them. Disabling them may be too hard though.
ByRef(Pointer, Align, &'tcx Allocation),

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

0 comments on commit fd426a6

Please sign in to comment.