Skip to content

Commit c345980

Browse files
committed
Address PR feedback
1 parent a66fe66 commit c345980

File tree

89 files changed

+307
-315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+307
-315
lines changed

compiler/rustc_lint/src/array_into_iter.rs

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ declare_lint! {
3939
@future_incompatible = FutureIncompatibleInfo {
4040
reference: "issue #66145 <https://github.com/rust-lang/rust/issues/66145>",
4141
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2021),
42-
custom_explanation: Some("This will continue to compile in Rust 2021 but it will behave slightly differently!")
4342
};
4443
}
4544

compiler/rustc_lint_defs/src/lib.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,14 @@ pub struct FutureIncompatibleInfo {
149149
/// be emitted in JSON messages to be displayed by Cargo
150150
/// for upstream deps
151151
pub future_breakage: Option<FutureBreakage>,
152-
/// Provide a custom explanation message for diagnostics
153-
/// if the default explanation message is not appropriate
154-
pub custom_explanation: Option<&'static str>,
155152
}
156153

157154
/// The reason for future incompatibility
158155
#[derive(Copy, Clone, Debug)]
159156
pub enum FutureIncompatibilityReason {
160-
/// We're fixing a bug which will impact all editions
161-
BugFix,
157+
/// This will be an error in a future release
158+
/// for all editions
159+
FutureReleaseError,
162160
/// Previously accepted code that will become an
163161
/// error in the provided edition
164162
EditionError(Edition),
@@ -186,9 +184,8 @@ impl FutureIncompatibleInfo {
186184
pub const fn default_fields_for_macro() -> Self {
187185
FutureIncompatibleInfo {
188186
reference: "",
189-
reason: FutureIncompatibilityReason::BugFix,
187+
reason: FutureIncompatibilityReason::FutureReleaseError,
190188
future_breakage: None,
191-
custom_explanation: None,
192189
}
193190
}
194191
}

compiler/rustc_middle/src/lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ pub fn struct_lint_level<'s, 'd>(
386386
{
387387
let current_edition = sess.edition();
388388
format!(
389-
"this is valid in the current edition (Rust {}) but is not accepted in the Rust {} edition!",
389+
"this is accepted in the current edition (Rust {}) but is a hard error in Rust {}!",
390390
current_edition, edition
391391
)
392392
} else if let FutureIncompatibilityReason::EditionSemanticsChange(edition) =

src/test/ui/anon-params/anon-params-deprecated.fixed

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
trait T {
99
fn foo(_: i32); //~ WARNING anonymous parameters are deprecated
10-
//~| WARNING this is valid in the current edition
10+
//~| WARNING this is accepted in the current edition
1111

1212
fn bar_with_default_impl(_: String, _: String) {}
1313
//~^ WARNING anonymous parameters are deprecated
14-
//~| WARNING this is valid in the current edition
14+
//~| WARNING this is accepted in the current edition
1515
//~| WARNING anonymous parameters are deprecated
16-
//~| WARNING this is valid in the current edition
16+
//~| WARNING this is accepted in the current edition
1717
}
1818

1919
fn main() {}

src/test/ui/anon-params/anon-params-deprecated.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
trait T {
99
fn foo(i32); //~ WARNING anonymous parameters are deprecated
10-
//~| WARNING this is valid in the current edition
10+
//~| WARNING this is accepted in the current edition
1111

1212
fn bar_with_default_impl(String, String) {}
1313
//~^ WARNING anonymous parameters are deprecated
14-
//~| WARNING this is valid in the current edition
14+
//~| WARNING this is accepted in the current edition
1515
//~| WARNING anonymous parameters are deprecated
16-
//~| WARNING this is valid in the current edition
16+
//~| WARNING this is accepted in the current edition
1717
}
1818

1919
fn main() {}

src/test/ui/anon-params/anon-params-deprecated.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: the lint level is defined here
99
|
1010
LL | #![warn(anonymous_parameters)]
1111
| ^^^^^^^^^^^^^^^^^^^^
12-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
12+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
1313
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
1414

1515
warning: anonymous parameters are deprecated and will be removed in the next edition.
@@ -18,7 +18,7 @@ warning: anonymous parameters are deprecated and will be removed in the next edi
1818
LL | fn bar_with_default_impl(String, String) {}
1919
| ^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: String`
2020
|
21-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
21+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
2222
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
2323

2424
warning: anonymous parameters are deprecated and will be removed in the next edition.
@@ -27,7 +27,7 @@ warning: anonymous parameters are deprecated and will be removed in the next edi
2727
LL | fn bar_with_default_impl(String, String) {}
2828
| ^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: String`
2929
|
30-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
30+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
3131
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
3232

3333
warning: 3 warnings emitted

src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@
33

44
mod outer_mod {
55
pub mod await { //~ ERROR `await` is a keyword in the 2018 edition
6-
//~^ WARN this is valid in the current edition
6+
//~^ WARN this is accepted in the current edition
77
pub struct await; //~ ERROR `await` is a keyword in the 2018 edition
8-
//~^ WARN this is valid in the current edition
8+
//~^ WARN this is accepted in the current edition
99
}
1010
}
1111
use outer_mod::await::await; //~ ERROR `await` is a keyword in the 2018 edition
1212
//~^ ERROR `await` is a keyword in the 2018 edition
13-
//~^^ WARN this is valid in the current edition
14-
//~^^^ WARN this is valid in the current edition
13+
//~^^ WARN this is accepted in the current edition
14+
//~^^^ WARN this is accepted in the current edition
1515

1616
struct Foo { await: () }
1717
//~^ ERROR `await` is a keyword in the 2018 edition
18-
//~^^ WARN this is valid in the current edition
18+
//~^^ WARN this is accepted in the current edition
1919

2020
impl Foo { fn await() {} }
2121
//~^ ERROR `await` is a keyword in the 2018 edition
22-
//~^^ WARN this is valid in the current edition
22+
//~^^ WARN this is accepted in the current edition
2323

2424
macro_rules! await {
2525
//~^ ERROR `await` is a keyword in the 2018 edition
26-
//~^^ WARN this is valid in the current edition
26+
//~^^ WARN this is accepted in the current edition
2727
() => {}
2828
}
2929

3030
fn main() {
3131
await!(); //~ ERROR `await` is a keyword in the 2018 edition
32-
//~^ WARN this is valid in the current edition
32+
//~^ WARN this is accepted in the current edition
3333

3434
match await { await => {} } //~ ERROR `await` is a keyword in the 2018 edition
3535
//~^ ERROR `await` is a keyword in the 2018 edition
36-
//~^^ WARN this is valid in the current edition
37-
//~^^^ WARN this is valid in the current edition
36+
//~^^ WARN this is accepted in the current edition
37+
//~^^^ WARN this is accepted in the current edition
3838
}

src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: the lint level is defined here
99
|
1010
LL | #![deny(keyword_idents)]
1111
| ^^^^^^^^^^^^^^
12-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
12+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
1313
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
1414

1515
error: `await` is a keyword in the 2018 edition
@@ -18,7 +18,7 @@ error: `await` is a keyword in the 2018 edition
1818
LL | pub struct await;
1919
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
2020
|
21-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
21+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
2222
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
2323

2424
error: `await` is a keyword in the 2018 edition
@@ -27,7 +27,7 @@ error: `await` is a keyword in the 2018 edition
2727
LL | use outer_mod::await::await;
2828
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
2929
|
30-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
30+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
3131
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
3232

3333
error: `await` is a keyword in the 2018 edition
@@ -36,7 +36,7 @@ error: `await` is a keyword in the 2018 edition
3636
LL | use outer_mod::await::await;
3737
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
3838
|
39-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
39+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
4040
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
4141

4242
error: `await` is a keyword in the 2018 edition
@@ -45,7 +45,7 @@ error: `await` is a keyword in the 2018 edition
4545
LL | struct Foo { await: () }
4646
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
4747
|
48-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
48+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
4949
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
5050

5151
error: `await` is a keyword in the 2018 edition
@@ -54,7 +54,7 @@ error: `await` is a keyword in the 2018 edition
5454
LL | impl Foo { fn await() {} }
5555
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
5656
|
57-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
57+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
5858
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
5959

6060
error: `await` is a keyword in the 2018 edition
@@ -63,7 +63,7 @@ error: `await` is a keyword in the 2018 edition
6363
LL | macro_rules! await {
6464
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
6565
|
66-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
66+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
6767
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
6868

6969
error: `await` is a keyword in the 2018 edition
@@ -72,7 +72,7 @@ error: `await` is a keyword in the 2018 edition
7272
LL | await!();
7373
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
7474
|
75-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
75+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
7676
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
7777

7878
error: `await` is a keyword in the 2018 edition
@@ -81,7 +81,7 @@ error: `await` is a keyword in the 2018 edition
8181
LL | match await { await => {} }
8282
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
8383
|
84-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
84+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
8585
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
8686

8787
error: `await` is a keyword in the 2018 edition
@@ -90,7 +90,7 @@ error: `await` is a keyword in the 2018 edition
9090
LL | match await { await => {} }
9191
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
9292
|
93-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
93+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
9494
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
9595

9696
error: aborting due to 10 previous errors

src/test/ui/async-await/await-keyword/2015-edition-warning.fixed

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66
mod outer_mod {
77
pub mod r#await {
88
//~^ ERROR `await` is a keyword
9-
//~| WARN this is valid in the current edition
9+
//~| WARN this is accepted in the current edition
1010
pub struct r#await;
1111
//~^ ERROR `await` is a keyword
12-
//~| WARN this is valid in the current edition
12+
//~| WARN this is accepted in the current edition
1313
}
1414
}
1515
use outer_mod::r#await::r#await;
1616
//~^ ERROR `await` is a keyword
1717
//~| ERROR `await` is a keyword
18-
//~| WARN this is valid in the current edition
19-
//~| WARN this is valid in the current edition
18+
//~| WARN this is accepted in the current edition
19+
//~| WARN this is accepted in the current edition
2020

2121
fn main() {
2222
match r#await { r#await => {} }
2323
//~^ ERROR `await` is a keyword
2424
//~| ERROR `await` is a keyword
25-
//~| WARN this is valid in the current edition
26-
//~| WARN this is valid in the current edition
25+
//~| WARN this is accepted in the current edition
26+
//~| WARN this is accepted in the current edition
2727
}

src/test/ui/async-await/await-keyword/2015-edition-warning.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66
mod outer_mod {
77
pub mod await {
88
//~^ ERROR `await` is a keyword
9-
//~| WARN this is valid in the current edition
9+
//~| WARN this is accepted in the current edition
1010
pub struct await;
1111
//~^ ERROR `await` is a keyword
12-
//~| WARN this is valid in the current edition
12+
//~| WARN this is accepted in the current edition
1313
}
1414
}
1515
use outer_mod::await::await;
1616
//~^ ERROR `await` is a keyword
1717
//~| ERROR `await` is a keyword
18-
//~| WARN this is valid in the current edition
19-
//~| WARN this is valid in the current edition
18+
//~| WARN this is accepted in the current edition
19+
//~| WARN this is accepted in the current edition
2020

2121
fn main() {
2222
match await { await => {} }
2323
//~^ ERROR `await` is a keyword
2424
//~| ERROR `await` is a keyword
25-
//~| WARN this is valid in the current edition
26-
//~| WARN this is valid in the current edition
25+
//~| WARN this is accepted in the current edition
26+
//~| WARN this is accepted in the current edition
2727
}

src/test/ui/async-await/await-keyword/2015-edition-warning.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: the lint level is defined here
99
|
1010
LL | #![deny(keyword_idents)]
1111
| ^^^^^^^^^^^^^^
12-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
12+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
1313
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
1414

1515
error: `await` is a keyword in the 2018 edition
@@ -18,7 +18,7 @@ error: `await` is a keyword in the 2018 edition
1818
LL | pub struct await;
1919
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
2020
|
21-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
21+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
2222
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
2323

2424
error: `await` is a keyword in the 2018 edition
@@ -27,7 +27,7 @@ error: `await` is a keyword in the 2018 edition
2727
LL | use outer_mod::await::await;
2828
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
2929
|
30-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
30+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
3131
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
3232

3333
error: `await` is a keyword in the 2018 edition
@@ -36,7 +36,7 @@ error: `await` is a keyword in the 2018 edition
3636
LL | use outer_mod::await::await;
3737
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
3838
|
39-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
39+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
4040
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
4141

4242
error: `await` is a keyword in the 2018 edition
@@ -45,7 +45,7 @@ error: `await` is a keyword in the 2018 edition
4545
LL | match await { await => {} }
4646
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
4747
|
48-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
48+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
4949
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
5050

5151
error: `await` is a keyword in the 2018 edition
@@ -54,7 +54,7 @@ error: `await` is a keyword in the 2018 edition
5454
LL | match await { await => {} }
5555
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
5656
|
57-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2018 edition!
57+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
5858
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
5959

6060
error: aborting due to 6 previous errors

src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn b() {
1313
//~| ERROR expected trait, found constant `BAR`
1414
//~| ERROR type provided when a constant was expected
1515
//~| WARN trait objects without an explicit `dyn` are deprecated
16-
//~| WARN this is valid in the current edition
16+
//~| WARN this is accepted in the current edition
1717
}
1818
fn c() {
1919
foo::<3 + 3>(); //~ ERROR expressions must be enclosed in braces

src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ LL | foo::<BAR + BAR>();
138138
| ^^^^^^^^^ help: use `dyn`: `dyn BAR + BAR`
139139
|
140140
= note: `#[warn(bare_trait_objects)]` on by default
141-
= warning: this is valid in the current edition (Rust 2015) but is not accepted in the Rust 2021 edition!
141+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
142142
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
143143

144144
error[E0747]: type provided when a constant was expected

0 commit comments

Comments
 (0)