]> git.proxmox.com Git - rustc.git/blame - tests/ui/typeck/wrong-ret-type.stderr
Update upstream source from tag 'upstream/1.70.0+dfsg1'
[rustc.git] / tests / ui / typeck / wrong-ret-type.stderr
CommitLineData
b7449926 1error[E0308]: mismatched types
0731742a 2 --> $DIR/wrong-ret-type.rs:2:49
b7449926
XL
3 |
4LL | fn mk_int() -> usize { let i: isize = 3; return i; }
60c5eb7d 5 | ----- ^ expected `usize`, found `isize`
9fa01778
XL
6 | |
7 | expected `usize` because of return type
60c5eb7d 8 |
29967ef6 9help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
60c5eb7d
XL
10 |
11LL | fn mk_int() -> usize { let i: isize = 3; return i.try_into().unwrap(); }
c295e0f8 12 | ++++++++++++++++++++
b7449926
XL
13
14error: aborting due to previous error
15
16For more information about this error, try `rustc --explain E0308`.