Rename align to default_align on Scalar and Primitive#158542
Conversation
|
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE machinery
cc @bjorn3 |
|
|
This comment has been minimized.
This comment has been minimized.
4edeed7 to
2aaf9e0
Compare
|
cc @rust-lang/miri |
| /// | ||
| /// This is the type alignment for the corresponding built-in. | ||
| /// In other contexts it might have different alignment. | ||
| pub fn platform_align<C: HasDataLayout>(self, cx: &C) -> AbiAlign { |
There was a problem hiding this comment.
Naming bikeshed: what about default_align?
There was a problem hiding this comment.
Sounds good -- better conveys "might not the the default" elsewhere than "platform" does since of course we're always targeting just one platform.
To emphasize that just because you see a `Scalar(I32)` that doesn't really tell you anything about the alignment it has -- one should be looking at the type (well, the place) for that. No actual layout or behaviour changes in *this* PR.
2aaf9e0 to
f98365f
Compare
align to platform_align on Scalar and Primitivealign to default_align on Scalar and Primitive
Co-authored-by: Ralf Jung <post@ralfj.de>
To emphasize that just because you see a
Scalar(I32)that doesn't really tell you anything about the alignment it has -- one should be looking at the type (well, the place) for that.(The
sizemethod doesn't really have that problem -- i32 is always 4 bytes, no matter the context -- so is left untouched.)No actual layout or behaviour changes in this PR. Just the rename and some comments.
r? @workingjubilee