-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db13fa8
commit c73fce2
Showing
2 changed files
with
48 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
struct A; | ||
struct B(); | ||
struct C {} | ||
struct Unit; | ||
struct Tuple(); | ||
struct Struct {} | ||
|
||
fn main() { | ||
A {}; | ||
A { .. } = A { ..A }; | ||
Unit {}; | ||
Tuple {}; | ||
Struct {}; | ||
|
||
B {}; | ||
C {}; | ||
Unit(); | ||
Tuple(); | ||
Struct(); | ||
|
||
A; | ||
B; | ||
C; | ||
Unit; | ||
Tuple; | ||
Struct; | ||
|
||
Unit { .. } = Unit { ..Unit }; | ||
Tuple { .. } = Tuple { ..Tuple() }; | ||
Struct { .. } = Struct { ..Struct {} }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,38 @@ | ||
error[E0423]: expected value, found struct `C` | ||
--> examples/misc_9.rs:14:5 | ||
error[E0423]: expected value, found struct `Struct` | ||
--> examples/misc_9.rs:16:5 | ||
| | ||
1 | struct A; | ||
| --------- similarly named unit struct `A` defined here | ||
2 | struct B(); | ||
3 | struct C {} | ||
| ----------- `C` defined here | ||
3 | struct Struct {} | ||
| ---------------- `Struct` defined here | ||
... | ||
14 | C; | ||
| ^ | ||
16 | Struct; | ||
| ^^^^^^ help: use struct literal syntax instead: `Struct {}` | ||
|
||
error[E0618]: expected function, found struct `Unit` | ||
--> examples/misc_9.rs:10:5 | ||
| | ||
1 | struct Unit; | ||
| ----------- struct `Unit` defined here | ||
... | ||
10 | Unit(); | ||
| ^^^^-- | ||
| | | ||
| call expression requires function | ||
| | ||
help: use struct literal syntax instead | ||
help: `Unit` is a unit struct, and does not take parentheses to be constructed | ||
| | ||
14 | C {}; | ||
| ~~~~ | ||
help: a unit struct with a similar name exists | ||
10 - Unit(); | ||
10 + Unit; | ||
| | ||
14 | A; | ||
| ~ | ||
|
||
For more information about this error, try `rustc --explain E0423`. | ||
error: could not compile `code` (example "misc_9") due to 1 previous error | ||
error[E0423]: expected function, tuple struct or tuple variant, found struct `Struct` | ||
--> examples/misc_9.rs:12:5 | ||
| | ||
3 | struct Struct {} | ||
| ---------------- `Struct` defined here | ||
... | ||
12 | Struct(); | ||
| ^^^^^^^^ help: use struct literal syntax instead: `Struct {}` | ||
|
||
Some errors have detailed explanations: E0423, E0618. | ||
For more information about an error, try `rustc --explain E0423`. | ||
error: could not compile `code` (example "misc_9") due to 3 previous errors |