promote_consts experiment: do not promote !Freeze shared references#142287
promote_consts experiment: do not promote !Freeze shared references#142287RalfJung wants to merge 1 commit intorust-lang:masterfrom
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 |
| pub(crate) fn ctor(self) -> &'p Constructor<Cx> { | ||
| match self { | ||
| PatOrWild::Wild => &Wildcard, | ||
| PatOrWild::Wild => const { &Wildcard }, |
There was a problem hiding this comment.
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
!Freezetypes. 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.