diff options
| author | bors <bors@rust-lang.org> | 2019-01-05 22:25:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-01-05 22:25:47 +0000 |
| commit | ad9068f874007e732d59ffef141f3ccd43e43a6b (patch) | |
| tree | d5406cd031b26855632d8bb9ff37fc021111df52 /src/test/incremental/thinlto | |
| parent | 68fe5182c967259ef89dbe313e4bf80f45a53e7e (diff) | |
| parent | 211365d68c8eb5515cb658c4c240c73c122d2c5e (diff) | |
| download | rust-ad9068f874007e732d59ffef141f3ccd43e43a6b.tar.gz rust-ad9068f874007e732d59ffef141f3ccd43e43a6b.zip | |
Auto merge of #57230 - estebank:return-mismatch, r=varkor
Modify mismatched type error for functions with no return
Fix #50009.
```
error[E0308]: mismatched types
--> $DIR/coercion-missing-tail-expected-type.rs:3:24
|
LL | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
| -------- ^^^ expected i32, found ()
| |
| this function's body doesn't return
LL | x + 1;
| - help: consider removing this semicolon
|
= note: expected type `i32`
found type `()`
```
instead of
```
error[E0308]: mismatched types
--> $DIR/coercion-missing-tail-expected-type.rs:3:28
|
LL | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
| ____________________________^
LL | | x + 1;
| | - help: consider removing this semicolon
LL | | }
| |_^ expected i32, found ()
|
= note: expected type `i32`
found type `()`
```
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
