[rust-dev] RFC: Ignore trailing semicolons

Erick Tryzelaar erick.tryzelaar at gmail.com
Thu Aug 2 10:11:54 PDT 2012


On Thu, Aug 2, 2012 at 10:03 AM, Niko Matsakis <niko at alum.mit.edu> wrote:
>
> These all have unit (or bottom) return type.  We could require semicolons
> after these.  At least you would not then be able to write:
>
>     if cond { return }
>
> but rather
>
>     if cond { return; }
>
> and not
>
>     fn foo() -> int { return 22 }
>
> but rather
>
>     fn foo() -> int { return 22; }


I like this. I think all of my returns have a semicolon, whether or
not they actually need them. What about for fail? Is there a good
example of using fail as an expression?


More information about the Rust-dev mailing list