You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class C {
let x: int;
new(x: int) { self.x = x; }
drop {
#error("dropping: %?", self.x);
}
}
fn main() {
let c = C(2);
let d = copy c;
#error("%?", d.x);
}
Even though the class has a destructor, it is valid rust code because it seems rust is ignoring the explicit copy because let d = copy c is the last use of c. I feel this is confusing, so I think rustc should report an error here.