Files
rust/tests/ui/privacy
Esteban Küber 8f7d61b9ef Detect unconstructable re-exported tuple structs
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.
2025-09-28 21:33:34 +00:00
..
2025-08-27 00:23:26 -04:00
2024-02-09 15:43:08 -03:00
2024-10-04 23:38:41 +00:00
2025-07-31 21:25:49 +05:00
2025-07-31 21:25:49 +05:00
2025-07-25 20:38:54 +05:00
2024-06-04 15:34:04 +00:00
2025-07-31 21:25:49 +05:00