File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -982,6 +982,11 @@ except that they can be enforced by the compiler.
982
982
- ``size_in_bits(N) ``: Promises that the type is not larger than a certain
983
983
size. (It may be smaller.)
984
984
985
+ - ``fixed_size ``: Promises that the type has *some * size known at compile-time,
986
+ allowing optimizations like promoting allocations to the stack. Only applies
987
+ to fixed-contents structs and closed enums, which can already infer this
988
+ information; the explicit annotation allows it to be enforced.
989
+
985
990
Collectively these features are known as "performance assertions", to
986
991
underscore the fact that they do not affect how a type is used at the source
987
992
level, but do allow for additional optimizations. We may also expose some of
You can’t perform that action at this time.
0 commit comments