-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reserve
gen
keyword for gen {}
blocks and gen fn
in 2024 edition
- Loading branch information
Showing
14 changed files
with
138 additions
and
4 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: `gen` blocks are not yet implemented | ||
--> $DIR/gen_block.rs:5:18 | ||
| | ||
LL | let x = gen {}; | ||
| ^ | ||
| | ||
= help: only the keyword is reserved for now | ||
|
||
error: aborting due to previous error | ||
|
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
error: expected identifier, found reserved keyword `yield` | ||
--> $DIR/gen_block.rs:8:19 | ||
| | ||
LL | let y = gen { yield 42 }; | ||
| --- ^^^^^ expected identifier, found reserved keyword | ||
| | | ||
| while parsing this struct | ||
|
||
error[E0422]: cannot find struct, variant or union type `gen` in this scope | ||
--> $DIR/gen_block.rs:5:13 | ||
| | ||
LL | let x = gen {}; | ||
| ^^^ not found in this scope | ||
|
||
error[E0422]: cannot find struct, variant or union type `gen` in this scope | ||
--> $DIR/gen_block.rs:8:13 | ||
| | ||
LL | let y = gen { yield 42 }; | ||
| ^^^ not found in this scope | ||
|
||
error[E0422]: cannot find struct, variant or union type `gen` in this scope | ||
--> $DIR/gen_block.rs:11:5 | ||
| | ||
LL | gen {}; | ||
| ^^^ not found in this scope | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0422`. |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// revisions: e2024 none | ||
//[e2024] compile-flags: --edition 2024 -Zunstable-options | ||
|
||
fn main() { | ||
let x = gen {}; | ||
//[none]~^ ERROR: cannot find | ||
//[e2024]~^^ ERROR: `gen` blocks are not yet implemented | ||
let y = gen { yield 42 }; | ||
//[none]~^ ERROR: found reserved keyword `yield` | ||
//[none]~| ERROR: cannot find | ||
gen {}; | ||
//[none]~^ ERROR: cannot find | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: `gen` blocks are not yet implemented | ||
--> $DIR/gen_fn.rs:4:1 | ||
| | ||
LL | gen fn foo() {} | ||
| ^^^ | ||
| | ||
= help: only the keyword is reserved for now | ||
|
||
error: aborting due to previous error | ||
|
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: expected one of `#`, `async`, `const`, `default`, `extern`, `fn`, `pub`, `unsafe`, or `use`, found `gen` | ||
--> $DIR/gen_fn.rs:4:1 | ||
| | ||
LL | gen fn foo() {} | ||
| ^^^ expected one of 9 possible tokens | ||
|
||
error: aborting due to previous error | ||
|
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// revisions: e2024 none | ||
//[e2024] compile-flags: --edition 2024 -Zunstable-options | ||
|
||
gen fn foo() {} | ||
//[none]~^ ERROR: expected one of `#`, `async`, `const`, `default`, `extern`, `fn`, `pub`, `unsafe`, or `use`, found `gen` | ||
//[e2024]~^^ ERROR: `gen` blocks are not yet implemented | ||
|
||
fn main() {} |