Skip to content

Commit

Permalink
Make async_idents allow-by-default
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jul 18, 2018
1 parent 9520804 commit 68c93e7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/librustc_lint/builtin.rs
Expand Up @@ -1788,7 +1788,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnnameableTestFunctions {

declare_lint! {
pub ASYNC_IDENTS,
Deny,
Allow,
"detects `async` being used as an identifier"
}

Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/rust-2018/async-ident.fixed
Expand Up @@ -10,6 +10,7 @@

#![feature(raw_identifiers)]
#![allow(dead_code, unused_variables, non_camel_case_types, non_upper_case_globals)]
#![deny(async_idents)]

// edition:2015
// run-rustfix
Expand Down Expand Up @@ -84,4 +85,4 @@ macro_rules! consumes_async {
(r#async) => (1)
//~^ ERROR async
//~| WARN hard error in the 2018 edition
}
}
3 changes: 2 additions & 1 deletion src/test/ui/rust-2018/async-ident.rs
Expand Up @@ -10,6 +10,7 @@

#![feature(raw_identifiers)]
#![allow(dead_code, unused_variables, non_camel_case_types, non_upper_case_globals)]
#![deny(async_idents)]

// edition:2015
// run-rustfix
Expand Down Expand Up @@ -84,4 +85,4 @@ macro_rules! consumes_async {
(async) => (1)
//~^ ERROR async
//~| WARN hard error in the 2018 edition
}
}
34 changes: 19 additions & 15 deletions src/test/ui/rust-2018/async-ident.stderr
@@ -1,15 +1,19 @@
error: `async` is a keyword in the 2018 edition
--> $DIR/async-ident.rs:17:4
--> $DIR/async-ident.rs:18:4
|
LL | fn async() {} //~ ERROR async
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
= note: #[deny(async_idents)] on by default
note: lint level defined here
--> $DIR/async-ident.rs:13:9
|
LL | #![deny(async_idents)]
| ^^^^^^^^^^^^
= 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:22:7
--> $DIR/async-ident.rs:23:7
|
LL | ($async:expr, async) => {};
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -18,7 +22,7 @@ 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:22:19
--> $DIR/async-ident.rs:23:19
|
LL | ($async:expr, async) => {};
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -27,7 +31,7 @@ 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:37:11
|
LL | trait async {}
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -36,7 +40,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:41:10
|
LL | impl async for MyStruct {}
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -45,7 +49,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:47:12
|
LL | static async: u32 = 0;
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -54,7 +58,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:53:11
|
LL | const async: u32 = 0;
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -63,7 +67,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:59:15
|
LL | impl Foo { fn async() {} }
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -72,7 +76,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:64:12
|
LL | struct async {}
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -81,7 +85,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:67:9
|
LL | let async: async = async {};
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -90,7 +94,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:67:16
|
LL | let async: async = async {};
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -99,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:24
--> $DIR/async-ident.rs:67:24
|
LL | let async: async = async {};
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -108,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:77:19
--> $DIR/async-ident.rs:78:19
|
LL | () => (pub fn async() {})
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand All @@ -117,7 +121,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:85:6
|
LL | (async) => (1)
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
Expand Down

0 comments on commit 68c93e7

Please sign in to comment.