Skip to content

refactor(diag): Simplify adding of new diagnostics#17015

Merged
epage merged 17 commits into
rust-lang:masterfrom
epage:lint-pass
May 20, 2026
Merged

refactor(diag): Simplify adding of new diagnostics#17015
epage merged 17 commits into
rust-lang:masterfrom
epage:lint-pass

Conversation

@epage

@epage epage commented May 19, 2026

Copy link
Copy Markdown
Contributor

What does this PR try to resolve?

Adding a parse diagnostic went from

  1. Write the diagnostic (checking the level)
  2. Add the mod
  3. Add two uses
  4. Call the diagnostic

To

  1. Write the diagnostic
  2. Add the mod
  3. Add an entry to PARSE_PASS_RULES

This also adds the following correctness checks

How to test and review this PR?

This is the final step in the process started in #16975.

Note: a hack for missing_lints_features is introduced and then removed where it is first treated as a lint and then corrected to be a diagnostic

@rustbot rustbot added Command-fetch S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 19, 2026
@rustbot

rustbot commented May 19, 2026

Copy link
Copy Markdown
Collaborator

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, weihanglo

Comment on lines -232 to -235
// This is a short term hack to allow `blanket_hint_mostly_unused`
// to run without requiring `-Zcargo-lints`, which should hopefully
// improve the testing experience while we are collecting feedback
if workspace.gctx().cli_unstable().profile_hint_mostly_unused {

@Muscraft Muscraft May 20, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@joshtriplett, just wanted to make you aware of this change

View changes since the review

@Muscraft Muscraft added this pull request to the merge queue May 20, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 20, 2026
@epage epage added this pull request to the merge queue May 20, 2026
Merged via the queue into rust-lang:master with commit a6d3fec May 20, 2026
29 checks passed
@epage epage deleted the lint-pass branch May 20, 2026 10:06
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 20, 2026
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request May 27, 2026
Update cargo submodule

13 commits in 4d1f984518c77fad6eeef4f40153b002a659e662..fbb61be30e5f9ac3a6ad58e56a5c0f5db2d2b3ef
2026-05-15 17:12:01 +0000 to 2026-05-26 15:08:03 +0000
- fix(compiler): forward verbose flag to rustc for local crates (rust-lang/cargo#17006)
- Fix CVE-2026-5222 and CVE-2026-5223 (rust-lang/cargo#17031)
- Don't use the network for a publish dry-run test  (rust-lang/cargo#17027)
- feat: Break out `RegistryConfig` and `crate_url` for interpreting `RegistryConfig::dl` (rust-lang/cargo#17011)
- refactor(diag): Sort the PARSE_PASS_RULES (rust-lang/cargo#17019)
- fix(artifact)!: Remove compat mode from artifacts (rust-lang/cargo#17016)
- refactor(diag): Simplify adding of new diagnostics (rust-lang/cargo#17015)
- test(package): Mark a network test that timed out on me (rust-lang/cargo#17017)
- refactor(diag): Pull in the parse pass (rust-lang/cargo#17008)
- test(lints): Avoid compiling where possible (rust-lang/cargo#17007)
- fix(diag): Report deferred diagnostics like other diagnostics (rust-lang/cargo#16994)
- refactor: drop `-Zunstable-options` for `rustdoc --emit` (rust-lang/cargo#17002)
- chore(deps): update msrv (1 version) to v1.95 (rust-lang/cargo#17001)
@rustbot rustbot added this to the 1.98.0 milestone May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants