mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-19 10:24:16 +00:00

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.
16 lines
313 B
Rust
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();
|
|
}
|