1 error[E0308]: mismatched types
3 = note: expected type `()`
6 error[E0308]: mismatched types
7 --> $DIR/span-preservation.rs:12:20
9 LL | let x: usize = "hello";
10 | ^^^^^^^ expected usize, found reference
12 = note: expected type `usize`
13 found type `&'static str`
15 error[E0308]: mismatched types
16 --> $DIR/span-preservation.rs:18:29
18 LL | fn b(x: Option<isize>) -> usize {
19 | ----- expected `usize` because of return type
21 LL | Some(x) => { return x },
22 | ^ expected usize, found isize
24 error[E0308]: mismatched types
25 --> $DIR/span-preservation.rs:34:22
27 LL | let x = Foo { a: 10isize };
28 | ^^^^^^^ expected usize, found isize
30 error[E0560]: struct `c::Foo` has no field named `b`
31 --> $DIR/span-preservation.rs:35:26
33 LL | let y = Foo { a: 10, b: 10isize };
34 | ^ `c::Foo` does not have this field
36 = note: available fields are: `a`
38 error[E0308]: mismatched types
39 --> $DIR/span-preservation.rs:48:5
41 LL | extern "C" fn baz() {
42 | - possibly return type missing here?
44 | ^ expected (), found integer
46 = note: expected type `()`
47 found type `{integer}`
49 error: aborting due to 6 previous errors
51 Some errors have detailed explanations: E0308, E0560.
52 For more information about an error, try `rustc --explain E0308`.