Skip to content

Add regression test for unreachable_code with try operator#157429

Open
Berektassuly wants to merge 1 commit into
rust-lang:mainfrom
Berektassuly:forbid-unreachable-try-test
Open

Add regression test for unreachable_code with try operator#157429
Berektassuly wants to merge 1 commit into
rust-lang:mainfrom
Berektassuly:forbid-unreachable-try-test

Conversation

@Berektassuly
Copy link
Copy Markdown

@Berektassuly Berektassuly commented Jun 4, 2026

Fixes #76053

Adds a regression test for #![forbid(unreachable_code)] with the ? operator.

@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 Jun 4, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 4, 2026

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 18 candidates

Copy link
Copy Markdown
Member

@Kivooeo Kivooeo left a comment

Choose a reason for hiding this comment

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

This indeed looks correct, thanks for your PR! Once CI is green I'll add this into merge queue

View changes since this review

@Kivooeo Kivooeo assigned Kivooeo and unassigned nikomatsakis Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression: #[forbid(unreachable_code)] incompatible with the Try ('?') operator

4 participants