1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![feature(custom_attribute)]
12 #![feature(associated_consts)]
14 macro_rules! stmt_mac {
36 // Check that cfg works right
50 #[cfg_attr(not(unset), cfg(unset))]
56 #[cfg_attr(not(unset), cfg(not(unset)))]
62 // check that macro expansion and cfg works right
64 macro_rules! item_mac {
82 #[cfg_attr(not(unset), cfg(unset))]
88 #[cfg_attr(not(unset), cfg(not(unset)))]
100 // check that the gate visitor works right:
104 fn x(a: [u8; #[attr] 5]);
105 fn y(a: [u8; #[attr] 5]); //~ ERROR 15701
111 const X: u8 = #[attr] 5;
112 const Y: u8 = #[attr] 5; //~ ERROR 15701
117 const X: [u8; #[attr] 5];
118 const Y: [u8; #[attr] 5]; //~ ERROR 15701
123 field: [u8; #[attr] 5],
124 field2: [u8; #[attr] 5] //~ ERROR 15701
128 #[cfg(unset)] [u8; #[attr] 5],
129 [u8; #[attr] 5] //~ ERROR 15701
134 #[cfg(unset)] [u8; #[attr] 5],
135 [u8; #[attr] 5] //~ ERROR 15701
139 field: [u8; #[attr] 5],
140 field2: [u8; #[attr] 5] //~ ERROR 15701
148 6 => #[attr] (), //~ ERROR 15701