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