blob: 63cc3333b6b77bb50745df741b91a4cef020b4f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#![allow(dead_code, unused_variables)]
//@ run-rustfix
pub use my_mod::Foo;
//~^ NOTE the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields
//~| NOTE the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields
mod my_mod {
pub struct Foo(u32);
mod my_sub_mod {
fn my_func() {
let crate::my_mod::Foo(x) = crate::my_mod::Foo(42);
//~^ ERROR cannot initialize a tuple struct which contains private fields
//~| HELP the type can be constructed directly, because its fields are available from the current scope
//~| ERROR cannot match against a tuple struct which contains private fields
//~| HELP the type can be constructed directly, because its fields are available from the current scope
}
}
}
fn main() {}
|