Document rustc_abi::VariantLayout - #163256
Conversation
|
r? @mu001999 rustbot has assigned @mu001999. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
783d49c to
908b36e
Compare
| #[cfg_attr(feature = "nightly", derive(StableHash))] | ||
| pub struct VariantLayout<FieldIdx: Idx> { | ||
| pub size: Size, | ||
| // FIXME: enum variants should not need their own `BackendRepr`, so this can be removed |
There was a problem hiding this comment.
I'd taken this comment from #151742 (comment), but have since found this piece of code:
rust/compiler/rustc_abi/src/layout.rs
Lines 677 to 680 in 2350b22
which seems to contradict it
There was a problem hiding this comment.
Also this?
rust/compiler/rustc_abi/src/layout.rs
Lines 1021 to 1035 in 2350b22
There was a problem hiding this comment.
Well that 2nd snippet shows the hacks we need to ensure that backend_repr is mostly consistent. If variant did not have a backend_repr, we could simplify things.
That example also shows that size is another value that variants probably shouldn't have.
|
@rustbot reroll |
|
@rustbot reroll |
|
r? @RalfJung |
|
|
Follow-up to rust-lang#151742.
908b36e to
f5c85c8
Compare
|
@rustbot ready |
|
Thanks! @bors r+ rollup |
…uwer Rollup of 6 pull requests Successful merges: - #150824 (Document platform-specific behavior of `current_exe`, including that Linux can add `" (deleted)"`) - #159564 (Allow elided ('static) lifetimes in `thread_local!`) - #163026 (hir_typeck: simplify `upvar::determine_capture_info` impl) - #163256 (Document `rustc_abi::VariantLayout`) - #163366 (Stabilize SyncView) - #163376 (Option, Result: not all arguments passed to map_or are eagerly evaluated)
…uwer Rollup of 6 pull requests Successful merges: - #150824 (Document platform-specific behavior of `current_exe`, including that Linux can add `" (deleted)"`) - #159564 (Allow elided ('static) lifetimes in `thread_local!`) - #163026 (hir_typeck: simplify `upvar::determine_capture_info` impl) - #163256 (Document `rustc_abi::VariantLayout`) - #163366 (Stabilize SyncView) - #163376 (Option, Result: not all arguments passed to map_or are eagerly evaluated)
Follow-up to #151742.
cc @saethlin @moulins @RalfJung as you were involved with the original PR