Skip to content

destringlyfy lint infrastructure - #164607

Merged
rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
mejrs:lint_name
Nov 1, 2026
Merged

rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
mejrs:lint_name

Conversation

@mejrs

@mejrs mejrs commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

View all comments

Currently, lints are passed as strings and parsed/split/reformatted/compared/etc in many many places. It's not always clear whether that string includes the tool or not.

Instead, they are passed around as:

pub struct LintName {
    pub tool: Option<Symbol>,
    pub name: Symbol,
}

r? @JonathanBrouwer

@rustbot

rustbot commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

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

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in compiler/rustc_attr_ir

cc @jdonszelmann, @JonathanBrouwer

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 Oct 19, 2026
@rustbot

rustbot commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

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

@mejrs

mejrs commented Oct 19, 2026 •

Copy link
Copy Markdown
Member Author

haven't updated clippy yet. But I think I can do a perf run.

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 19, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 19, 2026
destringlyfy lint infrastructure
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 3dcd667 (3dcd66770271913d28347dd2820933e94b0f53a4)
Base parent: 07ea2af (07ea2af746e09a0e9e3ac9b39ee866bd9bf702a2)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (3dcd667): comparison URL.

Overall result: ❌✅ regressions and improvements - BENCHMARK(S) FAILED

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

❗ ❗ ❗ ❗ ❗
Warning ⚠️: The following benchmark(s) failed to build:

  • libc-0.2.172
  • Job failure

❗ ❗ ❗ ❗ ❗

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.3% [0.2%, 0.5%] 5
Improvements ✅
(primary)
-0.4% [-1.3%, -0.1%] 45
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 2
All ❌✅ (primary) -0.4% [-1.3%, -0.1%] 45

Max RSS (memory usage)

Results (primary -1.0%, secondary -1.0%)

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)
4.1% [0.5%, 9.5%] 7
Improvements ✅
(primary)
-1.0% [-1.0%, -1.0%] 1
Improvements ✅
(secondary)
-5.5% [-8.3%, -3.2%] 8
All ❌✅ (primary) -1.0% [-1.0%, -1.0%] 1

Cycles

Results (primary 2.2%, secondary 0.6%)

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

mean range count
Regressions ❌
(primary)
2.2% [2.2%, 2.2%] 1
Regressions ❌
(secondary)
3.1% [0.5%, 12.1%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-4.2%, -0.6%] 6
All ❌✅ (primary) 2.2% [2.2%, 2.2%] 1

Binary size

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

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
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 1
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 1

Bootstrap: 489.513s -> 489.49s (-0.00%)
Artifact size: 409.13 MiB -> 409.09 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 19, 2026
@Kivooeo

Kivooeo commented Oct 20, 2026

Copy link
Copy Markdown
Member

huh, any ideas why this might happenened in libc?

   thread 'rustc' (1970916) panicked at /rustc-dev/3dcd66770271913d28347dd2820933e94b0f53a4/compiler/rustc_lint/src/levels.rs:839:25:
    renamed lint does not exist: rustdoc::bare_urls

@mejrs

mejrs commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

huh, any ideas why this might happenened in libc?

   thread 'rustc' (1970916) panicked at /rustc-dev/3dcd66770271913d28347dd2820933e94b0f53a4/compiler/rustc_lint/src/levels.rs:839:25:
    renamed lint does not exist: rustdoc::bare_urls

it's one of the cases where a function takes (lint, tool) but in this case it's passed (rustdoc::bare_urls, None). i just didnt catch this one, it happened for clippy lints too.

@rust-log-analyzer

This comment has been minimized.

@rustbot

rustbot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Oct 20, 2026

@ada4a ada4a left a comment •

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.

Please apologize the drive-by review. The idea seems very sensible, just some minor questions 👀

View changes since this review

Comment thread compiler/rustc_attr_ir/src/lint.rs Resolved
Comment thread compiler/rustc_attr_ir/src/lint.rs Resolved
@rust-log-analyzer

This comment has been minimized.

@mejrs

mejrs commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Please apologize the drive-by review. The idea seems very sensible, just some minor questions 👀

No need to apologize, all reviews are welcome :)

To answer your question w/r to spans: it would make comparing different LintNames complicated, because lint names with equal values but different spans will compare unequal.

