rust/tests/ui/privacy/privacy-in-paths.rs
Lukas Wirth eae7fe1bdb Use non-2015 edition paths in tests that do not test for their resolution
This allows for testing these tests on editions other than 2015
2025-06-03 13:35:31 +02:00

31 lines
502 B
Rust

mod foo {
pub use self::bar::S;
mod bar {
pub struct S;
pub use crate::baz;
}
trait T {
type Assoc;
}
impl T for () {
type Assoc = S;
}
}
impl foo::S {
fn f() {}
}
pub mod baz {
fn f() {}
fn g() {
crate::foo::bar::baz::f(); //~ERROR module `bar` is private
crate::foo::bar::S::f(); //~ERROR module `bar` is private
<() as crate::foo::T>::Assoc::f(); //~ERROR trait `T` is private
}
}
fn main() {}