-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Don't try to remove drop_in_place calls in RemoveUnneededDrops
#155044
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,14 @@ | ||
| //@ test-mir-pass: RemoveUnneededDrops | ||
| //@ test-mir-pass: Inline | ||
| //@ needs-unwind | ||
| //@ compile-flags: -Z mir-opt-level=1 | ||
|
|
||
| // EMIT_MIR remove_unneeded_drop_in_place.slice_in_place.RemoveUnneededDrops.diff | ||
| // EMIT_MIR remove_unneeded_drop_in_place.slice_in_place.Inline.diff | ||
| unsafe fn slice_in_place(ptr: *mut [char]) { | ||
| // CHECK-LABEL: fn slice_in_place(_1: *mut [char]) | ||
| // CHECK: bb0: { | ||
| // CHECK-NEXT: return; | ||
| // CHECK: bb0: { | ||
| // CHECK-NEXT: StorageLive(_2); | ||
| // CHECK-NEXT: _2 = copy _1; | ||
| // CHECK-NEXT: StorageDead(_2); | ||
| // CHECK-NEXT: return; | ||
| // CHECK-NEXT: } | ||
| std::ptr::drop_in_place(ptr) | ||
| } | ||
|
Comment on lines
6
to
12
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idk how this used to pass, given that the diff is unchanged...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You removed the compile-flags, so that probably impacted it? The filecheck validations are on final mir always... |
||
|
|
||
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.
Suggestion: now that this isn't a different pass, maybe move it into https://github.com/rust-lang/rust/tree/main/tests/mir-opt/inline? Could rename it to
inline_empty_drop_glueor something too, to make it clearer what the goal is.