2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2015-03-01 18:01:34 -06:00
|
|
|
|
2013-10-09 07:13:43 -05:00
|
|
|
macro_rules! compiles_fine {
|
2014-03-26 18:14:07 -05:00
|
|
|
(#[$at:meta]) => {
|
2013-10-09 07:13:43 -05:00
|
|
|
// test that the different types of attributes work
|
|
|
|
#[attribute]
|
|
|
|
/// Documentation!
|
2014-03-26 18:14:07 -05:00
|
|
|
#[$at]
|
2013-10-09 07:13:43 -05:00
|
|
|
|
|
|
|
// check that the attributes are recognised by requiring this
|
|
|
|
// to be removed to avoid a compile error
|
|
|
|
#[cfg(always_remove)]
|
|
|
|
static MISTYPED: () = "foo";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// item
|
2014-11-14 11:18:10 -06:00
|
|
|
compiles_fine!(#[foo]);
|
2013-10-09 07:13:43 -05:00
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
// statement
|
|
|
|
compiles_fine!(#[bar]);
|
|
|
|
}
|