Skip to content

Commit 4f4ec2c

Browse files
committed
[docs] LibraryEvolution: Bring back "fixed-size" as a perf assertion.
1 parent 9df9ee9 commit 4f4ec2c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/LibraryEvolution.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,11 @@ except that they can be enforced by the compiler.
982982
- ``size_in_bits(N)``: Promises that the type is not larger than a certain
983983
size. (It may be smaller.)
984984

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+
985990
Collectively these features are known as "performance assertions", to
986991
underscore the fact that they do not affect how a type is used at the source
987992
level, but do allow for additional optimizations. We may also expose some of

0 commit comments

Comments
 (0)