forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
let
is not allowed in struct field definitions
Co-authored-by: jyn514 <jyn514@gmail.com> Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
- Loading branch information
1 parent
ab37a83
commit 6071b4b
Showing
2 changed files
with
25 additions
and
3 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
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,10 +1,16 @@ | ||
error: expected identifier, found keyword `let` | ||
--> $DIR/removed-syntax-field-let.rs:2:5 | ||
| | ||
LL | struct S { | ||
| - while parsing this struct | ||
LL | let foo: (), | ||
| ^^^ expected identifier, found keyword | ||
| | ||
= note: the `let` keyword is not allowed in `struct` fields | ||
= note: see <https://doc.rust-lang.org/book/ch05-01-defining-structs.html> for more information | ||
help: remove the let, the `let` keyword is not allowed in struct field definitions | ||
| | ||
LL - let foo: (), | ||
LL + foo: (), | ||
| | ||
|
||
error: aborting due to previous error | ||
|