Rollup merge of #33324 - birkenfeld:issue-30497, r=GuillaumeGomez

E0269: add suggestion to check for trailing semicolons

In situations where the value of the last expression must be inferred,
rustc will not emit the "you might need to remove the semicolon" warning,
so at least note this in the extended description.

Fixes: #30497
This commit is contained in:
Manish Goregaokar 2016-05-03 01:02:44 +05:30
commit 68c29e0904
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98

View file

@ -635,7 +635,17 @@ fn foo(x: u8) -> u8 {
```
It is advisable to find out what the unhandled cases are and check for them,
returning an appropriate value or panicking if necessary.
returning an appropriate value or panicking if necessary. Check if you need
to remove a semicolon from the last expression, like in this case:
```ignore
fn foo(x: u8) -> u8 {
inner(2*x + 1);
}
```
The semicolon discards the return value of `inner`, instead of returning
it from `foo`.
"##,
E0270: r##"