File: E0423.stderr

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (65 lines) | stat: -rw-r--r-- 1,887 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
error: struct literals are not allowed here
  --> $DIR/E0423.rs:12:32
   |
LL |     if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
   |                                ^^^^^^^^^^^^^^^^
   |
help: surround the struct literal with parentheses
   |
LL |     if let S { x: _x, y: 2 } = (S { x: 1, y: 2 }) { println!("Ok"); }
   |                                +                +

error: expected expression, found `==`
  --> $DIR/E0423.rs:14:13
   |
LL |     if T {} == T {} { println!("Ok"); }
   |             ^^ expected expression

error: struct literals are not allowed here
  --> $DIR/E0423.rs:20:14
   |
LL |     for _ in std::ops::Range { start: 0, end: 10 } {}
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: surround the struct literal with parentheses
   |
LL |     for _ in (std::ops::Range { start: 0, end: 10 }) {}
   |              +                                     +

error[E0423]: expected value, found struct `T`
  --> $DIR/E0423.rs:14:8
   |
LL |     if T {} == T {} { println!("Ok"); }
   |        ^ not a value
   |
help: surround the struct literal with parentheses
   |
LL |     if (T {}) == T {} { println!("Ok"); }
   |        +    +

error[E0423]: expected function, tuple struct or tuple variant, found struct `Foo`
  --> $DIR/E0423.rs:4:13
   |
LL |     struct Foo { a: bool };
   |     ---------------------- `Foo` defined here
LL |
LL |     let f = Foo();
   |             ^^^^^
...
LL | fn foo() {
   | -------- similarly named function `foo` defined here
   |
help: use struct literal syntax instead
   |
LL -     let f = Foo();
LL +     let f = Foo { a: val };
   |
help: a function with a similar name exists (notice the capitalization difference)
   |
LL -     let f = Foo();
LL +     let f = foo();
   |

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0423`.