1 error[E0308]: mismatched types
2 --> $DIR/span-preservation.rs:11:20
4 LL | let x: usize = "hello";
5 | ^^^^^^^ expected usize, found reference
7 = note: expected type `usize`
8 found reference `&'static str`
10 error[E0308]: mismatched types
11 --> $DIR/span-preservation.rs:17:29
13 LL | fn b(x: Option<isize>) -> usize {
14 | ----- expected `usize` because of return type
16 LL | Some(x) => { return x },
17 | ^ expected usize, found isize
19 error[E0308]: mismatched types
20 --> $DIR/span-preservation.rs:33:22
22 LL | let x = Foo { a: 10isize };
23 | ^^^^^^^ expected usize, found isize
25 error[E0560]: struct `c::Foo` has no field named `b`
26 --> $DIR/span-preservation.rs:34:26
28 LL | let y = Foo { a: 10, b: 10isize };
29 | ^ `c::Foo` does not have this field
31 = note: available fields are: `a`
33 error[E0308]: mismatched types
34 --> $DIR/span-preservation.rs:39:5
36 LL | extern fn bar() {
37 | - possibly return type missing here?
39 | ^ expected (), found integer
41 = note: expected type `()`
42 found type `{integer}`
44 error[E0308]: mismatched types
45 --> $DIR/span-preservation.rs:44:5
47 LL | extern "C" fn baz() {
48 | - possibly return type missing here?
50 | ^ expected (), found integer
52 = note: expected unit type `()`
53 found type `{integer}`
55 error[E0308]: mismatched types
56 --> $DIR/span-preservation.rs:49:5
58 LL | extern "Rust" fn rust_abi() {
59 | - possibly return type missing here?
61 | ^ expected (), found integer
63 = note: expected type `()`
64 found type `{integer}`
66 error[E0308]: mismatched types
67 --> $DIR/span-preservation.rs:54:5
69 LL | extern "\x43" fn c_abi_escaped() {
70 | - possibly return type missing here?
72 | ^ expected (), found integer
74 = note: expected type `()`
75 found type `{integer}`
77 error: aborting due to 8 previous errors
79 Some errors have detailed explanations: E0308, E0560.
80 For more information about an error, try `rustc --explain E0308`.