]> git.lizzy.rs Git - rust.git/blob - src/test/ui/resolve/resolve-bad-visibility.rs
Rollup merge of #61207 - taiki-e:arbitrary_self_types-lifetime-elision-2, r=Centril
[rust.git] / src / test / ui / resolve / resolve-bad-visibility.rs
1 enum E {}
2 trait Tr {}
3
4 pub(in E) struct S; //~ ERROR expected module, found enum `E`
5 pub(in Tr) struct Z; //~ ERROR expected module, found trait `Tr`
6 pub(in std::vec) struct F; //~ ERROR visibilities can only be restricted to ancestor modules
7 pub(in nonexistent) struct G; //~ ERROR cannot find module `nonexistent` in the crate root
8 pub(in too_soon) struct H; //~ ERROR cannot find module `too_soon` in the crate root
9
10 // Visibilities are resolved eagerly without waiting for modules becoming fully populated.
11 // Visibilities can only use ancestor modules legally which are always available in time,
12 // so the worst thing that can happen due to eager resolution is a suboptimal error message.
13 mod too_soon {}
14
15 fn main () {}