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

show suggestion to replace generic bounds with associated types in more cases #95379

Merged
merged 1 commit into from Apr 19, 2022

Conversation

icewind1991
Copy link
Contributor

Moves the hint to replace generic parameters with associated type bounds from the "not all associated type bounds are specified"(E0191) to "to many generic type parameters provided"(E0107).

Since E0191 is only emitted in places where all associated types must be specified (when creating dyn types), the suggesting is currently not shown for other generic type uses (such as in generic type bounds). With this change the suggesting is always emitted when the number of excess generic parameters matches the number of unbound associated types.

Main motivation for the change was a lack of useful suggesting when doing

fn foo<I: Iterator<usize>>(i: I) {}

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jackh726 (or someone else) soon.

Please see the contribution instructions for more information.

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

bors commented Mar 31, 2022

☔ The latest upstream changes (presumably #95506) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Apr 5, 2022

☔ The latest upstream changes (presumably #95667) made this pull request unmergeable. Please resolve the merge conflicts.

@jackh726
Copy link
Member

Sorry for the delay reviewing here! LGTM! @bors r+

@bors
Copy link
Contributor

bors commented Apr 18, 2022

📌 Commit decc04d has been approved by jackh726

@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 Apr 18, 2022
@bors
Copy link
Contributor

bors commented Apr 19, 2022

⌛ Testing commit decc04d with merge e2661ba...

@bors
Copy link
Contributor

bors commented Apr 19, 2022

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing e2661ba to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 19, 2022
@bors bors merged commit e2661ba into rust-lang:master Apr 19, 2022
@rustbot rustbot added this to the 1.62.0 milestone Apr 19, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e2661ba): comparison url.

Summary:

  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: no relevant changes found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 0 1 0 1
mean2 N/A N/A -1.8% N/A -1.8%
max N/A N/A -1.8% N/A -1.8%

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

None yet

6 participants