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

Lang item cleanups #103603

Merged
merged 8 commits into from
Oct 31, 2022
Merged

Lang item cleanups #103603

merged 8 commits into from
Oct 31, 2022

Conversation

camsteffen
Copy link
Contributor

Various cleanups related to lang items.

@rustbot
Copy link
Collaborator

rustbot commented Oct 26, 2022

r? @oli-obk

(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. labels Oct 26, 2022
@rustbot
Copy link
Collaborator

rustbot commented Oct 26, 2022

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Copy link
Contributor

@oli-obk oli-obk 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 comments resolved

compiler/rustc_hir/src/lang_items.rs Show resolved Hide resolved
compiler/rustc_monomorphize/src/collector.rs Outdated Show resolved Hide resolved
@rustbot rustbot added the A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic label Oct 29, 2022
@rustbot
Copy link
Collaborator

rustbot commented Oct 29, 2022

rustc_error_messages was changed

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

@camsteffen
Copy link
Contributor Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Oct 29, 2022

📌 Commit 88d7150 has been approved by oli-obk

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 Oct 29, 2022
@camsteffen
Copy link
Contributor Author

rustc_error_messages was changed

I just removed a diagnostic struct in favor of tcx.require_lang_item.

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 31, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#103338 (Fix unreachable_pub suggestion for enum with fields)
 - rust-lang#103603 (Lang item cleanups)
 - rust-lang#103732 (Revert "Make the `c` feature for `compiler-builtins` opt-in instead of inferred")
 - rust-lang#103766 (Add tracking issue to `error_in_core`)
 - rust-lang#103789 (Update E0382.md)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c1c2922 into rust-lang:master Oct 31, 2022
@rustbot rustbot added this to the 1.67.0 milestone Oct 31, 2022
@camsteffen camsteffen deleted the refactor-lang branch October 31, 2022 15:53
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 18, 2022
Add variant_name function to `LangItem`

Clippy has an internal lint that checks for the usage of hardcoded def paths and suggests to replace them with a lang or diagnostic item, if possible. This was implemented with a hack, by getting all the variants of the `LangItem` enum and then index into it with the position of the `LangItem` in the `items` list. This is no longer possible, because the `items` list can't be accessed anymore.

Follow up to rust-lang#103603

cc `@camsteffen`
r? `@oli-obk`

This is blocking the sync between Clippy and Rust. I'm not sure if this is the best solution here, or if I should add a method `items()` to `LanguageItems` and keep the code in Clippy unchanged.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 21, 2022
Add variant_name function to `LangItem`

Clippy has an internal lint that checks for the usage of hardcoded def paths and suggests to replace them with a lang or diagnostic item, if possible. This was implemented with a hack, by getting all the variants of the `LangItem` enum and then index into it with the position of the `LangItem` in the `items` list. This is no longer possible, because the `items` list can't be accessed anymore.

Follow up to rust-lang#103603

cc `@camsteffen`
r? `@oli-obk`

This is blocking the sync between Clippy and Rust. I'm not sure if this is the best solution here, or if I should add a method `items()` to `LanguageItems` and keep the code in Clippy unchanged.
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants