error: visibilities can only be restricted to ancestor modules --> $DIR/resolve-bad-visibility.rs:6:8 | LL | pub(in std::vec) struct F; | ^^^^^^^^ error[E0577]: expected module, found enum `E` --> $DIR/resolve-bad-visibility.rs:4:8 | LL | pub(in E) struct S; | ^ not a module error[E0577]: expected module, found trait `Tr` --> $DIR/resolve-bad-visibility.rs:5:8 | LL | pub(in Tr) struct Z; | ^^ not a module error[E0578]: cannot find module `nonexistent` in the crate root --> $DIR/resolve-bad-visibility.rs:7:8 | LL | pub(in nonexistent) struct G; | ^^^^^^^^^^^ not found in the crate root error[E0578]: cannot find module `too_soon` in the crate root --> $DIR/resolve-bad-visibility.rs:8:8 | LL | pub(in too_soon) struct H; | ^^^^^^^^ not found in the crate root error: aborting due to 5 previous errors