rust/tests/ui/error-codes/E0423.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
1.8 KiB
Plaintext
Raw Normal View History

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"); }
| ^^^^^^^^^^^^^^^^
|
2019-05-02 17:53:09 -05:00
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 } {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-05-02 17:53:09 -05:00
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`
2018-12-25 09:56:47 -06:00
--> $DIR/E0423.rs:4:13
2018-02-07 21:35:35 -06:00
|
2020-03-21 09:03:58 -05:00
LL | struct Foo { a: bool };
| ---------------------- `Foo` defined here
2022-06-08 13:07:59 -05:00
LL |
2020-03-21 09:03:58 -05:00
LL | let f = Foo();
| ^^^^^
...
LL | fn foo() {
| -------- similarly named function `foo` defined here
|
help: use struct literal syntax instead
|
LL | let f = Foo { a: val };
| ~~~~~~~~~~~~~~
help: a function with a similar name exists
|
LL | let f = foo();
| ~~~
error: aborting due to 5 previous errors
2018-02-07 21:35:35 -06:00
2018-03-03 08:59:40 -06:00
For more information about this error, try `rustc --explain E0423`.