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 blanket impl to the local traits #97488

Merged
merged 3 commits into from
Jul 1, 2022

Conversation

vincenzopalazzo
Copy link
Member

@vincenzopalazzo vincenzopalazzo commented May 28, 2022

This PR will add additional suggestion regarding the blanket implementation when it is possible, by generation a new help message + suggestion.

Closes #96076

Signed-off-by: Vincenzo Palazzo vincenzopalazzodev@gmail.com

@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 @nagisa (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 May 28, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 28, 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.

Left some initial comments. Do you have examples of this lint in action? They should be added to somewhere in src/test/ui, maybe src/test/ui/did_you_mean/ or src/test/ui/suggestions/ or src/test/ui/dyn-keyword/.

compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
@compiler-errors
Copy link
Member

See https://rustc-dev-guide.rust-lang.org/tests/adding.html#ui-test-walkthrough to learn how to add UI tests 😄

@nagisa
Copy link
Member

nagisa commented Jun 5, 2022

r? @compiler-errors

@compiler-errors compiler-errors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 6, 2022
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@vincenzopalazzo vincenzopalazzo force-pushed the macros/blanket_sugg branch 2 times, most recently from 814d9bc to dc4382f Compare June 22, 2022 20:08
@rust-log-analyzer

This comment has been minimized.

@vincenzopalazzo vincenzopalazzo force-pushed the macros/blanket_sugg branch 3 times, most recently from 1b059f1 to 2ed7900 Compare June 23, 2022 17:44
@rust-log-analyzer

This comment has been minimized.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
@vincenzopalazzo
Copy link
Member Author

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 30, 2022
@vincenzopalazzo vincenzopalazzo force-pushed the macros/blanket_sugg branch 2 times, most recently from e0c0b3b to 234e7fd Compare June 30, 2022 10:43
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
@vincenzopalazzo
Copy link
Member Author

@rustbot label -S-waiting-on-author +S-waiting-on-review

@compiler-errors
Copy link
Member

Cool, thanks for making the change.

@bors r+

@bors
Copy link
Contributor

bors commented Jul 1, 2022

📌 Commit 835b7a5 has been approved by compiler-errors

@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 Jul 1, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 1, 2022
Rollup of 6 pull requests

Successful merges:

 - rust-lang#97488 (Suggest blanket impl to the local traits)
 - rust-lang#98585 (Make `ThinBox<T>` covariant in `T`)
 - rust-lang#98644 (fix ICE with -Wrust-2021-incompatible-closure-captures)
 - rust-lang#98739 (fix grammar in useless doc comment lint)
 - rust-lang#98741 (Many small deriving cleanups)
 - rust-lang#98756 (Use const instead of function and make it private)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e2ed8d7 into rust-lang:master Jul 1, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 1, 2022
@vincenzopalazzo vincenzopalazzo deleted the macros/blanket_sugg branch July 1, 2022 20:34
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 2, 2022
This avoids accidental introduction (such as in rust-lang#97488).
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 2, 2022
Remove the rogue ./suggest-blanket-impl-local-trait

This executable was added in rust-lang#97488, presumably just a `git add` mistake.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 4, 2022
…n514

Lint against executable files in the root directory

This avoids accidental introduction (such as in rust-lang#97488) of executable files into the root directory, not just under library/, src/ or compiler/.

Resolves rust-lang#98792
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.

Suggest blanket impls when implementing a trait for a trait
7 participants