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