2016-11-30 16:35:25 -06:00
|
|
|
enum E {}
|
|
|
|
trait Tr {}
|
|
|
|
|
2017-03-07 17:50:13 -06:00
|
|
|
pub(in E) struct S; //~ ERROR expected module, found enum `E`
|
|
|
|
pub(in Tr) struct Z; //~ ERROR expected module, found trait `Tr`
|
|
|
|
pub(in std::vec) struct F; //~ ERROR visibilities can only be restricted to ancestor modules
|
2019-08-05 13:18:50 -05:00
|
|
|
pub(in nonexistent) struct G; //~ ERROR failed to resolve
|
|
|
|
pub(in too_soon) struct H; //~ ERROR failed to resolve
|
2016-11-30 16:35:25 -06:00
|
|
|
|
|
|
|
// Visibilities are resolved eagerly without waiting for modules becoming fully populated.
|
|
|
|
// Visibilities can only use ancestor modules legally which are always available in time,
|
|
|
|
// so the worst thing that can happen due to eager resolution is a suboptimal error message.
|
|
|
|
mod too_soon {}
|
|
|
|
|
|
|
|
fn main () {}
|