2024-02-16 20:02:50 +00:00
|
|
|
//@ run-rustfix
|
2024-02-20 21:20:14 +01:00
|
|
|
pub mod a {
|
2023-01-10 20:57:02 +00:00
|
|
|
pub struct A(pub(self)String);
|
|
|
|
}
|
|
|
|
|
|
|
|
mod b {
|
|
|
|
use crate::a::A;
|
|
|
|
pub fn x() {
|
|
|
|
A("".into()); //~ ERROR cannot initialize a tuple struct which contains private fields
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fn main() {
|
|
|
|
a::A("a".into()); //~ ERROR tuple struct constructor `A` is private
|
|
|
|
b::x();
|
|
|
|
}
|