Skip to content
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

add test for try-block-in-match-arm #120540

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

Fishrock123
Copy link
Contributor

@Fishrock123 Fishrock123 commented Feb 1, 2024

This is noted as an implementation concern under the tracking issue for ? and try blocks. (Issue 31436)

Refs: #31436

@rustbot
Copy link
Collaborator

rustbot commented Feb 1, 2024

r? @nnethercote

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 1, 2024
@@ -0,0 +1,11 @@
// run-pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't need to be run-pass. Can you change this to // check-pass?

@compiler-errors
Copy link
Member

(pls amend the commit rather than pushing a small additional commit.)

Also, I actually wonder if it's better to fold this into tests/ui/binding/optional_comma_in_match_arm.rs. If so, that test can also be marked as // check-pass, idk why it's marked as run-pass currently since it doesn't actually do much.

This is noted as an implementation concern under the tracking issue for `?` and `try` blocks. (Issue 31436)
@Fishrock123
Copy link
Contributor Author

Fishrock123 commented Feb 1, 2024

Also, I actually wonder if it's better to fold this into tests/ui/binding/optional_comma_in_match_arm.rs.

@compiler-errors every other arm in the match of that test returns (), whereas try { } returns Result<_, _> so I don't think it's a good fit there.


Amended the commit with check-pass.

@compiler-errors
Copy link
Member

It doesn't need to be in the same function, but it certainly looks like it could live in that file.

@compiler-errors
Copy link
Member

@bors r+ rollup

nvm

@bors
Copy link
Contributor

bors commented Feb 1, 2024

📌 Commit bedd81e has been approved by compiler-errors

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Feb 1, 2024

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

@bors bors 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 Feb 1, 2024
@Fishrock123
Copy link
Contributor Author

For posterity: it was easier to keep the test separate because the binding test runs in edition 2015 mode whereas the try block feature we care about is the 2018+ edition one.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 1, 2024
…h-arm, r=compiler-errors

add test for try-block-in-match-arm

This is noted as an implementation concern under the tracking issue for `?` and `try` blocks. (Issue 31436)

Refs: rust-lang#31436
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 1, 2024
…h-arm, r=compiler-errors

add test for try-block-in-match-arm

This is noted as an implementation concern under the tracking issue for `?` and `try` blocks. (Issue 31436)

Refs: rust-lang#31436
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 3, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#119759 (Add FileCheck annotations to dataflow-const-prop tests)
 - rust-lang#120323 (On E0277 be clearer about implicit `Sized` bounds on type params and assoc types)
 - rust-lang#120473 (Only suggest removal of `as_*` and `to_` conversion methods on E0308)
 - rust-lang#120520 (Some cleanups around diagnostic levels.)
 - rust-lang#120540 (add test for try-block-in-match-arm)
 - rust-lang#120547 (`#![feature(inline_const_pat)]` is no longer incomplete)
 - rust-lang#120552 (Correctly check `never_type` feature gating)
 - rust-lang#120555 (put pnkfelix (me) back on the review queue.)
 - rust-lang#120556 (Improve the diagnostics for unused generic parameters)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#119759 (Add FileCheck annotations to dataflow-const-prop tests)
 - rust-lang#120323 (On E0277 be clearer about implicit `Sized` bounds on type params and assoc types)
 - rust-lang#120473 (Only suggest removal of `as_*` and `to_` conversion methods on E0308)
 - rust-lang#120520 (Some cleanups around diagnostic levels.)
 - rust-lang#120540 (add test for try-block-in-match-arm)
 - rust-lang#120547 (`#![feature(inline_const_pat)]` is no longer incomplete)
 - rust-lang#120552 (Correctly check `never_type` feature gating)
 - rust-lang#120555 (put pnkfelix (me) back on the review queue.)
 - rust-lang#120556 (Improve the diagnostics for unused generic parameters)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#119759 (Add FileCheck annotations to dataflow-const-prop tests)
 - rust-lang#120323 (On E0277 be clearer about implicit `Sized` bounds on type params and assoc types)
 - rust-lang#120473 (Only suggest removal of `as_*` and `to_` conversion methods on E0308)
 - rust-lang#120540 (add test for try-block-in-match-arm)
 - rust-lang#120547 (`#![feature(inline_const_pat)]` is no longer incomplete)
 - rust-lang#120552 (Correctly check `never_type` feature gating)
 - rust-lang#120555 (put pnkfelix (me) back on the review queue.)
 - rust-lang#120556 (Improve the diagnostics for unused generic parameters)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 592beb1 into rust-lang:master Feb 5, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 5, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 5, 2024
Rollup merge of rust-lang#120540 - Fishrock123:test-try-block-in-match-arm, r=compiler-errors

add test for try-block-in-match-arm

This is noted as an implementation concern under the tracking issue for `?` and `try` blocks. (Issue 31436)

Refs: rust-lang#31436
@Fishrock123 Fishrock123 deleted the test-try-block-in-match-arm branch February 5, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant 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.

5 participants