On 08/02/2012 08:43 AM, Glenn Willen wrote:
But blocks are now allowed to discard their values, where previously
this was forbidden? That is, before, it was an error to say:

fn foo() {
   5
}

But now it will be allowed? (I notice that in your first email you
said that return values could already be ignored -- is my compiler just
out of date on this question?)

Right, this would be allowed.

By return values being ignored I mean that it's possible to write, say:

    fn f() -> int {
        return 3;
    }

    fn g() {
        f();
        f();
    }

And the compiler won't complain or warn about the fact that the int was dropped.

Patrick

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to