]> git.lizzy.rs Git - rust.git/blob - tests/ui/resolve/resolve-bad-visibility.rs
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
[rust.git] / tests / 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 failed to resolve
8 pub(in too_soon) struct H; //~ ERROR failed to resolve
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 () {}