File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -13,17 +13,17 @@ specify a custom packing for `struct` types.
13
13
[ motivation ] : #motivation
14
14
15
15
Many C/C++ compilers allow a packing to be specified for structs which
16
- effectivally lowers the alignment for a struct and its fields (for example with
16
+ effectively lowers the alignment for a struct and its fields (for example with
17
17
MSVC there is ` #pragma pack(N) ` ). Such packing is used extensively in certain
18
- C/C++ libraries (such as Windows API which uses it all over the place making
19
- writing Rust libraries such as ` winapi ` a nightmare ).
18
+ C/C++ libraries (such as Windows API which uses it pervasively making writing
19
+ Rust libraries such as ` winapi ` challenging ).
20
20
21
21
At the moment the only way to work around the lack of a proper
22
22
` #[repr(pack = "N")] ` attribute is to use ` #[repr(packed)] ` and then manually
23
23
fill in padding which is a burdensome task. Even then that isn't quite right
24
24
because the overall alignment of the struct would end up as 1 even though it
25
25
needs to be N (or the default if that is smaller than N), so this fills in a gap
26
- which is basically impossible to do in Rust at the moment.
26
+ which is impossible to do in Rust at the moment.
27
27
28
28
# Detailed design
29
29
[ design ] : #detailed-design
You can’t perform that action at this time.
0 commit comments