diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-09-29 11:56:41 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-29 11:56:41 +1000 |
| commit | e7760fa4993c5cfe5246d27a7773c08ff093987e (patch) | |
| tree | b345b90a4efff548e0922ffa4080576d708a971c /library/std/tests/switch-stdout.rs | |
| parent | f957826bff7a68b267ce75b1ea56352aed0cca0a (diff) | |
| parent | 8f7d61b9efe1f44701f87fe4647eb1f39d20f434 (diff) | |
| download | rust-e7760fa4993c5cfe5246d27a7773c08ff093987e.tar.gz rust-e7760fa4993c5cfe5246d27a7773c08ff093987e.zip | |
Rollup merge of #133477 - estebank:issue-133343, r=davidtwco
Detect tuple structs that are unconstructable due to re-export When a tuple-struct is re-exported that has inaccessible fields at the `use` scope, the type's constructor cannot be accessed through that re-export. We now account for this case and extend the resulting resolution error. We also check if the constructor would be accessible directly, not through the re-export, and if so, we suggest using the full path instead. ``` error[E0423]: cannot initialize a tuple struct which contains private fields --> $DIR/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:12:33 | LL | let crate::Foo(x) = crate::Foo(42); | ^^^^^^^^^^ | 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 --> $DIR/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:3:9 | LL | pub use my_mod::Foo; | ^^^^^^^^^^^ help: the type can be constructed directly, because its fields are available from the current scope | LL | let crate::Foo(x) = crate::my_mod::Foo(42); | ~~~~~~~~~~~~~~~~~~ ``` Fix #133343.
Diffstat (limited to 'library/std/tests/switch-stdout.rs')
0 files changed, 0 insertions, 0 deletions
