rust/src/test/ui/proc-macro/derive-helper-shadowing.rs
Vadim Petrochenkov ec45b87957 resolve: Block expansion of a derive container until all its derives are resolved
Also mark derive helpers as known as a part of the derive container's expansion instead of expansion of the derives themselves which may happen too late.
2019-08-27 00:31:55 +03:00

34 lines
804 B
Rust

// aux-build:test-macros.rs
#[macro_use]
extern crate test_macros;
use test_macros::empty_attr as empty_helper;
#[empty_helper] //~ ERROR `empty_helper` is ambiguous
#[derive(Empty)]
struct S {
// FIXME No ambiguity, attributes in non-macro positions are not resolved properly
#[empty_helper]
field: [u8; {
// FIXME No ambiguity, derive helpers are not put into scope for non-attributes
use empty_helper;
// FIXME No ambiguity, derive helpers are not put into scope for inner items
#[empty_helper]
struct U;
mod inner {
// FIXME No ambiguity, attributes in non-macro positions are not resolved properly
#[empty_helper]
struct V;
}
0
}]
}
fn main() {
let s = S { field: [] };
}