rust/tests/ui/privacy/suggest-making-field-public.rs
Arthur Carcano 701dd5bc9d Allow unused fields in some tests
The dead_code lint was previously eroneously missing those.
Since this lint bug has been fixed, the unused fields warnings need
to be fixed.

Most of them are marked as `#[allow(dead_code)]`. Other warnings are
fixed by changing visibility of modules.
2024-03-12 10:59:41 +01:00

16 lines
313 B
Rust

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