fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.8 KiB63 linesraw
1error: struct literals are not allowed here
2  --> $DIR/E0423.rs:12:32
3   |
4LL |     if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
5   |                                ^^^^^^^^^^^^^^^^
6   |
7help: surround the struct literal with parentheses
8   |
9LL |     if let S { x: _x, y: 2 } = (S { x: 1, y: 2 }) { println!("Ok"); }
10   |                                +                +
11
12error: expected expression, found `==`
13  --> $DIR/E0423.rs:14:13
14   |
15LL |     if T {} == T {} { println!("Ok"); }
16   |             ^^ expected expression
17
18error: struct literals are not allowed here
19  --> $DIR/E0423.rs:20:14
20   |
21LL |     for _ in std::ops::Range { start: 0, end: 10 } {}
22   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23   |
24help: surround the struct literal with parentheses
25   |
26LL |     for _ in (std::ops::Range { start: 0, end: 10 }) {}
27   |              +                                     +
28
29error[E0423]: expected value, found struct `T`
30  --> $DIR/E0423.rs:14:8
31   |
32LL |     if T {} == T {} { println!("Ok"); }
33   |        ^ not a value
34   |
35help: surround the struct literal with parentheses
36   |
37LL |     if (T {}) == T {} { println!("Ok"); }
38   |        +    +
39
40error[E0423]: expected function, tuple struct or tuple variant, found struct `Foo`
41  --> $DIR/E0423.rs:4:13
42   |
43LL |     struct Foo { a: bool };
44   |     ---------------------- `Foo` defined here
45LL |
46LL |     let f = Foo();
47   |             ^^^^^
48...
49LL | fn foo() {
50   | -------- similarly named function `foo` defined here
51   |
52help: use struct literal syntax instead
53   |
54LL |     let f = Foo { a: val };
55   |             ~~~~~~~~~~~~~~
56help: a function with a similar name exists
57   |
58LL |     let f = foo();
59   |             ~~~
60
61error: aborting due to 5 previous errors
62
63For more information about this error, try `rustc --explain E0423`.