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)]
13 macro_rules! stmt_mac {
23 #[attr] //~ ERROR attributes on expressions are experimental
35 // Check that cfg works right
49 #[cfg_attr(not(unset), cfg(unset))]
55 #[cfg_attr(not(unset), cfg(not(unset)))]
61 // check that macro expansion and cfg works right
63 macro_rules! item_mac {
81 #[cfg_attr(not(unset), cfg(unset))]
87 #[cfg_attr(not(unset), cfg(not(unset)))]
99 // check that the gate visitor works right:
103 fn x(a: [u8; #[attr] 5]);
104 fn y(a: [u8; #[attr] 5]); //~ ERROR 15701
110 const X: u8 = #[attr] 5;
111 const Y: u8 = #[attr] 5; //~ ERROR 15701
116 const X: [u8; #[attr] 5];
117 const Y: [u8; #[attr] 5]; //~ ERROR 15701
122 field: [u8; #[attr] 5],
123 field2: [u8; #[attr] 5] //~ ERROR 15701
127 #[cfg(unset)] [u8; #[attr] 5],
128 [u8; #[attr] 5] //~ ERROR 15701
133 #[cfg(unset)] [u8; #[attr] 5],
134 [u8; #[attr] 5] //~ ERROR 15701
138 field: [u8; #[attr] 5],
139 field2: [u8; #[attr] 5] //~ ERROR 15701
147 6 => #[attr] (), //~ ERROR 15701