Skip to content

Commit 0895304

Browse files
authored
Unrolled build for rust-lang#134481
Rollup merge of rust-lang#134481 - estebank:unstable-lint-span, r=compiler-errors Point at lint name instead of whole attr for gated lints ``` warning: unknown lint: `test_unstable_lint` --> $DIR/warn-unknown-unstable-lint-inline.rs:4:10 | LL | #![allow(test_unstable_lint, another_unstable_lint)] | ^^^^^^^^^^^^^^^^^^ | = note: the `test_unstable_lint` lint is unstable = help: add `#![feature(test_unstable_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 note: the lint level is defined here --> $DIR/warn-unknown-unstable-lint-inline.rs:3:9 | LL | #![warn(unknown_lints)] | ^^^^^^^^^^^^^ warning: unknown lint: `test_unstable_lint` --> $DIR/warn-unknown-unstable-lint-inline.rs:4:29 | LL | #![allow(test_unstable_lint, another_unstable_lint)] | ^^^^^^^^^^^^^^^^^^^^^ | = note: the `another_unstable_lint` lint is unstable = help: add `#![feature(another_unstable_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 ``` This is particularly relevant when there are multiple lints in the same `warn` attribute. Pointing at the smaller span makes it clearer which one the warning is complaining about.
2 parents 023521e + 19e44f4 commit 0895304

10 files changed

+33
-33
lines changed

Diff for: compiler/rustc_lint/src/levels.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
914914

915915
let src = LintLevelSource::Node { name, span: sp, reason };
916916
for &id in ids {
917-
if self.check_gated_lint(id, attr.span(), false) {
917+
if self.check_gated_lint(id, sp, false) {
918918
self.insert_spec(id, (level, src));
919919
}
920920
}

Diff for: tests/rustdoc-ui/lints/feature-gate-rustdoc_missing_doc_code_examples.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: unknown lint: `rustdoc::missing_doc_code_examples`
2-
--> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:4:1
2+
--> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:4:10
33
|
44
LL | #![allow(rustdoc::missing_doc_code_examples)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: the `rustdoc::missing_doc_code_examples` lint is unstable
88
= note: see issue #101730 <https://github.com/rust-lang/rust/issues/101730> for more information

Diff for: tests/ui/feature-gates/feature-gate-multiple_supertrait_upcastable.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
warning: unknown lint: `multiple_supertrait_upcastable`
2-
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:3:1
2+
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:3:9
33
|
44
LL | #![deny(multiple_supertrait_upcastable)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: the `multiple_supertrait_upcastable` lint is unstable
88
= help: add `#![feature(multiple_supertrait_upcastable)]` to the crate attributes to enable
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010
= note: `#[warn(unknown_lints)]` on by default
1111

1212
warning: unknown lint: `multiple_supertrait_upcastable`
13-
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:5:1
13+
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:5:9
1414
|
1515
LL | #![warn(multiple_supertrait_upcastable)]
16-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1717
|
1818
= note: the `multiple_supertrait_upcastable` lint is unstable
1919
= help: add `#![feature(multiple_supertrait_upcastable)]` to the crate attributes to enable

Diff for: tests/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
warning: unknown lint: `non_exhaustive_omitted_patterns`
2-
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:3:1
2+
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:3:9
33
|
44
LL | #![deny(non_exhaustive_omitted_patterns)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: the `non_exhaustive_omitted_patterns` lint is unstable
88
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
@@ -11,32 +11,32 @@ LL | #![deny(non_exhaustive_omitted_patterns)]
1111
= note: `#[warn(unknown_lints)]` on by default
1212

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

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

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

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

5858
warning: unknown lint: `non_exhaustive_omitted_patterns`
59-
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:24:5
59+
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:24:12
6060
|
6161
LL | #[warn(non_exhaustive_omitted_patterns)]
62-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6363
|
6464
= note: the `non_exhaustive_omitted_patterns` lint is unstable
6565
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information

Diff for: tests/ui/feature-gates/feature-gate-strict_provenance_lints.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
warning: unknown lint: `fuzzy_provenance_casts`
2-
--> $DIR/feature-gate-strict_provenance_lints.rs:3:1
2+
--> $DIR/feature-gate-strict_provenance_lints.rs:3:9
33
|
44
LL | #![deny(fuzzy_provenance_casts)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: the `fuzzy_provenance_casts` lint is unstable
88
= note: see issue #130351 <https://github.com/rust-lang/rust/issues/130351> for more information
@@ -11,10 +11,10 @@ LL | #![deny(fuzzy_provenance_casts)]
1111
= note: `#[warn(unknown_lints)]` on by default
1212

1313
warning: unknown lint: `lossy_provenance_casts`
14-
--> $DIR/feature-gate-strict_provenance_lints.rs:5:1
14+
--> $DIR/feature-gate-strict_provenance_lints.rs:5:9
1515
|
1616
LL | #![deny(lossy_provenance_casts)]
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17+
| ^^^^^^^^^^^^^^^^^^^^^^
1818
|
1919
= note: the `lossy_provenance_casts` lint is unstable
2020
= note: see issue #130351 <https://github.com/rust-lang/rust/issues/130351> for more information

Diff for: tests/ui/feature-gates/feature-gate-test_unstable_lint.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
warning: unknown lint: `test_unstable_lint`
2-
--> $DIR/feature-gate-test_unstable_lint.rs:4:1
2+
--> $DIR/feature-gate-test_unstable_lint.rs:4:10
33
|
44
LL | #![allow(test_unstable_lint)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^
66
|
77
= note: the `test_unstable_lint` lint is unstable
88
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable

Diff for: tests/ui/feature-gates/feature-gate-unqualified-local-imports.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
warning: unknown lint: `unqualified_local_imports`
2-
--> $DIR/feature-gate-unqualified-local-imports.rs:3:1
2+
--> $DIR/feature-gate-unqualified-local-imports.rs:3:10
33
|
44
LL | #![allow(unqualified_local_imports)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: the `unqualified_local_imports` lint is unstable
88
= help: add `#![feature(unqualified_local_imports)]` to the crate attributes to enable

Diff for: tests/ui/lint/must_not_suspend/gated.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
warning: unknown lint: `must_not_suspend`
2-
--> $DIR/gated.rs:4:1
2+
--> $DIR/gated.rs:4:9
33
|
44
LL | #![deny(must_not_suspend)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^
66
|
77
= note: the `must_not_suspend` lint is unstable
88
= note: see issue #83310 <https://github.com/rust-lang/rust/issues/83310> for more information

Diff for: tests/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: unknown lint: `test_unstable_lint`
2-
--> $DIR/deny-unstable-lint-inline.rs:4:1
2+
--> $DIR/deny-unstable-lint-inline.rs:4:10
33
|
44
LL | #![allow(test_unstable_lint)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^
66
|
77
= note: the `test_unstable_lint` lint is unstable
88
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable

Diff for: tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
warning: unknown lint: `test_unstable_lint`
2-
--> $DIR/warn-unknown-unstable-lint-inline.rs:4:1
2+
--> $DIR/warn-unknown-unstable-lint-inline.rs:4:10
33
|
44
LL | #![allow(test_unstable_lint)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^
66
|
77
= note: the `test_unstable_lint` lint is unstable
88
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable

0 commit comments

Comments
 (0)