2018-07-14 14:40:17 +00:00
|
|
|
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2018-07-17 17:56:41 +00:00
|
|
|
#![allow(dead_code, unused_variables, non_camel_case_types, non_upper_case_globals)]
|
2018-08-24 20:48:20 +00:00
|
|
|
#![deny(keyword_idents)]
|
2018-07-14 14:40:17 +00:00
|
|
|
|
2018-07-17 17:56:41 +00:00
|
|
|
// edition:2015
|
2018-07-14 14:40:17 +00:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
fn async() {} //~ ERROR async
|
2018-07-17 17:56:41 +00:00
|
|
|
//~^ WARN hard error in the 2018 edition
|
2018-07-14 14:40:17 +00:00
|
|
|
|
|
|
|
macro_rules! foo {
|
|
|
|
($foo:ident) => {};
|
|
|
|
($async:expr, async) => {};
|
|
|
|
//~^ ERROR async
|
|
|
|
//~| ERROR async
|
2018-07-17 17:56:41 +00:00
|
|
|
//~| WARN hard error in the 2018 edition
|
|
|
|
//~| WARN hard error in the 2018 edition
|
2018-07-14 14:40:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
foo!(async);
|
2018-09-11 12:56:59 +00:00
|
|
|
//~^ ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
2018-07-14 14:40:17 +00:00
|
|
|
|
|
|
|
mod dont_lint_raw {
|
|
|
|
fn r#async() {}
|
|
|
|
}
|
|
|
|
|
2018-07-17 17:56:41 +00:00
|
|
|
mod async_trait {
|
|
|
|
trait async {}
|
|
|
|
//~^ ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
|
|
|
struct MyStruct;
|
|
|
|
impl async for MyStruct {}
|
|
|
|
//~^ ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
|
|
|
}
|
|
|
|
|
|
|
|
mod async_static {
|
|
|
|
static async: u32 = 0;
|
|
|
|
//~^ ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
|
|
|
}
|
|
|
|
|
|
|
|
mod async_const {
|
|
|
|
const async: u32 = 0;
|
|
|
|
//~^ ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
impl Foo { fn async() {} }
|
|
|
|
//~^ ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
struct async {}
|
|
|
|
//~^ ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
|
|
|
let async: async = async {};
|
|
|
|
//~^ ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
|
|
|
//~| ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
|
|
|
//~| ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
|
|
|
}
|
|
|
|
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! produces_async {
|
|
|
|
() => (pub fn async() {})
|
|
|
|
//~^ ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
|
|
|
}
|
|
|
|
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! consumes_async {
|
|
|
|
(async) => (1)
|
|
|
|
//~^ ERROR async
|
|
|
|
//~| WARN hard error in the 2018 edition
|
2018-07-18 08:55:41 +00:00
|
|
|
}
|