Skip to content

Introduce -Z lint-rust-version#157707

Open
clubby789 wants to merge 3 commits into
rust-lang:mainfrom
clubby789:lint-rust-version
Open

Introduce -Z lint-rust-version#157707
clubby789 wants to merge 3 commits into
rust-lang:mainfrom
clubby789:lint-rust-version

Conversation

@clubby789

@clubby789 clubby789 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Implements rust-lang/compiler-team#950 by adding the unstable flag and updating the lint machinery to accept an MSRV.

Copies most of the approach from #149870

Tracking issue: #157574

@clubby789 clubby789 added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 10, 2026
@rustbot

rustbot commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

rustc_macros::diagnostics was changed

cc @TaKO8Ki, @JonathanBrouwer

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 10, 2026
@rustbot

rustbot commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

r? @JonathanBrouwer

rustbot has assigned @JonathanBrouwer.
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 18 candidates

// omit self.sort_span
&self.is_lint,
// omit self.emitted_at
// omit self.rust_version

@JonathanBrouwer JonathanBrouwer Jun 14, 2026

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.

This would mean that two diagnostics which are identical other than rust_version are considered equal for incremental, which I don't think is correct

View changes since the review

/// we print where in rustc this error was emitted.
pub emitted_at: DiagLocation,
/// Used to avoid lints which would affect MSRV
pub rust_version: Option<RustcVersion>,

@JonathanBrouwer JonathanBrouwer Jun 14, 2026

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.

Hmmm I'm not a big fan of this being part of the DiagInner struct, to me it makes more sense to be declared on a rustc_lint_defs::Lint. Could you motivate why this needs to be here?

View changes since the review

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 14, 2026
@rustbot

rustbot commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-diagnostics Area: Messages for errors, warnings, and lints A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants