1 error[E0308]: mismatched types
2 --> $DIR/span-preservation.rs:11:20
4 LL | let x: usize = "hello";
5 | ----- ^^^^^^^ expected `usize`, found `&str`
9 error[E0308]: mismatched types
10 --> $DIR/span-preservation.rs:17:29
12 LL | fn b(x: Option<isize>) -> usize {
13 | ----- expected `usize` because of return type
15 LL | Some(x) => { return x },
16 | ^ expected `usize`, found `isize`
18 help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
20 LL | Some(x) => { return x.try_into().unwrap() },
21 | ++++++++++++++++++++
23 error[E0308]: mismatched types
24 --> $DIR/span-preservation.rs:33:22
26 LL | let x = Foo { a: 10isize };
27 | ^^^^^^^ expected `usize`, found `isize`
29 error[E0560]: struct `Foo` has no field named `b`
30 --> $DIR/span-preservation.rs:34:26
32 LL | let y = Foo { a: 10, b: 10isize };
33 | ^ `Foo` does not have this field
35 = note: available fields are: `a`
37 error[E0308]: mismatched types
38 --> $DIR/span-preservation.rs:39:5
40 LL | extern "C" fn bar() {
41 | - possibly return type missing here?
43 | ^ expected `()`, found integer
45 error[E0308]: mismatched types
46 --> $DIR/span-preservation.rs:44:5
48 LL | extern "C" fn baz() {
49 | - possibly return type missing here?
51 | ^ expected `()`, found integer
53 error[E0308]: mismatched types
54 --> $DIR/span-preservation.rs:49:5
56 LL | extern "Rust" fn rust_abi() {
57 | - possibly return type missing here?
59 | ^ expected `()`, found integer
61 error[E0308]: mismatched types
62 --> $DIR/span-preservation.rs:54:5
64 LL | extern "\x43" fn c_abi_escaped() {
65 | - possibly return type missing here?
67 | ^ expected `()`, found integer
69 error: aborting due to 8 previous errors
71 Some errors have detailed explanations: E0308, E0560.
72 For more information about an error, try `rustc --explain E0308`.