Skip to content

Allow try blocks as the argument to return expressions - #76274

Merged
bors merged 1 commit into
rust-lang:masterfrom
scottmcm:fix-76271
Sep 7, 2020
Merged

Allow try blocks as the argument to return expressions#76274
bors merged 1 commit into
rust-lang:masterfrom
scottmcm:fix-76271

Conversation

@scottmcm

Copy link
Copy Markdown
Member

Fixes#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 }).

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 3, 2020
@matklad

Copy link
Copy Markdown
Contributor

r? @petrochenkov

@jyn514jyn514 added A-parser Area: The lexing & parsing of Rust source code to an AST F-try_blocks `#![feature(try_blocks)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 3, 2020
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Sep 3, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 791f93c has been approved by petrochenkov

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 3, 2020
matklad added a commit to matklad/rust that referenced this pull request Sep 4, 2020
Allow try blocks as the argument to return expressions
Fixesrust-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 }`).
@matkladmatklad mentioned this pull request Sep 4, 2020
matklad added a commit to matklad/rust that referenced this pull request Sep 4, 2020
Allow try blocks as the argument to return expressions
Fixesrust-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 }`).
@matkladmatklad mentioned this pull request Sep 4, 2020
matklad added a commit to matklad/rust that referenced this pull request Sep 4, 2020
Allow try blocks as the argument to return expressions
Fixesrust-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 }`).
@matkladmatklad mentioned this pull request Sep 4, 2020
matklad added a commit to matklad/rust that referenced this pull request Sep 4, 2020
Allow try blocks as the argument to return expressions
Fixesrust-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 }`).
@matkladmatklad mentioned this pull request Sep 4, 2020
matklad added a commit to matklad/rust that referenced this pull request Sep 4, 2020
Allow try blocks as the argument to return expressions
Fixesrust-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 }`).
@matkladmatklad mentioned this pull request Sep 4, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 5, 2020
Allow try blocks as the argument to return expressions
Fixesrust-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 pull request Sep 5, 2020
Allow try blocks as the argument to return expressions
Fixesrust-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 pull request Sep 6, 2020
Allow try blocks as the argument to return expressions
Fixesrust-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 }`).
This was referenced Sep 6, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 7, 2020
Rollup of 18 pull requests
Successful merges:
- rust-lang#76273 (Move some Vec UI tests into alloc unit tests)
- rust-lang#76274 (Allow try blocks as the argument to return expressions)
- rust-lang#76287 (Remove an unnecessary allowed lint)
- rust-lang#76293 (Implementation of incompatible features error)
- rust-lang#76299 (Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`)
- rust-lang#76302 (Address review comments on `Peekable::next_if`)
- rust-lang#76303 (Link to `#capacity-and-reallocation` when using with_capacity)
- rust-lang#76305 (Move various ui const tests to `library`)
- rust-lang#76309 (Indent a note to make folding work nicer)
- rust-lang#76312 (time.rs: Make spelling of "Darwin" consistent)
- rust-lang#76318 (Use ops::ControlFlow in rustc_data_structures::graph::iterate)
- rust-lang#76324 (Move Vec slice UI tests in library)
- rust-lang#76338 (add some intra-doc links to `Iterator`)
- rust-lang#76340 (Remove unused duplicated `trivial_dropck_outlives`)
- rust-lang#76344 (Improve docs for `std::env::args()`)
- rust-lang#76346 (Docs: nlink example typo)
- rust-lang#76358 (Minor grammar fix in doc comment for soft-deprecated methods)
- rust-lang#76364 (Disable atomics on avr target.)
Failed merges:
- rust-lang#76304 (Make delegation methods of `std::net::IpAddr` unstably const)
r? @ghost
@bors
bors merged commit 6545985 into rust-lang:masterSep 7, 2020
@rustbotrustbot added this to the 1.48.0 milestone Sep 7, 2020
scottmcm added a commit to scottmcm/rust that referenced this pull request Oct 13, 2020
To pick up rust-lang/rustfmt#4461
So that rustfmt has the parsing fix from rust-lang#76274
...and do a reformat that it wants.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parserArea: The lexing & parsing of Rust source code to an ASTF-try_blocks`#![feature(try_blocks)]`S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

try blocks don't parse after return

9 participants

@scottmcm@rust-highfive@matklad@petrochenkov@bors@estebank@nikomatsakis@jyn514@rustbot