Skip to content

Remove AttributeLintKind#155760

Merged
rust-bors[bot] merged 4 commits intorust-lang:mainfrom
GuillaumeGomez:rm-attributelintkind
Apr 27, 2026
Merged

Remove AttributeLintKind#155760
rust-bors[bot] merged 4 commits intorust-lang:mainfrom
GuillaumeGomez:rm-attributelintkind

Conversation

@GuillaumeGomez
Copy link
Copy Markdown
Member

@GuillaumeGomez GuillaumeGomez commented Apr 25, 2026

View all comments

Part of #153099.

The AttributeLintKind type is finally gone! \o/

Diff is this big because I moved a file and a lot of Diagnostic types. :')

r? @JonathanBrouwer

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 25, 2026

Some changes occurred to diagnostic attributes.

cc @mejrs

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot 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 Apr 25, 2026
@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov self-assigned this Apr 25, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

(Assigning myself for the suspicious infrastructural changes in the first commit.)

Comment thread compiler/rustc_interface/src/passes.rs Outdated
cx.emit_dyn_lint(
rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES,
move |dcx, level| {
move |dcx, level, _| {
Copy link
Copy Markdown
Contributor

@JonathanBrouwer JonathanBrouwer Apr 25, 2026

Choose a reason for hiding this comment

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

Also kinda sad that all the calls need to ignore the third argument now except the few cursed ones that need it.
Some alternatives are:

  • Create a separate function next to emit_dyn_lint that takes a closure with the special argument
  • My idea in the next comment, with making session the first argument

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think having a different function is likely better. For the session idea, answered in the other comment.

Comment thread compiler/rustc_hir/src/lints.rs
Comment thread compiler/rustc_lint/src/early/diagnostics.rs Outdated
@JonathanBrouwer JonathanBrouwer 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 Apr 25, 2026
sess: &Session,
inst: &impl Fn(EscapeQuotes) -> String,
) -> lints::UnexpectedCfgCargoHelp {
) -> errors::UnexpectedCfgCargoHelp {
Copy link
Copy Markdown
Member

@Urgau Urgau Apr 25, 2026

Choose a reason for hiding this comment

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

nit: I find it weird that the unexpected_cfgs diagnostic structs are in an errors module, while we are talking about a warn-by-default lint. I would expected only hard errors in an errors module, not warnings.

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is no clear pattern of where you put Diagnostic types. By default, it's mostly in crate::errors, even if it's lints.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One of the things on my todo list is do find a better name for these modules, perhaps diagnostics.rs

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.

I would second such MCP.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I would third (not sure if that's actually a thing) it.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 25, 2026

triagebot.toml has been modified, there may have been changes to the review queue.

cc @davidtwco, @wesleywiser

@rustbot rustbot added the A-meta Area: Issues & PRs about the rust-lang/rust repository itself label Apr 25, 2026
@GuillaumeGomez
Copy link
Copy Markdown
Member Author

Not ready yet. Just cleaning up a few things. Still need to update the check_cfg code to remove the need for TyCtxt.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Copy Markdown
Member Author

Let's check perf.

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 26, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 26, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 26, 2026

☀️ Try build successful (CI)
Build commit: 02eba22 (02eba2262f5cb08913936ee0e3af553985832120, parent: 68ffae46b581747074413e4242ab0c6ecc4db4a9)

@rust-timer

This comment has been minimized.

@petrochenkov
Copy link
Copy Markdown
Contributor

LGTM now, although it would be good to squash commits to avoid many back and forth changes.
@rustbot author

@rustbot rustbot 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 Apr 27, 2026
@petrochenkov petrochenkov removed their assignment Apr 27, 2026
Create a new `SharedContext::emit_dyn_lint_with_sess` method to simplify code when `Session` is not needed
Remove crate name from `UnexpectedCfgCargoMacroHelp`
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors r=JonathanBrouwer,petrochenkov rollup=iffy

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 27, 2026

📌 Commit faecc47 has been approved by JonathanBrouwer,petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Apr 27, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 27, 2026
…d, r=JonathanBrouwer,petrochenkov

Remove `AttributeLintKind`

Part of rust-lang#153099.

The `AttributeLintKind` type is finally gone! \o/

Diff is this big because I moved a file and a lot of `Diagnostic` types. :')

r? @JonathanBrouwer
rust-bors Bot pushed a commit that referenced this pull request Apr 27, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #155760 (Remove `AttributeLintKind`)
 - #154510 (Partially stabilize LoongArch target features)
 - #155137 (Allow trailing `self` in more contexts)
 - #155433 (Rip out rustc_layout_scalar_valid_range_* attribute support)
 - #155702 (Change `ItemKind::Trait` to a field variant.)
 - #154896 (Fix ICE: Scalar layout for non-primitive non-enum type unsafe binder)
 - #155675 (Disallow non_exhaustive structs and enums with non_exhaustive variants from implementing `ConstParamTy`)
 - #155874 (Avoid misleading closure return type note)
 - #155876 (CI: rfl: move job forward to Linux v7.1-rc1)
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 27, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 27, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer,petrochenkov
Duration: 3h 56m 48s
Pushing 52b6e2c to main...

@rust-bors rust-bors Bot merged commit 52b6e2c into rust-lang:main Apr 27, 2026
12 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 27, 2026
@GuillaumeGomez GuillaumeGomez deleted the rm-attributelintkind branch April 27, 2026 21:47
@github-actions
Copy link
Copy Markdown
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 345a975 (parent) -> 52b6e2c (this PR)

Test differences

Show 6 test diffs

6 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 52b6e2c208b73276ccb36ec0b68456913a801c96 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-apple-various: 2h 35m -> 1h 31m (-41.0%)
  2. x86_64-msvc-1: 2h 1m -> 2h 45m (+35.6%)
  3. test-various: 1h 43m -> 2h 11m (+26.2%)
  4. armhf-gnu: 1h 16m -> 1h 34m (+23.9%)
  5. dist-i586-gnu-i586-i686-musl: 1h 33m -> 1h 11m (-23.5%)
  6. x86_64-gnu: 1h 51m -> 2h 15m (+21.9%)
  7. x86_64-rust-for-linux: 51m 54s -> 40m 34s (-21.8%)
  8. dist-powerpc-linux: 1h 13m -> 1h 27m (+18.4%)
  9. dist-powerpc64le-linux-gnu: 1h 35m -> 1h 18m (-17.8%)
  10. dist-powerpc64-linux-gnu: 1h 16m -> 1h 29m (+17.2%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (52b6e2c): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -3.7%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.9% [0.9%, 0.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.1% [-6.5%, -1.6%] 13
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 489.767s -> 487.959s (-0.37%)
Artifact size: 393.39 MiB -> 393.44 MiB (0.01%)

@GuillaumeGomez
Copy link
Copy Markdown
Member Author

Regression is ucd, seems like noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself merged-by-bors This PR was explicitly merged by bors. 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.

7 participants