fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

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