Skip to content

Commit 68c93e7

Browse files
committed
Make async_idents allow-by-default
1 parent 9520804 commit 68c93e7

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

src/librustc_lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnnameableTestFunctions {
17881788

17891789
declare_lint! {
17901790
pub ASYNC_IDENTS,
1791-
Deny,
1791+
Allow,
17921792
"detects `async` being used as an identifier"
17931793
}
17941794

src/test/ui/rust-2018/async-ident.fixed

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![feature(raw_identifiers)]
1212
#![allow(dead_code, unused_variables, non_camel_case_types, non_upper_case_globals)]
13+
#![deny(async_idents)]
1314

1415
// edition:2015
1516
// run-rustfix
@@ -84,4 +85,4 @@ macro_rules! consumes_async {
8485
(r#async) => (1)
8586
//~^ ERROR async
8687
//~| WARN hard error in the 2018 edition
87-
}
88+
}

src/test/ui/rust-2018/async-ident.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![feature(raw_identifiers)]
1212
#![allow(dead_code, unused_variables, non_camel_case_types, non_upper_case_globals)]
13+
#![deny(async_idents)]
1314

1415
// edition:2015
1516
// run-rustfix
@@ -84,4 +85,4 @@ macro_rules! consumes_async {
8485
(async) => (1)
8586
//~^ ERROR async
8687
//~| WARN hard error in the 2018 edition
87-
}
88+
}

src/test/ui/rust-2018/async-ident.stderr

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
error: `async` is a keyword in the 2018 edition
2-
--> $DIR/async-ident.rs:17:4
2+
--> $DIR/async-ident.rs:18:4
33
|
44
LL | fn async() {} //~ ERROR async
55
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
66
|
7-
= note: #[deny(async_idents)] on by default
7+
note: lint level defined here
8+
--> $DIR/async-ident.rs:13:9
9+
|
10+
LL | #![deny(async_idents)]
11+
| ^^^^^^^^^^^^
812
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
913
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
1014

1115
error: `async` is a keyword in the 2018 edition
12-
--> $DIR/async-ident.rs:22:7
16+
--> $DIR/async-ident.rs:23:7
1317
|
1418
LL | ($async:expr, async) => {};
1519
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -18,7 +22,7 @@ LL | ($async:expr, async) => {};
1822
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
1923

2024
error: `async` is a keyword in the 2018 edition
21-
--> $DIR/async-ident.rs:22:19
25+
--> $DIR/async-ident.rs:23:19
2226
|
2327
LL | ($async:expr, async) => {};
2428
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -27,7 +31,7 @@ LL | ($async:expr, async) => {};
2731
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
2832

2933
error: `async` is a keyword in the 2018 edition
30-
--> $DIR/async-ident.rs:36:11
34+
--> $DIR/async-ident.rs:37:11
3135
|
3236
LL | trait async {}
3337
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -36,7 +40,7 @@ LL | trait async {}
3640
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
3741

3842
error: `async` is a keyword in the 2018 edition
39-
--> $DIR/async-ident.rs:40:10
43+
--> $DIR/async-ident.rs:41:10
4044
|
4145
LL | impl async for MyStruct {}
4246
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -45,7 +49,7 @@ LL | impl async for MyStruct {}
4549
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
4650

4751
error: `async` is a keyword in the 2018 edition
48-
--> $DIR/async-ident.rs:46:12
52+
--> $DIR/async-ident.rs:47:12
4953
|
5054
LL | static async: u32 = 0;
5155
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -54,7 +58,7 @@ LL | static async: u32 = 0;
5458
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
5559

5660
error: `async` is a keyword in the 2018 edition
57-
--> $DIR/async-ident.rs:52:11
61+
--> $DIR/async-ident.rs:53:11
5862
|
5963
LL | const async: u32 = 0;
6064
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -63,7 +67,7 @@ LL | const async: u32 = 0;
6367
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
6468

6569
error: `async` is a keyword in the 2018 edition
66-
--> $DIR/async-ident.rs:58:15
70+
--> $DIR/async-ident.rs:59:15
6771
|
6872
LL | impl Foo { fn async() {} }
6973
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -72,7 +76,7 @@ LL | impl Foo { fn async() {} }
7276
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
7377

7478
error: `async` is a keyword in the 2018 edition
75-
--> $DIR/async-ident.rs:63:12
79+
--> $DIR/async-ident.rs:64:12
7680
|
7781
LL | struct async {}
7882
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -81,7 +85,7 @@ LL | struct async {}
8185
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
8286

8387
error: `async` is a keyword in the 2018 edition
84-
--> $DIR/async-ident.rs:66:9
88+
--> $DIR/async-ident.rs:67:9
8589
|
8690
LL | let async: async = async {};
8791
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -90,7 +94,7 @@ LL | let async: async = async {};
9094
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
9195

9296
error: `async` is a keyword in the 2018 edition
93-
--> $DIR/async-ident.rs:66:16
97+
--> $DIR/async-ident.rs:67:16
9498
|
9599
LL | let async: async = async {};
96100
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -99,7 +103,7 @@ LL | let async: async = async {};
99103
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
100104

101105
error: `async` is a keyword in the 2018 edition
102-
--> $DIR/async-ident.rs:66:24
106+
--> $DIR/async-ident.rs:67:24
103107
|
104108
LL | let async: async = async {};
105109
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -108,7 +112,7 @@ LL | let async: async = async {};
108112
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
109113

110114
error: `async` is a keyword in the 2018 edition
111-
--> $DIR/async-ident.rs:77:19
115+
--> $DIR/async-ident.rs:78:19
112116
|
113117
LL | () => (pub fn async() {})
114118
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -117,7 +121,7 @@ LL | () => (pub fn async() {})
117121
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
118122

119123
error: `async` is a keyword in the 2018 edition
120-
--> $DIR/async-ident.rs:84:6
124+
--> $DIR/async-ident.rs:85:6
121125
|
122126
LL | (async) => (1)
123127
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`

0 commit comments

Comments
 (0)