Skip to content

Commit 0cd8e0d

Browse files
committed
we now successfully warn about async in macro invocations
1 parent 5adbdf8 commit 0cd8e0d

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ macro_rules! foo {
2626
//~| WARN hard error in the 2018 edition
2727
}
2828

29-
foo!(async);
29+
foo!(r#async);
30+
//~^ ERROR async
31+
//~| WARN hard error in the 2018 edition
3032

3133
mod dont_lint_raw {
3234
fn r#async() {}

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

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ macro_rules! foo {
2727
}
2828

2929
foo!(async);
30+
//~^ ERROR async
31+
//~| WARN hard error in the 2018 edition
3032

3133
mod dont_lint_raw {
3234
fn r#async() {}

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

+21-12
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,16 @@ LL | ($async:expr, async) => {};
3131
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
3232

3333
error: `async` is a keyword in the 2018 edition
34-
--> $DIR/async-ident.rs:36:11
34+
--> $DIR/async-ident.rs:29:6
35+
|
36+
LL | foo!(async);
37+
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
38+
|
39+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
40+
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
41+
42+
error: `async` is a keyword in the 2018 edition
43+
--> $DIR/async-ident.rs:38:11
3544
|
3645
LL | trait async {}
3746
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -40,7 +49,7 @@ LL | trait async {}
4049
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
4150

4251
error: `async` is a keyword in the 2018 edition
43-
--> $DIR/async-ident.rs:40:10
52+
--> $DIR/async-ident.rs:42:10
4453
|
4554
LL | impl async for MyStruct {}
4655
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -49,7 +58,7 @@ LL | impl async for MyStruct {}
4958
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
5059

5160
error: `async` is a keyword in the 2018 edition
52-
--> $DIR/async-ident.rs:46:12
61+
--> $DIR/async-ident.rs:48:12
5362
|
5463
LL | static async: u32 = 0;
5564
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -58,7 +67,7 @@ LL | static async: u32 = 0;
5867
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
5968

6069
error: `async` is a keyword in the 2018 edition
61-
--> $DIR/async-ident.rs:52:11
70+
--> $DIR/async-ident.rs:54:11
6271
|
6372
LL | const async: u32 = 0;
6473
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -67,7 +76,7 @@ LL | const async: u32 = 0;
6776
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
6877

6978
error: `async` is a keyword in the 2018 edition
70-
--> $DIR/async-ident.rs:58:15
79+
--> $DIR/async-ident.rs:60:15
7180
|
7281
LL | impl Foo { fn async() {} }
7382
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -76,7 +85,7 @@ LL | impl Foo { fn async() {} }
7685
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
7786

7887
error: `async` is a keyword in the 2018 edition
79-
--> $DIR/async-ident.rs:63:12
88+
--> $DIR/async-ident.rs:65:12
8089
|
8190
LL | struct async {}
8291
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -85,7 +94,7 @@ LL | struct async {}
8594
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
8695

8796
error: `async` is a keyword in the 2018 edition
88-
--> $DIR/async-ident.rs:66:9
97+
--> $DIR/async-ident.rs:68:9
8998
|
9099
LL | let async: async = async {};
91100
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -94,7 +103,7 @@ LL | let async: async = async {};
94103
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
95104

96105
error: `async` is a keyword in the 2018 edition
97-
--> $DIR/async-ident.rs:66:16
106+
--> $DIR/async-ident.rs:68:16
98107
|
99108
LL | let async: async = async {};
100109
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -103,7 +112,7 @@ LL | let async: async = async {};
103112
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
104113

105114
error: `async` is a keyword in the 2018 edition
106-
--> $DIR/async-ident.rs:66:24
115+
--> $DIR/async-ident.rs:68:24
107116
|
108117
LL | let async: async = async {};
109118
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -112,7 +121,7 @@ LL | let async: async = async {};
112121
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
113122

114123
error: `async` is a keyword in the 2018 edition
115-
--> $DIR/async-ident.rs:77:19
124+
--> $DIR/async-ident.rs:79:19
116125
|
117126
LL | () => (pub fn async() {})
118127
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -121,13 +130,13 @@ LL | () => (pub fn async() {})
121130
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
122131

123132
error: `async` is a keyword in the 2018 edition
124-
--> $DIR/async-ident.rs:84:6
133+
--> $DIR/async-ident.rs:86:6
125134
|
126135
LL | (async) => (1)
127136
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
128137
|
129138
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
130139
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
131140

132-
error: aborting due to 14 previous errors
141+
error: aborting due to 15 previous errors
133142

0 commit comments

Comments
 (0)