Skip to content

Cleanup unused diagnostic emission methods - #153452

Merged
rust-bors[bot] merged 11 commits into
rust-lang:mainfrom
GuillaumeGomez:migrate-diag
Mar 6, 2026
Merged

Cleanup unused diagnostic emission methods#153452
rust-bors[bot] merged 11 commits into
rust-lang:mainfrom
GuillaumeGomez:migrate-diag

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Part of #153099.

To remove lint_level, we need to remove all functions calling it. One of them is TyCtxt::node_span_lint, so removing it.

r? @JonathanBrouwer

@rustbot

Copy link
Copy Markdown
Collaborator

HIR ty lowering was modified

cc @fmease

@rustbotrustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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 Mar 5, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

JonathanBrouwer is currently at their maximum review capacity.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

Comment threadcompiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs
@rustbotrustbot 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 Mar 5, 2026
@rust-log-analyzer

This comment has been minimized.

@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbotrustbot added the T-clippy Relevant to the Clippy team. label Mar 5, 2026
@GuillaumeGomez

Copy link
Copy Markdown
MemberAuthor

PR is not ready, we need to figure out why the tracking is currently broken in clippy:

--- tests/ui/track-diagnostics-clippy.stderr
+++ <stderr output>
error: casting to the same type is unnecessary (`u32` -> `u32`)
--> tests/ui/track-diagnostics-clippy.rs:LL:CC
... 2 lines skipped ...
| ^^^^^^^^ help: try: `a`
|
- = note: -Ztrack-diagnostics: created at clippy_lints/src/casts/unnecessary_cast.rs:LL:CC
+ = note: -Ztrack-diagnostics: created at compiler/rustc_middle/src/lint.rs:LL:CC
= note: `-D clippy::unnecessary-cast` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_cast)]`
... 18 lines skipped ...
error: aborting due to 2 previous errors

You can run this (specific) test with:

TESTNAME=track-diagnostics-clippy ./x.py test src/tools/clippy/ --stage 1

@rust-log-analyzer

This comment has been minimized.

@JonathanBrouwer

Copy link
Copy Markdown
Member

r=me if ci green & you agree with my commit

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez

Copy link
Copy Markdown
MemberAuthor

@bors r=JonathanBrouwer rollup

@rust-bors

rust-borsBot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e01a7e7 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-borsrust-borsBot 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 6, 2026
rust-borsBot pushed a commit that referenced this pull request Mar 6, 2026
…uwer
Rollup of 14 pull requests
Successful merges:
- #153466 (`rust-analyzer` subtree update)
- #151280 (Fix incorrect trailing comma suggested in no_accessible_fields)
- #152593 (Box in `ValTreeKind::Branch(Box<[I::Const]>)` changed to `List`)
- #153174 (std: add wasm64 to sync::Once and thread_parking atomics cfg guards)
- #153485 (libcore float tests: replace macro shadowing by const-compatible macro)
- #153495 (Fix ICE in `offset_of!` error recovery)
- #152040 (Do not emit ConstEvaluatable goals if type-const)
- #152741 (Suppress invalid suggestions in destructuring assignment)
- #153189 (refactor: move `check_align` to `parse_alignment`)
- #153230 (Roll rustfmt reviewers for in-tree rustfmt)
- #153445 (Consider try blocks as block-like for overflowed expr)
- #153452 (Cleanup unused diagnostic emission methods)
- #153476 (bootstrap.py: fix typo "parallle")
- #153483 (Preserve parentheses around `Fn` trait bounds in pretty printer)
@rust-bors
rust-borsBot merged commit 69dc318 into rust-lang:mainMar 6, 2026
11 checks passed
@rustbotrustbot added this to the 1.96.0 milestone Mar 6, 2026
rust-timer added a commit that referenced this pull request Mar 6, 2026
Rollup merge of #153452 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer
Cleanup unused diagnostic emission methods
Part of #153099.
To remove `lint_level`, we need to remove all functions calling it. One of them is `TyCtxt::node_span_lint`, so removing it.
r? @JonathanBrouwer
@GuillaumeGomez
GuillaumeGomez deleted the migrate-diag branch March 7, 2026 10:11
github-actionsBot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Mar 9, 2026
…uwer
Rollup of 14 pull requests
Successful merges:
- rust-lang/rust#153466 (`rust-analyzer` subtree update)
- rust-lang/rust#151280 (Fix incorrect trailing comma suggested in no_accessible_fields)
- rust-lang/rust#152593 (Box in `ValTreeKind::Branch(Box<[I::Const]>)` changed to `List`)
- rust-lang/rust#153174 (std: add wasm64 to sync::Once and thread_parking atomics cfg guards)
- rust-lang/rust#153485 (libcore float tests: replace macro shadowing by const-compatible macro)
- rust-lang/rust#153495 (Fix ICE in `offset_of!` error recovery)
- rust-lang/rust#152040 (Do not emit ConstEvaluatable goals if type-const)
- rust-lang/rust#152741 (Suppress invalid suggestions in destructuring assignment)
- rust-lang/rust#153189 (refactor: move `check_align` to `parse_alignment`)
- rust-lang/rust#153230 (Roll rustfmt reviewers for in-tree rustfmt)
- rust-lang/rust#153445 (Consider try blocks as block-like for overflowed expr)
- rust-lang/rust#153452 (Cleanup unused diagnostic emission methods)
- rust-lang/rust#153476 (bootstrap.py: fix typo "parallle")
- rust-lang/rust#153483 (Preserve parentheses around `Fn` trait bounds in pretty printer)
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Mar 21, 2026
…uwer
Rollup of 14 pull requests
Successful merges:
- rust-lang/rust#153466 (`rust-analyzer` subtree update)
- rust-lang/rust#151280 (Fix incorrect trailing comma suggested in no_accessible_fields)
- rust-lang/rust#152593 (Box in `ValTreeKind::Branch(Box<[I::Const]>)` changed to `List`)
- rust-lang/rust#153174 (std: add wasm64 to sync::Once and thread_parking atomics cfg guards)
- rust-lang/rust#153485 (libcore float tests: replace macro shadowing by const-compatible macro)
- rust-lang/rust#153495 (Fix ICE in `offset_of!` error recovery)
- rust-lang/rust#152040 (Do not emit ConstEvaluatable goals if type-const)
- rust-lang/rust#152741 (Suppress invalid suggestions in destructuring assignment)
- rust-lang/rust#153189 (refactor: move `check_align` to `parse_alignment`)
- rust-lang/rust#153230 (Roll rustfmt reviewers for in-tree rustfmt)
- rust-lang/rust#153445 (Consider try blocks as block-like for overflowed expr)
- rust-lang/rust#153452 (Cleanup unused diagnostic emission methods)
- rust-lang/rust#153476 (bootstrap.py: fix typo "parallle")
- rust-lang/rust#153483 (Preserve parentheses around `Fn` trait bounds in pretty printer)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 30, 2026
…rcote
HIR ty lowering: Move some things into submodules
By commit:
1. Move `compute_object_lifetime_bound` into submodule `dyn_trait` since it's only used there unsurprisingly
2. Move a `impl Diagnostic for AmbiguousAssocItem` into submodule `errors` and rename the diagnostic struct
* For what it represents, it was way too prominent right at the start of `lower_type_relative_path` which didn't use to be the case prior to PR rust-lang#153452
3. Move a distractingly lengthy "error builder" into a new fn `report_ambiguous_assoc_item` in submodule `errors`
* Since we unconditionally `return Err(_)` after calling this new function, we fix a debug assertion (see commit message & description of added UI test for details)
Fixesrust-lang#139387
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 30, 2026
…rcote
HIR ty lowering: Move some things into submodules
By commit:
1. Move `compute_object_lifetime_bound` into submodule `dyn_trait` since it's only used there unsurprisingly
2. Move a `impl Diagnostic for AmbiguousAssocItem` into submodule `errors` and rename the diagnostic struct
* For what it represents, it was way too prominent right at the start of `lower_type_relative_path` which didn't use to be the case prior to PR rust-lang#153452
3. Move a distractingly lengthy "error builder" into a new fn `report_ambiguous_assoc_item` in submodule `errors`
* Since we unconditionally `return Err(_)` after calling this new function, we fix a debug assertion (see commit message & description of added UI test for details)
Fixesrust-lang#139387
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 30, 2026
…rcote
HIR ty lowering: Move some things into submodules
By commit:
1. Move `compute_object_lifetime_bound` into submodule `dyn_trait` since it's only used there unsurprisingly
2. Move a `impl Diagnostic for AmbiguousAssocItem` into submodule `errors` and rename the diagnostic struct
* For what it represents, it was way too prominent right at the start of `lower_type_relative_path` which didn't use to be the case prior to PR rust-lang#153452
3. Move a distractingly lengthy "error builder" into a new fn `report_ambiguous_assoc_item` in submodule `errors`
* Since we unconditionally `return Err(_)` after calling this new function, we fix a debug assertion (see commit message & description of added UI test for details)
Fixesrust-lang#139387
rust-timer added a commit that referenced this pull request May 30, 2026
Rollup merge of #157027 - fmease:hirtylo-mv-things, r=nnethercote
HIR ty lowering: Move some things into submodules
By commit:
1. Move `compute_object_lifetime_bound` into submodule `dyn_trait` since it's only used there unsurprisingly
2. Move a `impl Diagnostic for AmbiguousAssocItem` into submodule `errors` and rename the diagnostic struct
* For what it represents, it was way too prominent right at the start of `lower_type_relative_path` which didn't use to be the case prior to PR #153452
3. Move a distractingly lengthy "error builder" into a new fn `report_ambiguous_assoc_item` in submodule `errors`
* Since we unconditionally `return Err(_)` after calling this new function, we fix a debug assertion (see commit message & description of added UI test for details)
Fixes#139387
ghaaj pushed a commit to ghaaj/polygrammar that referenced this pull request Aug 7, 2026
…uwer
Rollup of 14 pull requests
Successful merges:
- rust-lang/rust#153466 (`rust-analyzer` subtree update)
- rust-lang/rust#151280 (Fix incorrect trailing comma suggested in no_accessible_fields)
- rust-lang/rust#152593 (Box in `ValTreeKind::Branch(Box<[I::Const]>)` changed to `List`)
- rust-lang/rust#153174 (std: add wasm64 to sync::Once and thread_parking atomics cfg guards)
- rust-lang/rust#153485 (libcore float tests: replace macro shadowing by const-compatible macro)
- rust-lang/rust#153495 (Fix ICE in `offset_of!` error recovery)
- rust-lang/rust#152040 (Do not emit ConstEvaluatable goals if type-const)
- rust-lang/rust#152741 (Suppress invalid suggestions in destructuring assignment)
- rust-lang/rust#153189 (refactor: move `check_align` to `parse_alignment`)
- rust-lang/rust#153230 (Roll rustfmt reviewers for in-tree rustfmt)
- rust-lang/rust#153445 (Consider try blocks as block-like for overflowed expr)
- rust-lang/rust#153452 (Cleanup unused diagnostic emission methods)
- rust-lang/rust#153476 (bootstrap.py: fix typo "parallle")
- rust-lang/rust#153483 (Preserve parentheses around `Fn` trait bounds in pretty printer)
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 17, 2026
…uwer
Rollup of 14 pull requests
Successful merges:
- rust-lang/rust#153466 (`rust-analyzer` subtree update)
- rust-lang/rust#151280 (Fix incorrect trailing comma suggested in no_accessible_fields)
- rust-lang/rust#152593 (Box in `ValTreeKind::Branch(Box<[I::Const]>)` changed to `List`)
- rust-lang/rust#153174 (std: add wasm64 to sync::Once and thread_parking atomics cfg guards)
- rust-lang/rust#153485 (libcore float tests: replace macro shadowing by const-compatible macro)
- rust-lang/rust#153495 (Fix ICE in `offset_of!` error recovery)
- rust-lang/rust#152040 (Do not emit ConstEvaluatable goals if type-const)
- rust-lang/rust#152741 (Suppress invalid suggestions in destructuring assignment)
- rust-lang/rust#153189 (refactor: move `check_align` to `parse_alignment`)
- rust-lang/rust#153230 (Roll rustfmt reviewers for in-tree rustfmt)
- rust-lang/rust#153445 (Consider try blocks as block-like for overflowed expr)
- rust-lang/rust#153452 (Cleanup unused diagnostic emission methods)
- rust-lang/rust#153476 (bootstrap.py: fix typo "parallle")
- rust-lang/rust#153483 (Preserve parentheses around `Fn` trait bounds in pretty printer)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-clippyRelevant to the Clippy team.T-compilerRelevant 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.

4 participants

@GuillaumeGomez@rustbot@rust-log-analyzer@JonathanBrouwer