-
Notifications
You must be signed in to change notification settings - Fork 13.4k
try
blocks don't parse after return
#76271
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
A-parser
Area: The lexing & 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
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 }`).
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
A-parser
Area: The lexing & 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: