Skip to content

Remove unused spans from AttributeKind - #156065

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
mejrs:spanculler
May 3, 2026
Merged

Remove unused spans from AttributeKind#156065
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
mejrs:spanculler

Conversation

@mejrs

@mejrsmejrs commented May 1, 2026

Copy link
Copy Markdown
Member

Recently I noticed some spans in diagnostic attributes were never used. I went through and checked the other variants too.

@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred in match checking

cc @Nadrieril

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in coverage instrumentation.

cc @Zalathar

Some changes occurred in compiler/rustc_hir/src/attrs

cc @jdonszelmann, @JonathanBrouwer

The Clippy subtree was changed

cc @rust-lang/clippy

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbotrustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels May 1, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

r? @oli-obk

rustbot has assigned @oli-obk.
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: compiler
  • compiler expanded to 73 candidates
  • Random selection from 20 candidates

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 1, 2026
rust-borsBot pushed a commit that referenced this pull request May 1, 2026
Remove unused spans from AttributeKind
@rust-bors

rust-borsBot commented May 1, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 54e80b0 (54e80b014e9516914bee6af96045039078e5ca91, parent: 67bcaa9c4b1b1015efae3d591155c79760b1e0a5)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (54e80b0): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary 3.6%, secondary 1.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

meanrangecount
Regressions ❌
(primary)
3.6%[3.6%, 3.6%]1
Regressions ❌
(secondary)
1.8%[0.4%, 3.1%]2
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)3.6%[3.6%, 3.6%]1

Cycles

