-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Description
The signature of drop_in_place says 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 use Retag statements).
This is obviously not great; if we want the argument of those functions to be &mut T we should just change it to literally have that type. We can keep the public method in std::ptr unchanged, 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