Skip to content

Commit

Permalink
Add test for passing keywords through macros
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Apr 10, 2018
1 parent 658840f commit 79a654d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/test/compile-fail/auxiliary/edition-kw-macro-2015.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2018 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.

// compile-flags: -Zedition=2015 -Zunstable-options

#[macro_export]
macro_rules! consumes_async {
(async) => (1)
}

22 changes: 22 additions & 0 deletions src/test/compile-fail/edition-keywords-2018.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2018 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.

// compile-flags: -Zedition=2018 -Zunstable-options
// aux-build:edition-kw-macro-2015.rs

#![feature(raw_identifiers)]

#[macro_use]
extern crate edition_kw_macro_2015;

pub fn main() {
let _ = consumes_async!(async);
//~^ ERROR no rules expected the token `async`
}

0 comments on commit 79a654d

Please sign in to comment.