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

Clean up arg mismatch diagnostic, generalize tuple wrap suggestion #98607

Merged
merged 3 commits into from
Jun 29, 2022

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jun 28, 2022

This is based on top of #97542, so just look at the last commit which contains the relevant changes.

  1. Remove final_arg_types which was one of the last places we were using raw (usize) indices instead of typed indices in the arg mismatch suggestion code.
  2. Improve the tuple wrap suggestion, now we suggest things like call(a, b, c, d) -> call(a, (b, c), d) 😺
  3. Folded in fix Wrong span for E0277 error message "trait bound is not satisfied" #98645

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 28, 2022
@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 28, 2022
Copy link

@ccbond ccbond left a comment

Choose a reason for hiding this comment

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

LGTM

@compiler-errors compiler-errors changed the title Tuple wrap suggestion Clean up arg mismatch diagnostic, generalize tuple wrap suggestion Jun 28, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Jun 29, 2022

Took me a bit to untangle the happy-path/error-path difference in check_argument_types... I saw you did some extraction into separate functions, so that's good movement forward on cleaning all this up. The typed indices are great!

@bors r+

@bors
Copy link
Contributor

bors commented Jun 29, 2022

📌 Commit 23f3b0d has been approved by oli-obk

@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 29, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 29, 2022
…on, r=oli-obk

Clean up arg mismatch diagnostic, generalize tuple wrap suggestion

This is based on top of rust-lang#97542, so just look at the last commit which contains the relevant changes.

1. Remove `final_arg_types` which was one of the last places we were using raw (`usize`) indices instead of typed indices in the arg mismatch suggestion code.
2. Improve the tuple wrap suggestion, now we suggest things like `call(a, b, c, d)` -> `call(a, (b, c), d)` 😺
3. Folded in fix rust-lang#98645
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 29, 2022
Rollup of 7 pull requests

Successful merges:

 - rust-lang#98415 (Migrate some `rustc_borrowck` diagnostics to `SessionDiagnostic`)
 - rust-lang#98479 (Add `fetch_not` method on `AtomicBool`)
 - rust-lang#98499 (Erase regions in New Abstract Consts)
 - rust-lang#98516 (library: fix uefi va_list type definition)
 - rust-lang#98554 (Fix box with custom allocator in miri)
 - rust-lang#98607 (Clean up arg mismatch diagnostic, generalize tuple wrap suggestion)
 - rust-lang#98625 (emit Retag for compound types with reference fields)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit fcbb2e8 into rust-lang:master Jun 29, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jun 29, 2022
@compiler-errors compiler-errors deleted the tuple-wrap-suggestion branch August 11, 2023 20:21
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.

Wrong span for E0277 error message "trait bound is not satisfied"
6 participants