mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 10:07:30 +00:00
41e66d9025
* Account for `struct S(pub(super)Ty);` in suggestion * Suggest changing field visibility in E0603 too
16 lines
308 B
Rust
16 lines
308 B
Rust
// run-rustfix
|
|
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();
|
|
}
|