-
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
ensure that statics are inhabited #78324
Conversation
69762e3
to
1333206
Compare
Co-authored-by: BlackHoleFox <[email protected]>
extern { | ||
static VOID: Void; //~ ERROR static of uninhabited type | ||
//~| WARN: previously accepted | ||
static NEVER: !; //~ ERROR static of uninhabited type |
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.
does the diagnostic for a regular static NEVER: ! = panic!();
change with this PR?
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.
Yes, looks like it does (see the test change I just pushed)... would you prefer it to only apply to foreign items?
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.
No, having tests for it is good, I'm mostly suprised we don't have any other tests for this
@bors r+ |
📌 Commit 3bd5cc9 has been approved by |
…-obk ensure that statics are inhabited Fixes rust-lang#74840 r? @oli-obk
…-obk ensure that statics are inhabited Fixes rust-lang#74840 r? @oli-obk
☀️ Test successful - checks-actions |
Fixes #74840
r? @oli-obk