Skip to content

Point at lint name instead of whole attr for gated lints #134481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {

let src = LintLevelSource::Node { name, span: sp, reason };
for &id in ids {
if self.check_gated_lint(id, attr.span(), false) {
if self.check_gated_lint(id, sp, false) {
self.insert_spec(id, (level, src));
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: unknown lint: `rustdoc::missing_doc_code_examples`
--> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:4:1
--> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:4:10
|
LL | #![allow(rustdoc::missing_doc_code_examples)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `rustdoc::missing_doc_code_examples` lint is unstable
= note: see issue #101730 <https://github.com/rust-lang/rust/issues/101730> for more information
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
warning: unknown lint: `multiple_supertrait_upcastable`
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:3:1
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:3:9
|
LL | #![deny(multiple_supertrait_upcastable)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `multiple_supertrait_upcastable` lint is unstable
= help: add `#![feature(multiple_supertrait_upcastable)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
= note: `#[warn(unknown_lints)]` on by default

warning: unknown lint: `multiple_supertrait_upcastable`
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:5:1
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:5:9
|
LL | #![warn(multiple_supertrait_upcastable)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `multiple_supertrait_upcastable` lint is unstable
= help: add `#![feature(multiple_supertrait_upcastable)]` to the crate attributes to enable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
warning: unknown lint: `non_exhaustive_omitted_patterns`
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:3:1
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:3:9
|
LL | #![deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `non_exhaustive_omitted_patterns` lint is unstable
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
Expand All @@ -11,32 +11,32 @@ LL | #![deny(non_exhaustive_omitted_patterns)]
= note: `#[warn(unknown_lints)]` on by default

warning: unknown lint: `non_exhaustive_omitted_patterns`
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:5:1
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:5:10
|
LL | #![allow(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `non_exhaustive_omitted_patterns` lint is unstable
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

warning: unknown lint: `non_exhaustive_omitted_patterns`
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:15:5
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:15:13
|
LL | #[allow(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `non_exhaustive_omitted_patterns` lint is unstable
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

warning: unknown lint: `non_exhaustive_omitted_patterns`
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:15:5
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:15:13
|
LL | #[allow(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `non_exhaustive_omitted_patterns` lint is unstable
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
Expand All @@ -45,21 +45,21 @@ LL | #[allow(non_exhaustive_omitted_patterns)]
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

warning: unknown lint: `non_exhaustive_omitted_patterns`
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:24:5
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:24:12
|
LL | #[warn(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `non_exhaustive_omitted_patterns` lint is unstable
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

warning: unknown lint: `non_exhaustive_omitted_patterns`
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:24:5
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:24:12
|
LL | #[warn(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `non_exhaustive_omitted_patterns` lint is unstable
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
warning: unknown lint: `fuzzy_provenance_casts`
--> $DIR/feature-gate-strict_provenance_lints.rs:3:1
--> $DIR/feature-gate-strict_provenance_lints.rs:3:9
|
LL | #![deny(fuzzy_provenance_casts)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `fuzzy_provenance_casts` lint is unstable
= note: see issue #130351 <https://github.com/rust-lang/rust/issues/130351> for more information
Expand All @@ -11,10 +11,10 @@ LL | #![deny(fuzzy_provenance_casts)]
= note: `#[warn(unknown_lints)]` on by default

warning: unknown lint: `lossy_provenance_casts`
--> $DIR/feature-gate-strict_provenance_lints.rs:5:1
--> $DIR/feature-gate-strict_provenance_lints.rs:5:9
|
LL | #![deny(lossy_provenance_casts)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `lossy_provenance_casts` lint is unstable
= note: see issue #130351 <https://github.com/rust-lang/rust/issues/130351> for more information
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/feature-gates/feature-gate-test_unstable_lint.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
warning: unknown lint: `test_unstable_lint`
--> $DIR/feature-gate-test_unstable_lint.rs:4:1
--> $DIR/feature-gate-test_unstable_lint.rs:4:10
|
LL | #![allow(test_unstable_lint)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^
|
= note: the `test_unstable_lint` lint is unstable
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
warning: unknown lint: `unqualified_local_imports`
--> $DIR/feature-gate-unqualified-local-imports.rs:3:1
--> $DIR/feature-gate-unqualified-local-imports.rs:3:10
|
LL | #![allow(unqualified_local_imports)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `unqualified_local_imports` lint is unstable
= help: add `#![feature(unqualified_local_imports)]` to the crate attributes to enable
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/lint/must_not_suspend/gated.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
warning: unknown lint: `must_not_suspend`
--> $DIR/gated.rs:4:1
--> $DIR/gated.rs:4:9
|
LL | #![deny(must_not_suspend)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^
|
= note: the `must_not_suspend` lint is unstable
= note: see issue #83310 <https://github.com/rust-lang/rust/issues/83310> for more information
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: unknown lint: `test_unstable_lint`
--> $DIR/deny-unstable-lint-inline.rs:4:1
--> $DIR/deny-unstable-lint-inline.rs:4:10
|
LL | #![allow(test_unstable_lint)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^
|
= note: the `test_unstable_lint` lint is unstable
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
warning: unknown lint: `test_unstable_lint`
--> $DIR/warn-unknown-unstable-lint-inline.rs:4:1
--> $DIR/warn-unknown-unstable-lint-inline.rs:4:10
|
LL | #![allow(test_unstable_lint)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^
|
= note: the `test_unstable_lint` lint is unstable
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
Expand Down
Loading