Skip to content

Commit 6dfd1df

Browse files
committed
Add normative mention about ordering pointer bytes
In const eval, the bytes with provenance that become part of the final value must form a whole-pointer group with the bytes in the correct order. We have admonitions about this; let's also add disambiguating text to the normative language.
1 parent 9127fb7 commit 6dfd1df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/const_eval.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ r[const-eval.const-expr.if-match]
235235
## Const initializers
236236

237237
r[const-eval.const-expr.final-value-provenance]
238-
The representation of the final value of a [constant][constant initializer] or [static initializer] must only contain bytes with provenance in whole-pointer groups. If a byte has provenance but is not part of an adjacent group of bytes that form an entire pointer, compilation will fail.
238+
The representation of the final value of a [constant][constant initializer] or [static initializer] must only contain bytes with provenance in whole-pointer groups. If a byte has provenance but is not part of an adjacent group of correctly-ordered bytes that form an entire pointer, compilation will fail.
239239

240240
```rust,compile_fail
241241
# use core::mem::MaybeUninit;

0 commit comments

Comments
 (0)