Open
Description
Before #107844, assignments of Drop
types were modeled using replaced the DropAndReplace
MIR terminator. That PR changed the behaviour to use a plain Drop
followed by a plain Assign
.
This made more code compile, for instance (#107844 (comment)):
struct Foo<'a> {
v: &'a mut (),
}
impl Drop for Foo<'_> {
fn drop(&mut self) {}
}
fn bar() {
let mut v = ();
let mut x = Foo { v: &mut v };
drop(x);
x = Foo { v: &mut v };
}
Steps:
- List the changes in behaviour;
- Propose to t-lang to ratify them.