diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-06-19 09:57:07 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-06-19 09:57:07 +0200 |
| commit | fd426a6ae9b9470bcfee19c251d60b5a2c2c6048 (patch) | |
| tree | ae4d27b57f7fed6bf752192ba95c1cc199007d59 | |
| parent | fb37bf0037833026c3ffe6ec1fe3367fec5a5e0e (diff) | |
| download | rust-fd426a6ae9b9470bcfee19c251d60b5a2c2c6048.tar.gz rust-fd426a6ae9b9470bcfee19c251d60b5a2c2c6048.zip | |
Explain existance of `Align` field
| -rw-r--r-- | src/librustc/mir/interpret/value.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc/mir/interpret/value.rs b/src/librustc/mir/interpret/value.rs index 904576a2c1d..7b26ebf57a1 100644 --- a/src/librustc/mir/interpret/value.rs +++ b/src/librustc/mir/interpret/value.rs @@ -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 |
