rust/tests/ui/privacy/suggest-making-field-public.fixed

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
303 B
Rust
Raw Normal View History

// run-rustfix
mod a {
pub struct A(pub 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();
}