fork/rust

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

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

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