File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ let push_integer = Vec::<i32>::push;
23
23
let slice_reverse = <[i32 ]>:: reverse ;
24
24
```
25
25
26
+ If the path denotes an associated constant, and if the function containing the expression is executed at runtime,
27
+ then the associated constant is guaranteed to be evaluated. This is true even if the path expression occurs in dead code.
28
+ In particular, unsafe code inside a function can rely on the fact that all associated constants syntactically
29
+ occurring in the function have successfully evaluated (and not panicked).
30
+ Note that this is only guaranteed for all currently existing syntactic constructs; in the future, a new
31
+ kind of block may be introduced such that constants inside that block are * not* unconditionally guaranteed to be evaluated.
32
+ If the function is not executed at runtime, associated constants inside of it may or may not be evaluated.
33
+
26
34
[ _PathInExpression_ ] : ../paths.md#paths-in-expressions
27
35
[ _QualifiedPathInExpression_ ] : ../paths.md#qualified-paths
28
36
[ place expressions ] : ../expressions.md#place-expressions-and-value-expressions
You can’t perform that action at this time.
0 commit comments