2020-12-31 17:59:09 +03:00
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
|
|
|
|
#[rustc_dummy = stringify!(a)] // OK
|
|
|
|
macro_rules! bar {
|
|
|
|
() => {};
|
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME?: `bar` here expands before `stringify` has a chance to expand.
|
|
|
|
// `#[rustc_dummy = ...]` is validated and dropped during expansion of `bar`,
|
2023-12-12 09:55:50 +11:00
|
|
|
// the "attribute value must be a literal" error comes from the validation.
|
|
|
|
#[rustc_dummy = stringify!(b)] //~ ERROR attribute value must be a literal
|
2020-12-31 17:59:09 +03:00
|
|
|
bar!();
|
|
|
|
|
|
|
|
fn main() {}
|