Skip to content

Commit c2ba8c3

Browse files
committed
updated stderr
1 parent 6bc8168 commit c2ba8c3

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

tests/ui/typeck/tail-return-type-mismatch.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
33
fn f() -> isize {
44
return g();
5-
} //~ ERROR mismatched types [E0308]
5+
//~^ ERROR mismatched types [E0308]
6+
}
67

78
fn g() -> usize {
89
return 0;

tests/ui/typeck/tail-return-type-mismatch.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
error[E0308]: mismatched types
2-
--> $DIR/tail-typeck.rs:1:26
2+
--> $DIR/tail-return-type-mismatch.rs:4:12
33
|
4-
LL | fn f() -> isize { return g(); }
5-
| ----- ^^^ expected `isize`, found `usize`
6-
| |
7-
| expected `isize` because of return type
4+
LL | fn f() -> isize {
5+
| ----- expected `isize` because of return type
6+
LL | return g();
7+
| ^^^ expected `isize`, found `usize`
88
|
99
help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
1010
|
11-
LL | fn f() -> isize { return g().try_into().unwrap(); }
12-
| ++++++++++++++++++++
11+
LL | return g().try_into().unwrap();
12+
| ++++++++++++++++++++
1313

1414
error: aborting due to 1 previous error
1515

0 commit comments

Comments
 (0)