-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
try
blocks don't parse after return
#76271
Labels
A-parser
Area: The parsing of Rust source code to an AST
B-unstable
Blocker: Implemented in the nightly compiler and unstable.
C-bug
Category: This is a bug.
F-try_blocks
`#![feature(try_blocks)]`
Comments
scottmcm
added
B-unstable
Blocker: Implemented in the nightly compiler and unstable.
C-bug
Category: This is a bug.
F-try_blocks
`#![feature(try_blocks)]`
labels
Sep 3, 2020
matklad
added a commit
to matklad/rust
that referenced
this issue
Sep 4, 2020
Allow try blocks as the argument to return expressions Fixes rust-lang#76271 I don't think this needs to be edition-aware (phew) since `return try` in 2015 is also the start of an expression, just with a struct literal instead of a block (`return try { x: 4, y: 5 }`).
matklad
added a commit
to matklad/rust
that referenced
this issue
Sep 4, 2020
Allow try blocks as the argument to return expressions Fixes rust-lang#76271 I don't think this needs to be edition-aware (phew) since `return try` in 2015 is also the start of an expression, just with a struct literal instead of a block (`return try { x: 4, y: 5 }`).
matklad
added a commit
to matklad/rust
that referenced
this issue
Sep 4, 2020
Allow try blocks as the argument to return expressions Fixes rust-lang#76271 I don't think this needs to be edition-aware (phew) since `return try` in 2015 is also the start of an expression, just with a struct literal instead of a block (`return try { x: 4, y: 5 }`).
matklad
added a commit
to matklad/rust
that referenced
this issue
Sep 4, 2020
Allow try blocks as the argument to return expressions Fixes rust-lang#76271 I don't think this needs to be edition-aware (phew) since `return try` in 2015 is also the start of an expression, just with a struct literal instead of a block (`return try { x: 4, y: 5 }`).
matklad
added a commit
to matklad/rust
that referenced
this issue
Sep 4, 2020
Allow try blocks as the argument to return expressions Fixes rust-lang#76271 I don't think this needs to be edition-aware (phew) since `return try` in 2015 is also the start of an expression, just with a struct literal instead of a block (`return try { x: 4, y: 5 }`).
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Sep 5, 2020
Allow try blocks as the argument to return expressions Fixes rust-lang#76271 I don't think this needs to be edition-aware (phew) since `return try` in 2015 is also the start of an expression, just with a struct literal instead of a block (`return try { x: 4, y: 5 }`).
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Sep 5, 2020
Allow try blocks as the argument to return expressions Fixes rust-lang#76271 I don't think this needs to be edition-aware (phew) since `return try` in 2015 is also the start of an expression, just with a struct literal instead of a block (`return try { x: 4, y: 5 }`).
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Sep 6, 2020
Allow try blocks as the argument to return expressions Fixes rust-lang#76271 I don't think this needs to be edition-aware (phew) since `return try` in 2015 is also the start of an expression, just with a struct literal instead of a block (`return try { x: 4, y: 5 }`).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-parser
Area: The parsing of Rust source code to an AST
B-unstable
Blocker: Implemented in the nightly compiler and unstable.
C-bug
Category: This is a bug.
F-try_blocks
`#![feature(try_blocks)]`
Simple demo that won't compile but should be a type error:
But it gives a parse error instead:
(It works if you put parens, like
return (try { 4 });
)The text was updated successfully, but these errors were encountered: