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

Suggest collecting into Vec<_> #105523

Merged
merged 6 commits into from
Dec 14, 2022
Merged

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Dec 10, 2022

Fix #105510.

@rustbot
Copy link
Collaborator

rustbot commented Dec 10, 2022

r? @davidtwco

(rustbot has picked a reviewer for you, use r? to override)

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 10, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 10, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

Some changes occurred in need_type_info.rs

cc @lcnr

@bors

This comment was marked as resolved.

@estebank estebank force-pushed the suggest-collect-vec branch 2 times, most recently from 8701ab9 to 7b109bd Compare December 11, 2022 02:03
@rustbot rustbot added the A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic label Dec 11, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 11, 2022

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

Remove previously existing fallback that tried to give a good turbofish
suggestion, `need_type_info` is already good enough.

Special case `::<Vec<_>` suggestion for `Iterator::collect`.
@compiler-errors
Copy link
Member

r? @compiler-errors i'll give this another look-over after lunch

@rustbot rustbot assigned compiler-errors and unassigned davidtwco Dec 13, 2022
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

r=me with one nit addressed or not

@estebank
Copy link
Contributor Author

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Dec 13, 2022

📌 Commit 40a6275 has been approved by compiler-errors

It is now in the queue for this repository.

@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 Dec 13, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 14, 2022
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#103644 (Add docs for question mark operator for Option)
 - rust-lang#105161 (Refine when invalid prefix case error arises)
 - rust-lang#105491 (Illegal sized bounds: only suggest mutability change if needed)
 - rust-lang#105502 (Suggest impl in the scenario of typo with fn)
 - rust-lang#105523 (Suggest `collect`ing into `Vec<_>`)
 - rust-lang#105595 (Suggest dereferencing receiver arguments properly)
 - rust-lang#105611 (fold instead of obliterating args)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e5fde96 into rust-lang:master Dec 14, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 14, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 9, 2023
… r=compiler-errors

Suggest defining const parameter when appropriate

Helps a bit with rust-lang#91119.
Following rust-lang#105523's lead, I use placeholder `/* Type */` instead of `_` in the suggestion.
It should be easier for newcomers to parse.

`@rustbot` label A-diagnostics
r? diagnostics
@estebank estebank deleted the suggest-collect-vec branch November 9, 2023 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improving type inference / annotation explicitness diagnostic
6 participants