-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test self-in-enum-definition
#62916
Conversation
@bors rollup |
#[repr(u8)] | ||
enum Alpha { | ||
V1 = 41, | ||
V2 = Self::V1 as u8 + 1, // OK -- but why? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really... why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh you're gonna lovehate this
- latest nightly won't compile old versions of winapi #49765
- Allow variant discriminant initializers to refer to other initializer… #50072
- [DO NOT MERGE] see what breaks when we remove this recursive-enum-discriminants hack #61723
It's a peephole hack for excactly Enum::Variant as int
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it felt familiar... 😭.
At some point we should do what @RalfJung suggested in #61723 (comment) since Ralf is right that this is so incredibly niche and imo clearly a bug...
Oh well... not much to do about it here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusted the comment to refer to #50072... Should be good to merge now. :)
This comment has been minimized.
This comment has been minimized.
b3c7704
to
76929c7
Compare
76929c7
to
2e193f7
Compare
@bors r+ rollup |
📌 Commit 7fdfe8b has been approved by |
Add test `self-in-enum-definition` Apparently there was no test covering this... r? @oli-obk cc @petrochenkov
Rollup of 10 pull requests Successful merges: - rust-lang#62641 (Regenerate character tables for Unicode 12.1) - rust-lang#62716 (state also in the intro that UnsafeCell has no effect on &mut) - rust-lang#62738 (Remove uses of mem::uninitialized from std::sys::cloudabi) - rust-lang#62772 (Suggest trait bound on type parameter when it is unconstrained) - rust-lang#62890 (Normalize use of backticks in compiler messages for libsyntax/*) - rust-lang#62905 (Normalize use of backticks in compiler messages for doc) - rust-lang#62916 (Add test `self-in-enum-definition`) - rust-lang#62917 (Always emit trailing slash error) - rust-lang#62926 (Fix typo in mem::uninitialized doc) - rust-lang#62927 (use PanicMessage in MIR, kill InterpError::description) Failed merges: r? @ghost
Rollup of 10 pull requests Successful merges: - #62641 (Regenerate character tables for Unicode 12.1) - #62716 (state also in the intro that UnsafeCell has no effect on &mut) - #62738 (Remove uses of mem::uninitialized from std::sys::cloudabi) - #62772 (Suggest trait bound on type parameter when it is unconstrained) - #62890 (Normalize use of backticks in compiler messages for libsyntax/*) - #62905 (Normalize use of backticks in compiler messages for doc) - #62916 (Add test `self-in-enum-definition`) - #62917 (Always emit trailing slash error) - #62926 (Fix typo in mem::uninitialized doc) - #62927 (use PanicMessage in MIR, kill InterpError::description) Failed merges: r? @ghost
Apparently there was no test covering this...
r? @oli-obk
cc @petrochenkov