2019-06-08 11:36:43 +03:00
|
|
|
#![feature(rustc_attrs)]
|
2019-01-04 02:57:11 +03:00
|
|
|
|
|
|
|
|
macro_rules! check {
|
|
|
|
|
($expr: expr) => (
|
2020-11-07 16:09:40 +03:00
|
|
|
#[rustc_dummy = $expr]
|
2019-01-04 02:57:11 +03:00
|
|
|
use main as _;
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
check!("0"); // OK
|
|
|
|
|
check!(0); // OK
|
2019-05-10 03:00:51 +03:00
|
|
|
check!(0u8); //~ ERROR suffixed literals are not allowed in attributes
|
2023-12-12 09:55:50 +11:00
|
|
|
check!(-0); //~ ERROR attribute value must be a literal
|
|
|
|
|
check!(0 + 0); //~ ERROR attribute value must be a literal
|
2019-01-04 02:57:11 +03:00
|
|
|
|
|
|
|
|
fn main() {}
|