Skip to content

Commit 93d7690

Browse files
authored
Merge pull request #29 from RalfJung/const-copy
state explicitly that const-items are copied bitwise
2 parents 220938f + 6abb465 commit 93d7690

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

const.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ On top of what applies to [statics](static.md), they are subject to an additiona
66
const CONST: T = EXPR;
77
```
88
is supposed to behave as-if `EXPR` was written at every use site of `CONST`.
9+
However, in current versions of rustc, `EXPR` is just computed once and the result is bit-wise copied each time `CONST` is used.
910
To make this work, we need to ensure [const safety](const_safety.md).
1011

1112
Based on this requirement, we allow other constants and [promoteds](promotion.md) to read from constants.

0 commit comments

Comments
 (0)