2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2015-03-02 00:01:34 +00:00
|
|
|
|
2013-10-09 12:13:43 +00:00
|
|
|
macro_rules! compiles_fine {
|
2014-03-26 23:14:07 +00:00
|
|
|
(#[$at:meta]) => {
|
2013-10-09 12:13:43 +00:00
|
|
|
// test that the different types of attributes work
|
|
|
|
#[attribute]
|
|
|
|
/// Documentation!
|
2014-03-26 23:14:07 +00:00
|
|
|
#[$at]
|
2013-10-09 12:13:43 +00: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 17:18:10 +00:00
|
|
|
compiles_fine!(#[foo]);
|
2013-10-09 12:13:43 +00:00
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
// statement
|
|
|
|
compiles_fine!(#[bar]);
|
|
|
|
}
|