-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Handle inactive enum variants in MaybeUninitializedPlaces
#73879
Conversation
a7cd024
to
7f8b034
Compare
@bors try |
Awaiting bors try build completion |
⌛ Trying commit 7f8b034f63e2914164a1a2ef52b077272363f3fb with merge 7eb15f79d388f9a78cd1fb2e8eeb7267cf56f4a4... |
@ecstatic-morse: How does interact with generators? |
☀️ Try build successful - checks-azure |
Queued 7eb15f79d388f9a78cd1fb2e8eeb7267cf56f4a4 with parent 0ca7f74, future comparison URL. |
Finished benchmarking try commit (7eb15f79d388f9a78cd1fb2e8eeb7267cf56f4a4): comparison url. |
Neat! |
7f8b034
to
a6de429
Compare
Hey, you're not a ghost! 👻 The generator transform doesn't use |
a6de429
to
eb4d28b
Compare
- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2 | ||
- let mut _7: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2 |
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 god diffs of diffs XD. I love how this basically says we now have an additional variable, but it's optimized out here.
@bors r+ |
📌 Commit eb4d28b has been approved by |
You're really raising the bar on what a high quality PR means... Readable PR diff, modular design, documentation and it all causes a perf improvement along the way. |
@bors rollup=never (perf) |
@bors p=1 |
⌛ Testing commit eb4d28b with merge 04c24cf3654f0427ebb9bdb5a8aaf879d169aeb7... |
@bors yield retry |
@bors retry yield |
⌛ Testing commit eb4d28b with merge 0202cee4aabe48154df4a45a442656e0598f3d9b... |
@bors retry yield |
⌛ Testing commit eb4d28b with merge b5c3197d9d1e60bdd5ca98e8a8533a5742164739... |
@bors retry yield |
⌛ Testing commit eb4d28b with merge aafc3c614dfaf82515c3c9c8f5eccd812823603c... |
@bors retry yield |
⌛ Testing commit eb4d28b with merge 4a0a37a3373d93f4332f326546224e43d020d36c... |
💔 Test failed - checks-actions |
☀️ Test successful - checks-actions, checks-azure |
Resolves the first part of #69715.
This is the equivalent of #68528 but for
MaybeUninitializedPlaces
. Because we now notify drop elaboration that inactive enum variants might be uninitialized, some drops get marked as "open" that were previously "static". Unlike in #69715, this isn't strictly better: An "open" drop expands to more MIR than a simple call to the drop shim. However, because drop elaboration considers each field of an "open" drop separately, it can sometimes eliminate unnecessary drops of moved-from or unit-like enum variants. This is the case forOption::unwrap
, which is reflected in themir-opt
test.cc @eddyb
r? @oli-obk