]> git.lizzy.rs Git - rust.git/commitdiff
we now successfully warn about `async` in macro invocations
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 11 Sep 2018 12:56:59 +0000 (08:56 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 11 Sep 2018 12:56:59 +0000 (08:56 -0400)
src/test/ui/rust-2018/async-ident.fixed
src/test/ui/rust-2018/async-ident.rs
src/test/ui/rust-2018/async-ident.stderr

index ef88f835fc83d1fc454d2903c81fc39b1fde44ab..125e7c3773ae5e693cf3bebba01d26ccf47fc3ad 100644 (file)
@@ -26,7 +26,9 @@ macro_rules! foo {
     //~| WARN hard error in the 2018 edition
 }
 
-foo!(async);
+foo!(r#async);
+    //~^ ERROR async
+    //~| WARN hard error in the 2018 edition
 
 mod dont_lint_raw {
     fn r#async() {}
index 069da7ffcdd4dd4ecd8f594d0994d7dcf7182ff6..01b974bcbfb0bdb071bf68e3657054e47ec0bb13 100644 (file)
@@ -27,6 +27,8 @@ macro_rules! foo {
 }
 
 foo!(async);
+    //~^ ERROR async
+    //~| WARN hard error in the 2018 edition
 
 mod dont_lint_raw {
     fn r#async() {}
index b9bb2e254b44e0fa008efd0e3325382156aa91bf..46e6af84ab8147c7f99b6b93962646a7f7990bc8 100644 (file)
@@ -31,7 +31,16 @@ LL |     ($async:expr, async) => {};
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
 error: `async` is a keyword in the 2018 edition
-  --> $DIR/async-ident.rs:36:11
+  --> $DIR/async-ident.rs:29:6
+   |
+LL | foo!(async);
+   |      ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
+   = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
+
+error: `async` is a keyword in the 2018 edition
+  --> $DIR/async-ident.rs:38:11
    |
 LL |     trait async {}
    |           ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -40,7 +49,7 @@ LL |     trait async {}
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
 error: `async` is a keyword in the 2018 edition
-  --> $DIR/async-ident.rs:40:10
+  --> $DIR/async-ident.rs:42:10
    |
 LL |     impl async for MyStruct {}
    |          ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -49,7 +58,7 @@ LL |     impl async for MyStruct {}
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
 error: `async` is a keyword in the 2018 edition
-  --> $DIR/async-ident.rs:46:12
+  --> $DIR/async-ident.rs:48:12
    |
 LL |     static async: u32 = 0;
    |            ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -58,7 +67,7 @@ LL |     static async: u32 = 0;
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
 error: `async` is a keyword in the 2018 edition
-  --> $DIR/async-ident.rs:52:11
+  --> $DIR/async-ident.rs:54:11
    |
 LL |     const async: u32 = 0;
    |           ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -67,7 +76,7 @@ LL |     const async: u32 = 0;
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
 error: `async` is a keyword in the 2018 edition
-  --> $DIR/async-ident.rs:58:15
+  --> $DIR/async-ident.rs:60:15
    |
 LL | impl Foo { fn async() {} }
    |               ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -76,7 +85,7 @@ LL | impl Foo { fn async() {} }
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
 error: `async` is a keyword in the 2018 edition
-  --> $DIR/async-ident.rs:63:12
+  --> $DIR/async-ident.rs:65:12
    |
 LL |     struct async {}
    |            ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -85,7 +94,7 @@ LL |     struct async {}
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
 error: `async` is a keyword in the 2018 edition
-  --> $DIR/async-ident.rs:66:9
+  --> $DIR/async-ident.rs:68:9
    |
 LL |     let async: async = async {};
    |         ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -94,7 +103,7 @@ LL |     let async: async = async {};
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
 error: `async` is a keyword in the 2018 edition
-  --> $DIR/async-ident.rs:66:16
+  --> $DIR/async-ident.rs:68:16
    |
 LL |     let async: async = async {};
    |                ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -103,7 +112,7 @@ LL |     let async: async = async {};
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
 error: `async` is a keyword in the 2018 edition
-  --> $DIR/async-ident.rs:66:24
+  --> $DIR/async-ident.rs:68:24
    |
 LL |     let async: async = async {};
    |                        ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -112,7 +121,7 @@ LL |     let async: async = async {};
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
 error: `async` is a keyword in the 2018 edition
-  --> $DIR/async-ident.rs:77:19
+  --> $DIR/async-ident.rs:79:19
    |
 LL |     () => (pub fn async() {})
    |                   ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -121,7 +130,7 @@ LL |     () => (pub fn async() {})
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
 error: `async` is a keyword in the 2018 edition
-  --> $DIR/async-ident.rs:84:6
+  --> $DIR/async-ident.rs:86:6
    |
 LL |     (async) => (1)
    |      ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
@@ -129,5 +138,5 @@ LL |     (async) => (1)
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 
-error: aborting due to 14 previous errors
+error: aborting due to 15 previous errors