-
Notifications
You must be signed in to change notification settings - Fork 13.4k
promote_consts experiment: do not promote !Freeze shared references #142287
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
Conversation
@bors2 try |
promote_consts: do not promote !Freeze shared references This is a crater experiment to measure the fallout from not promoting shared references to `!Freeze` types. IOW, this switches promotion from value-based reasoning to type-based reasoning about interior mutability. Landing this PR would fix rust-lang/unsafe-code-guidelines#493 but I doubt we can get away with that.
This comment has been minimized.
This comment has been minimized.
💔 Test failed
|
@bors2 try |
promote_consts: do not promote !Freeze shared references This is a crater experiment to measure the fallout from not promoting shared references to `!Freeze` types. IOW, this switches promotion from value-based reasoning to type-based reasoning about interior mutability. Landing this PR would fix rust-lang/unsafe-code-guidelines#493 but I doubt we can get away with that.
The job Click to see the possible cause of the failure (guessed by this bot)
|
@craterbot check |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
@@ -192,7 +192,7 @@ impl<'p, Cx: PatCx> PatOrWild<'p, Cx> { | |||
} | |||
pub(crate) fn ctor(self) -> &'p Constructor<Cx> { | |||
match self { | |||
PatOrWild::Wild => &Wildcard, | |||
PatOrWild::Wild => const { &Wildcard }, |
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.
Not even the compiler builds without some changes.^^
What happens here is that by making the const expression &Wildcard
, the lifetime extension rules kick in, and those still do value-based reasoning and therefore allow this constant without ever involving promotion.
🎉 Experiment
|
Oh wow, this is even more than the 4k regressions we got last time... and last time we technically broke more code. I guess that's just a sign of how much the ecosystem has been growing... |
This is a crater experiment to measure the fallout from not promoting shared references to
!Freeze
types. IOW, this switches promotion from value-based reasoning to type-based reasoning about interior mutability.Landing this PR would fix rust-lang/unsafe-code-guidelines#493 but I doubt we can get away with that.