Skip to content

rename unexpected_try_recover function#156635

Open
bb1yd wants to merge 1 commit into
rust-lang:mainfrom
bb1yd:rename_unexpected_try_recover
Open

rename unexpected_try_recover function#156635
bb1yd wants to merge 1 commit into
rust-lang:mainfrom
bb1yd:rename_unexpected_try_recover

Conversation

@bb1yd
Copy link
Copy Markdown
Contributor

@bb1yd bb1yd commented May 16, 2026

While reading the code, the doc comment and the name of the function unexpected_try_recover confused me. The doc said it tries to recover if it is a closing delimiter but I see no recovering code and the function always return an error.

So I change the name of the function to unexpected_err and change the return value to Diag<'a>. I also update the doc comment.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 16, 2026

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

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

rustbot commented May 16, 2026

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

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

Copy link
Copy Markdown
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Thanks! Looks neat. @bors r+ rollup

View changes since this review

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 17, 2026

📌 Commit 6d91f14 has been approved by JohnTitor

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 May 17, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 17, 2026
…r, r=JohnTitor

rename unexpected_try_recover function

While reading the code, the doc comment and the name of the function `unexpected_try_recover` confused me. The doc said it tries to recover if it is a closing delimiter but I see no recovering code and the function always return an error.

So I change the name of the function to `unexpected_err` and change the return value to `Diag<'a>`. I also update the doc comment.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 17, 2026
…r, r=JohnTitor

rename unexpected_try_recover function

While reading the code, the doc comment and the name of the function `unexpected_try_recover` confused me. The doc said it tries to recover if it is a closing delimiter but I see no recovering code and the function always return an error.

So I change the name of the function to `unexpected_err` and change the return value to `Diag<'a>`. I also update the doc comment.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 17, 2026
…r, r=JohnTitor

rename unexpected_try_recover function

While reading the code, the doc comment and the name of the function `unexpected_try_recover` confused me. The doc said it tries to recover if it is a closing delimiter but I see no recovering code and the function always return an error.

So I change the name of the function to `unexpected_err` and change the return value to `Diag<'a>`. I also update the doc comment.
rust-bors Bot pushed a commit that referenced this pull request May 17, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #151742 (Remove redundant information in `rustc_abi::Variants`)
 - #151362 (Add interior-mutability suggestion to `static_mut_refs`)
 - #156121 (compiler: suggest `.collect()` when `String` is expected and `Iterator` is found)
 - #156208 (Emit retags in codegen to support BorrowSanitizer (part 1))
 - #156596 (Split `LintExpectationId`s)
 - #156607 (ci: Update FreeBSD version to FreeBSD 14)
 - #156376 (suggest hex escapes for C-style escapes)
 - #156577 (Test EII UI tests with prefer-dynamic)
 - #156585 (explicit tail calls: ignore some tests on unsupported LLVM targets)
 - #156598 (Avoid rustfix suggestions for macro-expanded unused imports)
 - #156616 (rustdoc: add test case for `-Drustdoc::` and `--cap-lints`)
 - #156633 (Add regression test for issue #41261)
 - #156635 (rename unexpected_try_recover function)
 - #156636 (minor `rustc_mir_transform` cleanup)
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.

3 participants