-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
internal drop_in_place shim should take &mut arguments #154274
Copy link
Copy link
Open
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The signature of
drop_in_placesays that it takes a raw pointer, but we have hacks in place to actually treat that argument as-if it was a mutable reference. These hacks are now part of the MIR semantics and have to be replicated in every MIR consumer that cares about aliasing, i.e., Miri will need a similar logic (as part of a refactor where we no longer useRetagstatements).This is obviously not great; if we want the argument of those functions to be
&mut Twe should just change it to literally have that type. We can keep the public method instd::ptrunchanged, it can dispatch to the actual function that does take a mutable reference.I wonder why those hacks were added in the first place instead of properly changing the signature?
This was apparently done in #111807.
Cc @pcwalton @erikdesjardins @oli-obk @WaffleLapkin @scottmcm