Skip to content

Commit e16d7c0

Browse files
authored
Unrolled build for rust-lang#121049
Rollup merge of rust-lang#121049 - estebank:issue-121009, r=fmease Do not point at `#[allow(_)]` as the reason for compat lint triggering Fix rust-lang#121009.
2 parents 81b757c + 24b52fd commit e16d7c0

File tree

8 files changed

+6
-53
lines changed

8 files changed

+6
-53
lines changed

compiler/rustc_middle/src/lint.rs

+5
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ pub fn explain_lint_level_source(
207207
err: &mut Diagnostic,
208208
) {
209209
let name = lint.name_lower();
210+
if let Level::Allow = level {
211+
// Do not point at `#[allow(compat_lint)]` as the reason for a compatibility lint
212+
// triggering. (#121009)
213+
return;
214+
}
210215
match src {
211216
LintLevelSource::Default => {
212217
err.note_once(format!("`#[{}({})]` on by default", level.as_str(), name));

tests/ui/consts/issue-89088.stderr

-5
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,4 @@ LL | FOO => todo!(),
99
= note: for more information, see issue #120362 <https://github.com/rust-lang/rust/issues/120362>
1010
= note: the traits must be derived, manual `impl`s are not sufficient
1111
= note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details
12-
note: the lint level is defined here
13-
--> $DIR/issue-89088.rs:5:10
14-
|
15-
LL | #![allow(indirect_structural_match)]
16-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
1712

Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
{"$message_type":"future_incompat","future_incompat_report":[{"diagnostic":{"$message_type":"diagnostic","message":"unused variable: `x`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"$DIR/future-incompat-json-test.rs","byte_start":338,"byte_end":339,"line_start":9,"line_end":9,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" let x = 1;","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`-A unused-variables` implied by `-A unused`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"to override `-A unused` add `#[allow(unused_variables)]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"$DIR/future-incompat-json-test.rs","byte_start":338,"byte_end":339,"line_start":9,"line_end":9,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" let x = 1;","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":"_x","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"warning: unused variable: `x`
1+
{"$message_type":"future_incompat","future_incompat_report":[{"diagnostic":{"$message_type":"diagnostic","message":"unused variable: `x`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"$DIR/future-incompat-json-test.rs","byte_start":338,"byte_end":339,"line_start":9,"line_end":9,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" let x = 1;","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"$DIR/future-incompat-json-test.rs","byte_start":338,"byte_end":339,"line_start":9,"line_end":9,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" let x = 1;","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":"_x","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"warning: unused variable: `x`
22
--> $DIR/future-incompat-json-test.rs:9:9
33
|
44
LL | let x = 1;
55
| ^ help: if this is intentional, prefix it with an underscore: `_x`
6-
|
7-
= note: `-A unused-variables` implied by `-A unused`
8-
= help: to override `-A unused` add `#[allow(unused_variables)]`
96

107
"}}]}

tests/ui/lint/future-incompat-test.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@ warning: unused variable: `x`
44
|
55
LL | let x = 1;
66
| ^ help: if this is intentional, prefix it with an underscore: `_x`
7-
|
8-
= note: `-A unused-variables` implied by `-A unused`
9-
= help: to override `-A unused` add `#[allow(unused_variables)]`
107

tests/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.stderr

-20
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ LL | foo!(first)
6060
= note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
6161
= note: macro invocations at the end of a block are treated as expressions
6262
= note: to ignore the value produced by the macro, add a semicolon after the invocation of `foo`
63-
note: the lint level is defined here
64-
--> $DIR/semicolon-in-expressions-from-macros.rs:24:13
65-
|
66-
LL | #[allow(semicolon_in_expressions_from_macros)]
67-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6863
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
6964

7065
Future breakage diagnostic:
@@ -79,11 +74,6 @@ LL | let _ = foo!(second);
7974
|
8075
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8176
= note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
82-
note: the lint level is defined here
83-
--> $DIR/semicolon-in-expressions-from-macros.rs:29:13
84-
|
85-
LL | #[allow(semicolon_in_expressions_from_macros)]
86-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8777
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
8878

8979
Future breakage diagnostic:
@@ -98,11 +88,6 @@ LL | let _ = foo!(third);
9888
|
9989
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
10090
= note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
101-
note: the lint level is defined here
102-
--> $DIR/semicolon-in-expressions-from-macros.rs:32:13
103-
|
104-
LL | #[allow(semicolon_in_expressions_from_macros)]
105-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10691
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
10792

10893
Future breakage diagnostic:
@@ -117,11 +102,6 @@ LL | let _ = foo!(fourth);
117102
|
118103
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
119104
= note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
120-
note: the lint level is defined here
121-
--> $DIR/semicolon-in-expressions-from-macros.rs:37:13
122-
|
123-
LL | #[allow(semicolon_in_expressions_from_macros)]
124-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125105
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
126106

127107
Future breakage diagnostic:

tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr

-6
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,4 @@ LL | if let CONSTANT = &&MyType {
2020
= note: for more information, see issue #120362 <https://github.com/rust-lang/rust/issues/120362>
2121
= note: the traits must be derived, manual `impl`s are not sufficient
2222
= note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details
23-
note: the lint level is defined here
24-
--> $DIR/const-partial_eq-fallback-ice.rs:1:10
25-
|
26-
LL | #![allow(warnings)]
27-
| ^^^^^^^^
28-
= note: `#[allow(indirect_structural_match)]` implied by `#[allow(warnings)]`
2923

tests/ui/proc-macro/generate-mod.stderr

-10
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@ LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
139139
|
140140
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
141141
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
142-
note: the lint level is defined here
143-
--> $DIR/generate-mod.rs:30:10
144-
|
145-
LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
146-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147142
= note: this warning originates in the derive macro `generate_mod::CheckDeriveLint` (in Nightly builds, run with -Z macro-backtrace for more info)
148143

149144
Future breakage diagnostic:
@@ -155,10 +150,5 @@ LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
155150
|
156151
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
157152
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
158-
note: the lint level is defined here
159-
--> $DIR/generate-mod.rs:30:10
160-
|
161-
LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
162-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
163153
= note: this warning originates in the derive macro `generate_mod::CheckDeriveLint` (in Nightly builds, run with -Z macro-backtrace for more info)
164154

tests/ui/traits/issue-33140-hack-boundaries.stderr

-5
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,4 @@ LL | impl Trait0 for dyn Send {}
7777
|
7878
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
7979
= note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
80-
note: the lint level is defined here
81-
--> $DIR/issue-33140-hack-boundaries.rs:2:10
82-
|
83-
LL | #![allow(order_dependent_trait_objects)]
84-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8580

0 commit comments

Comments
 (0)