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
The following code works fine if drop(x) is used instead of let _ = x. The closure function generated contains just a _0 = () and a return. Trans probably does some magic, but I haven't been able to locate it.
structFoo<'a>(&'amutbool);impl<'a>DropforFoo<'a>{fndrop(&mutself){*self.0 = true;}}fnf<T:FnOnce()>(t:T){t()}fnmain(){letmut ran_drop = false;{let x = Foo(&mut ran_drop);let x = move || {let _ = x;};f(x);}assert!(ran_drop);}