Results (secondary 5.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
26.7%[2.7%, 50.7%]2
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
-0.6%[-0.8%, -0.4%]7
All ❌✅ (primary)--0

Binary size

Results (primary -0.0%, secondary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-0.0%[-0.1%, -0.0%]33
Improvements ✅
(secondary)
-0.1%[-0.6%, -0.0%]43
All ❌✅ (primary)-0.0%[-0.1%, -0.0%]33

Bootstrap: 487.864s -> 482.272s (-1.15%)
Artifact size: 390.99 MiB -> 390.92 MiB (-0.02%)

@rustbotrustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 2, 2026

@JonathanBrouwerJonathanBrouwer left a comment

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.

@rust-bors

rust-borsBot commented May 2, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 9a23b67 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-review Status: Awaiting review from the assignee but also interested parties. labels May 2, 2026
This was referenced May 2, 2026
rust-borsBot pushed a commit that referenced this pull request May 2, 2026
…uwer
Rollup of 9 pull requests
Successful merges:
- #156030 (Make stable hashing names consistent (part 1))
- #156020 (Improve source code for `librustdoc/visit_ast.rs`)
- #156021 (Clean up some traits)
- #156028 (Add a `Local::arg(i)` helper constructor)
- #156037 (Add AcceptContext::expect_no_args)
- #156040 (Add missing alias to mailmap)
- #156048 (Make `diverging_type_vars` a vec of `TyVid`)
- #156053 (Reuse CTFE MIR for constructors.)
- #156059 (compiler: Print valid `-Zmir-enable-passes` names if invalid name is used)
Failed merges:
- #155940 (refactor rustc_on_unimplemented's filtering)
- #156065 (Remove unused spans from AttributeKind)
@rust-borsrust-borsBot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 2, 2026
@rust-bors

This comment has been minimized.

@rustbot

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-borsBot commented May 2, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4a13f36 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 May 2, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 2, 2026
Remove unused spans from AttributeKind
Recently I noticed some spans in diagnostic attributes were never used. I went through and checked the other variants too.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 2, 2026
Remove unused spans from AttributeKind
Recently I noticed some spans in diagnostic attributes were never used. I went through and checked the other variants too.
rust-borsBot pushed a commit that referenced this pull request May 3, 2026
…uwer
Rollup of 5 pull requests
Successful merges:
- #152277 (Validate source snippet when format input is raw string)
- #155940 (refactor rustc_on_unimplemented's filtering)
- #156065 (Remove unused spans from AttributeKind)
- #156079 (Move and rename the `clone-never.rs` test)
- #156091 (change field `tools` on `AttributeParser` to hold `&'tcx RegisteredTools`)
@jhprattjhpratt mentioned this pull request May 3, 2026
rust-borsBot pushed a commit that referenced this pull request May 3, 2026
Rollup of 5 pull requests
Successful merges:
- #155666 (Interning cleanups)
- #155940 (refactor rustc_on_unimplemented's filtering)
- #156065 (Remove unused spans from AttributeKind)
- #156079 (Move and rename the `clone-never.rs` test)
- #156091 (change field `tools` on `AttributeParser` to hold `&'tcx RegisteredTools`)
@rust-bors
rust-borsBot merged commit c3afa21 into rust-lang:mainMay 3, 2026
11 checks passed
@rustbotrustbot added this to the 1.97.0 milestone May 3, 2026
rust-timer added a commit that referenced this pull request May 3, 2026
Rollup merge of #156065 - mejrs:spanculler, r=JonathanBrouwer
Remove unused spans from AttributeKind
Recently I noticed some spans in diagnostic attributes were never used. I went through and checked the other variants too.
github-actionsBot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request May 4, 2026
…uwer
Rollup of 9 pull requests
Successful merges:
- rust-lang/rust#156030 (Make stable hashing names consistent (part 1))
- rust-lang/rust#156020 (Improve source code for `librustdoc/visit_ast.rs`)
- rust-lang/rust#156021 (Clean up some traits)
- rust-lang/rust#156028 (Add a `Local::arg(i)` helper constructor)
- rust-lang/rust#156037 (Add AcceptContext::expect_no_args)
- rust-lang/rust#156040 (Add missing alias to mailmap)
- rust-lang/rust#156048 (Make `diverging_type_vars` a vec of `TyVid`)
- rust-lang/rust#156053 (Reuse CTFE MIR for constructors.)
- rust-lang/rust#156059 (compiler: Print valid `-Zmir-enable-passes` names if invalid name is used)
Failed merges:
- rust-lang/rust#155940 (refactor rustc_on_unimplemented's filtering)
- rust-lang/rust#156065 (Remove unused spans from AttributeKind)
pullBot pushed a commit to Kokoro2336/rust-analyzer that referenced this pull request May 4, 2026
…uwer
Rollup of 9 pull requests
Successful merges:
- rust-lang/rust#156030 (Make stable hashing names consistent (part 1))
- rust-lang/rust#156020 (Improve source code for `librustdoc/visit_ast.rs`)
- rust-lang/rust#156021 (Clean up some traits)
- rust-lang/rust#156028 (Add a `Local::arg(i)` helper constructor)
- rust-lang/rust#156037 (Add AcceptContext::expect_no_args)
- rust-lang/rust#156040 (Add missing alias to mailmap)
- rust-lang/rust#156048 (Make `diverging_type_vars` a vec of `TyVid`)
- rust-lang/rust#156053 (Reuse CTFE MIR for constructors.)
- rust-lang/rust#156059 (compiler: Print valid `-Zmir-enable-passes` names if invalid name is used)
Failed merges:
- rust-lang/rust#155940 (refactor rustc_on_unimplemented's filtering)
- rust-lang/rust#156065 (Remove unused spans from AttributeKind)
copybara-serviceBot pushed a commit to google/crubit that referenced this pull request May 4, 2026
1. The `HashStable` trait was renamed to `StableHash`, and its method was also renamed to match.
rust-lang/rust#156030
2. `rustc_hir::attrs::AttributeKind::NoStd` is now fieldless.
rust-lang/rust#156065
PiperOrigin-RevId: 910142545
copybara-serviceBot pushed a commit to google/crubit that referenced this pull request May 4, 2026
1. The `HashStable` trait was renamed to `StableHash`, and its method was also renamed to match.
rust-lang/rust#156030
2. `rustc_hir::attrs::AttributeKind::NoStd` is now fieldless.
rust-lang/rust#156065
PiperOrigin-RevId: 910142545
copybara-serviceBot pushed a commit to google/crubit that referenced this pull request May 4, 2026
1. The `HashStable` trait was renamed to `StableHash`, and its method was also renamed to match.
rust-lang/rust#156030
2. `rustc_hir::attrs::AttributeKind::NoStd` is now fieldless.
rust-lang/rust#156065
PiperOrigin-RevId: 910142545
copybara-serviceBot pushed a commit to google/crubit that referenced this pull request May 4, 2026
1. The `HashStable` trait was renamed to `StableHash`, and its method was also renamed to match.
rust-lang/rust#156030
2. `rustc_hir::attrs::AttributeKind::{NoStd, NoCore}` are now fieldless.
rust-lang/rust#156065
PiperOrigin-RevId: 910142545
copybara-serviceBot pushed a commit to google/crubit that referenced this pull request May 4, 2026
1. The `HashStable` trait was renamed to `StableHash`, and its method was also renamed to match.
rust-lang/rust#156030
2. `rustc_hir::attrs::AttributeKind::{NoStd, NoCore}` are now fieldless.
rust-lang/rust#156065
PiperOrigin-RevId: 910142545
copybara-serviceBot pushed a commit to google/crubit that referenced this pull request May 4, 2026
1. The `HashStable` trait was renamed to `StableHash`, and its method was also renamed to match.
rust-lang/rust#156030
2. `rustc_hir::attrs::AttributeKind::{NoStd, NoCore}` are now fieldless.
rust-lang/rust#156065
PiperOrigin-RevId: 910219736
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 13, 2026
Remove unused spans from AttributeKind
Recently I noticed some spans in diagnostic attributes were never used. I went through and checked the other variants too.
ghaaj pushed a commit to ghaaj/polygrammar that referenced this pull request Aug 7, 2026
…uwer
Rollup of 9 pull requests
Successful merges:
- rust-lang/rust#156030 (Make stable hashing names consistent (part 1))
- rust-lang/rust#156020 (Improve source code for `librustdoc/visit_ast.rs`)
- rust-lang/rust#156021 (Clean up some traits)
- rust-lang/rust#156028 (Add a `Local::arg(i)` helper constructor)
- rust-lang/rust#156037 (Add AcceptContext::expect_no_args)
- rust-lang/rust#156040 (Add missing alias to mailmap)
- rust-lang/rust#156048 (Make `diverging_type_vars` a vec of `TyVid`)
- rust-lang/rust#156053 (Reuse CTFE MIR for constructors.)
- rust-lang/rust#156059 (compiler: Print valid `-Zmir-enable-passes` names if invalid name is used)
Failed merges:
- rust-lang/rust#155940 (refactor rustc_on_unimplemented's filtering)
- rust-lang/rust#156065 (Remove unused spans from AttributeKind)
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 17, 2026
Rollup of 5 pull requests
Successful merges:
- rust-lang/rust#155666 (Interning cleanups)
- rust-lang/rust#155940 (refactor rustc_on_unimplemented's filtering)
- rust-lang/rust#156065 (Remove unused spans from AttributeKind)
- rust-lang/rust#156079 (Move and rename the `clone-never.rs` test)
- rust-lang/rust#156091 (change field `tools` on `AttributeParser` to hold `&'tcx RegisteredTools`)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)A-rustdoc-jsonArea: Rustdoc JSON backendS-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.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@mejrs@rustbot@JonathanBrouwer@rust-timer@oli-obk