]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc-macro/disappearing-resolution.rs
Rollup merge of #106717 - klensy:typo, r=lcnr
[rust.git] / tests / ui / proc-macro / disappearing-resolution.rs
1 // Regression test for issue #64803 (initial attribute resolution can disappear later).
2
3 // aux-build:test-macros.rs
4
5 #[macro_use]
6 extern crate test_macros;
7
8 mod m {
9     use test_macros::Empty;
10 }
11 use m::Empty; //~ ERROR derive macro import `Empty` is private
12
13 // To resolve `empty_helper` we need to resolve `Empty`.
14 // During initial resolution `use m::Empty` introduces no entries, so we proceed to `macro_use`,
15 // successfully resolve `Empty` from there, and then resolve `empty_helper` as its helper.
16 // During validation `use m::Empty` introduces a `Res::Err` stub, so `Empty` resolves to it,
17 // and `empty_helper` can no longer be resolved.
18 #[empty_helper] //~ ERROR cannot find attribute `empty_helper` in this scope
19 #[derive(Empty)]
20 struct S;
21
22 fn main() {}