rust/tests/ui/privacy/restricted/struct-literal-field.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

20 lines
277 B
Rust

#![allow(warnings)]
mod foo {
pub mod bar {
pub struct S {
pub(in crate::foo) x: i32,
}
}
fn f() {
use foo::bar::S;
S { x: 0 }; // ok
}
}
fn main() {
use crate::foo::bar::S;
S { x: 0 }; //~ ERROR private
}