Skip to content

Move conditions out of recover/report functions. #97166

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

Merged
merged 5 commits into from
Jun 2, 2022

Conversation

nnethercote
Copy link
Contributor

Parser has six recover/report functions that are passed a boolean, and
nothing is done if the boolean has a particular value.

This PR moves the tests outside the functions. This has the following effects.

  • The number of lines of code goes down.
  • Some use items become shorter.
  • Avoids the strangeness whereby 11 out of 12 calls to
    maybe_recover_from_bad_qpath pass true as the second argument.
  • Makes it clear at the call site that only one of
    maybe_recover_from_bad_type_plus and maybe_report_ambiguous_plus will be
    run.

r? @estebank

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 19, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 19, 2022
@nnethercote
Copy link
Contributor Author

@estebank: six day review ping!

@estebank
Copy link
Contributor

estebank commented Jun 1, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 1, 2022

📌 Commit 7b6c5c7 has been approved by estebank

@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 Jun 1, 2022
@estebank
Copy link
Contributor

estebank commented Jun 1, 2022

Sorry for the review delay @nnethercote!

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 1, 2022
Rollup of 6 pull requests

Successful merges:

 - rust-lang#95594 (Additional `*mut [T]` methods)
 - rust-lang#97130 (rustdoc: avoid including impl blocks with filled-in generics)
 - rust-lang#97166 (Move conditions out of recover/report functions.)
 - rust-lang#97605 (Mention filename in suggestion when it differs from primary span)
 - rust-lang#97613 (rustdoc: Improve calculation of "Impls on Foreign Types")
 - rust-lang#97626 (rename PointerAddress → PointerExposeAddress)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d126de1 into rust-lang:master Jun 2, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 2, 2022
@nnethercote nnethercote deleted the move-conditions-out branch June 2, 2022 05:11
# for free to join this conversation on GitHub. Already have an account? # 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