On 10/16/13 3:31 PM, Chris Morgan wrote:
1. Is there a functional difference between the lines `let _ = f()` and `let _foo = f()` (assuming no usage of the variable)? These will probably become common if this check is in place.
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.)
2. When will Drop happen? I suspect this would make it happen at the end of the callee block, whereas silent ignoring probably before returning execution to the callee?
See above.
3. Would such a thing be able to be overridden with something along the lines of #[allow(unused_return_values)]?
Yes, and on a per-callee basis as well. (Lots of C functions want return values to be ignorable, so this should be able to be specified.)
Patrick _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev