Skip to content

Commit f035496

Browse files
ntheryehuss
authored andcommitted
document COFF alignment limit
This document the following change to the compiler that enforces the limit: rust-lang/rust#142638.
1 parent 141b1af commit f035496

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/type-layout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ r[layout.repr.alignment.intro]
482482
The `align` and `packed` modifiers can be used to respectively raise or lower the alignment of `struct`s and `union`s. `packed` may also alter the padding between fields (although it will not alter the padding inside of any field). On their own, `align` and `packed` do not provide guarantees about the order of fields in the layout of a struct or the layout of an enum variant, although they may be combined with representations (such as `C`) which do provide such guarantees.
483483

484484
r[layout.repr.alignment.constraint-alignment]
485-
The alignment is specified as an integer parameter in the form of `#[repr(align(x))]` or `#[repr(packed(x))]`. The alignment value must be a power of two from 1 up to 2<sup>29</sup>. For `packed`, if no value is given, as in `#[repr(packed)]`, then the value is 1.
485+
The alignment is specified as an integer parameter in the form of `#[repr(align(x))]` or `#[repr(packed(x))]`. The alignment value must be a power of two from 1 up to 2<sup>29</sup> or a target-specific limit. For COFF targets the limit is 8192. For `packed`, if no value is given, as in `#[repr(packed)]`, then the value is 1.
486486

487487
r[layout.repr.alignment.align]
488488
For `align`, if the specified alignment is less than the alignment of the type without the `align` modifier, then the alignment is unaffected.

0 commit comments

Comments
 (0)