On Thu, Oct 17, 2013 at 2:06 AM, Ziad Hatahet <hata...@gmail.com> wrote:
> > > On Wed, Oct 16, 2013 at 3:38 PM, Patrick Walton <pwal...@mozilla.com>wrote: > >> There's no difference except that "let _" runs the destructor immediately >> whereas "let _foo" runs the destructor at the end of the block. (This is >> admittedly subtle.) >> >> > > I tried the following code snippet, but nothing got printed out. What am I > missing? > > -- cut -- > > struct S; > > impl Drop for S { > fn drop(&mut self) { > println("drop"); > } > } > > fn main() { > let _ = S; > } > > > --end cut -- > > Replacing `let _` with `let _s` printed "drop" as expected. > > Thanks > > -- > Ziad > https://github.com/mozilla/rust/issues/6892
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev