Skip to content

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

Merged
bors merged 3 commits into
rust-lang:masterfrom
compiler-errors:tuple-wrap-suggestion
Jun 29, 2022
Merged

Clean up arg mismatch diagnostic, generalize tuple wrap suggestion#98607
bors merged 3 commits into
rust-lang:masterfrom
compiler-errors:tuple-wrap-suggestion

Conversation

@compiler-errors

@compiler-errorscompiler-errors commented Jun 28, 2022

Copy link
Copy Markdown
Contributor

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 fixWrong span for E0277 error message "trait bound is not satisfied" #98645

@rustbotrustbot 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
Copy Markdown
Contributor

r? @oli-obk

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

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

@0xCryptoZen0xCryptoZen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@compiler-errorscompiler-errors changed the title Tuple wrap suggestionClean up arg mismatch diagnostic, generalize tuple wrap suggestionJun 28, 2022
@oli-obk

Copy link
Copy Markdown
Contributor

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

bors commented Jun 29, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 23f3b0d has been approved by oli-obk

@borsbors 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 fixrust-lang#98645
@Dylan-DPCDylan-DPC mentioned this pull request Jun 29, 2022
@Dylan-DPCDylan-DPC mentioned this pull request Jun 29, 2022
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:masterJun 29, 2022
@rustbotrustbot 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@compiler-errors@rust-highfive@oli-obk@bors@0xCryptoZen@rustbot