And Span: !Ord, so this would require manual Ord impls, and I'd rather not go there...

@mejrs

mejrs commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Also, possible followups:

  • clippy has it's own LintName, it could use this one instead
  • store all the builtin lints as symbols rather than string literals. just pre-interning them may also matter for perf.

@mejrs

mejrs commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rustbot

rustbot commented Oct 26, 2026

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.

@mejrs

mejrs commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 26, 2026

@JonathanBrouwer JonathanBrouwer 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-bors Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 361557a has been approved by JonathanBrouwer

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 Oct 29, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors rollup=iffy
Making a rollup of perf sensitive prs

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 30, 2026
destringlyfy lint infrastructure

Currently, lints are passed as strings and parsed/split/reformatted/compared/etc in many many places. It's not always clear whether that string includes the tool or not.

Instead, they are passed around as:
```rust
pub struct LintName {
    pub tool: Option<Symbol>,
    pub name: Symbol,
}
```

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

Rollup of 7 perf-sensitive pull requests

Successful merges:

 - #163339 (MIR move elimination [5/6]: Storage reconstruction)
 - #163525 (Move lang item collection to the resolver)
 - #163928 (do not prefer trivially true candidates with `-Znext-solver` )
 - #164341 (Expand an early return case in `coerce_unsized`)
 - #164484 (Use adaptive sparse encoding for metadata tables)
 - #164607 (destringlyfy lint infrastructure)
 - #165160 (New solver opts for diesel (part 3))

> [!WARNING]
> This rollup conflicts with pending auto build #165178 and may need to be recreated if the pending build succeeds.
rust-bors Bot pushed a commit that referenced this pull request Oct 31, 2026
…uwer

Rollup of 7 perf-sensitive pull requests

Successful merges:

 - #163339 (MIR move elimination [5/6]: Storage reconstruction)
 - #163525 (Move lang item collection to the resolver)
 - #163928 (do not prefer trivially true candidates with `-Znext-solver` )
 - #164341 (Expand an early return case in `coerce_unsized`)
 - #164484 (Use adaptive sparse encoding for metadata tables)
 - #164607 (destringlyfy lint infrastructure)
 - #165160 (New solver opts for diesel (part 3))

> [!WARNING]
> This rollup conflicts with pending auto build #165178 and may need to be recreated if the pending build succeeds.
rust-bors Bot pushed a commit that referenced this pull request Oct 31, 2026
…uwer

Rollup of 7 perf-sensitive pull requests

Successful merges:

 - #163339 (MIR move elimination [5/6]: Storage reconstruction)
 - #163525 (Move lang item collection to the resolver)
 - #163928 (do not prefer trivially true candidates with `-Znext-solver` )
 - #164341 (Expand an early return case in `coerce_unsized`)
 - #164484 (Use adaptive sparse encoding for metadata tables)
 - #164607 (destringlyfy lint infrastructure)
 - #165160 (New solver opts for diesel (part 3))

> [!WARNING]
> This rollup conflicts with pending auto build #165178 and may need to be recreated if the pending build succeeds.
rust-bors Bot pushed a commit that referenced this pull request Oct 31, 2026
…uwer

Rollup of 7 perf-sensitive pull requests

Successful merges:

 - #163339 (MIR move elimination [5/6]: Storage reconstruction)
 - #163359 (MIR move elimination [1.5/6]: Ensure ZSTs are always initialized)
 - #163525 (Move lang item collection to the resolver)
 - #163928 (do not prefer trivially true candidates with `-Znext-solver` )
 - #164341 (Expand an early return case in `coerce_unsized`)
 - #164484 (Use adaptive sparse encoding for metadata tables)
 - #164607 (destringlyfy lint infrastructure)
@rust-bors
rust-bors Bot merged commit 64a8aa5 into rust-lang:main Nov 1, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Nov 1, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 1, 2026
Rollup merge of #164607 - mejrs:lint_name, r=JonathanBrouwer

destringlyfy lint infrastructure

Currently, lints are passed as strings and parsed/split/reformatted/compared/etc in many many places. It's not always clear whether that string includes the tool or not.

Instead, they are passed around as:
```rust
pub struct LintName {
    pub tool: Option<Symbol>,
    pub name: Symbol,
}
```

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. 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