2018-11-16 23:37:23 -08:00
|
|
|
error[E0308]: mismatched types
|
2019-11-09 22:05:20 +03:00
|
|
|
--> $DIR/span-preservation.rs:11:20
|
2018-11-16 23:37:23 -08:00
|
|
|
|
|
2019-07-30 13:52:32 -04:00
|
|
|
LL | let x: usize = "hello";
|
2019-11-18 21:00:24 -08:00
|
|
|
| ----- ^^^^^^^ expected `usize`, found `&str`
|
|
|
|
| |
|
|
|
|
| expected due to this
|
2018-11-16 23:37:23 -08:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-11-09 22:05:20 +03:00
|
|
|
--> $DIR/span-preservation.rs:17:29
|
2018-11-16 23:37:23 -08:00
|
|
|
|
|
2019-01-18 00:12:09 -08:00
|
|
|
LL | fn b(x: Option<isize>) -> usize {
|
|
|
|
| ----- expected `usize` because of return type
|
|
|
|
LL | match x {
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | Some(x) => { return x },
|
2019-11-15 09:37:01 -08:00
|
|
|
| ^ expected `usize`, found `isize`
|
2019-12-03 20:32:50 -05:00
|
|
|
|
|
2020-09-29 19:27:58 -07:00
|
|
|
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
2019-12-03 20:32:50 -05:00
|
|
|
|
|
|
|
|
LL | Some(x) => { return x.try_into().unwrap() },
|
2021-08-10 10:53:43 +00:00
|
|
|
| ++++++++++++++++++++
|
2018-11-16 23:37:23 -08:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-11-09 22:05:20 +03:00
|
|
|
--> $DIR/span-preservation.rs:33:22
|
2018-11-16 23:37:23 -08:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | let x = Foo { a: 10isize };
|
2019-11-15 09:37:01 -08:00
|
|
|
| ^^^^^^^ expected `usize`, found `isize`
|
2018-11-16 23:37:23 -08:00
|
|
|
|
2020-09-02 10:40:56 +03:00
|
|
|
error[E0560]: struct `Foo` has no field named `b`
|
2019-11-09 22:05:20 +03:00
|
|
|
--> $DIR/span-preservation.rs:34:26
|
2018-11-16 23:37:23 -08:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | let y = Foo { a: 10, b: 10isize };
|
2020-09-02 10:40:56 +03:00
|
|
|
| ^ `Foo` does not have this field
|
2018-11-16 23:37:23 -08:00
|
|
|
|
|
2023-06-05 20:59:41 +00:00
|
|
|
= note: all struct fields are already assigned
|
2018-11-16 23:37:23 -08:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-11-09 22:05:20 +03:00
|
|
|
--> $DIR/span-preservation.rs:39:5
|
|
|
|
|
|
2020-09-01 17:28:11 -04:00
|
|
|
LL | extern "C" fn bar() {
|
2023-09-30 19:29:41 +00:00
|
|
|
| - help: try adding a return type: `-> i32`
|
2019-11-09 22:05:20 +03:00
|
|
|
LL | 0
|
2019-11-18 11:01:02 -08:00
|
|
|
| ^ expected `()`, found integer
|
2019-11-09 22:05:20 +03:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/span-preservation.rs:44:5
|
2018-11-16 23:37:23 -08:00
|
|
|
|
|
|
|
|
LL | extern "C" fn baz() {
|
2023-09-30 19:29:41 +00:00
|
|
|
| - help: try adding a return type: `-> i32`
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | 0
|
2019-11-15 09:37:01 -08:00
|
|
|
| ^ expected `()`, found integer
|
2018-11-16 23:37:23 -08:00
|
|
|
|
2019-11-17 01:11:35 +03:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/span-preservation.rs:49:5
|
|
|
|
|
|
|
|
|
LL | extern "Rust" fn rust_abi() {
|
2023-09-30 19:29:41 +00:00
|
|
|
| - help: try adding a return type: `-> i32`
|
2019-11-17 01:11:35 +03:00
|
|
|
LL | 0
|
2019-11-18 11:01:02 -08:00
|
|
|
| ^ expected `()`, found integer
|
2019-11-17 01:11:35 +03:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/span-preservation.rs:54:5
|
|
|
|
|
|
|
|
|
LL | extern "\x43" fn c_abi_escaped() {
|
2023-09-30 19:29:41 +00:00
|
|
|
| - help: try adding a return type: `-> i32`
|
2019-11-17 01:11:35 +03:00
|
|
|
LL | 0
|
2019-11-18 11:01:02 -08:00
|
|
|
| ^ expected `()`, found integer
|
2019-11-17 01:11:35 +03:00
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
2018-11-16 23:37:23 -08:00
|
|
|
|
2019-04-17 13:26:38 -04:00
|
|
|
Some errors have detailed explanations: E0308, E0560.
|
2018-11-16 23:37:23 -08:00
|
|
|
For more information about an error, try `rustc --explain E0308`.
|