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
2025-07-20 21:11:39 +02:00
2025-06-03 13:35:31 +02:00
2025-08-22 17:55:15 +00:00
2023-08-02 13:40:28 +03:00
2024-02-17 13:59:45 +01:00
2025-07-22 01:40:45 +00:00
2023-08-02 13:40:28 +03:00
2024-02-07 14:59:26 +00:00
2025-06-03 13:35:31 +02:00
2025-06-03 13:35:31 +02:00
2025-09-28 21:33:34 +00:00
2025-09-28 21:33:34 +00:00
2025-09-28 21:33:34 +00:00
2024-02-16 20:02:50 +00:00
2024-03-24 09:34:11 +01:00
2023-11-24 19:15:52 +01:00
2025-08-27 00:23:26 -04:00
2023-08-02 13:40:28 +03:00
2023-10-05 01:04:41 +00:00
2025-07-17 23:19:12 +00:00
2023-03-31 17:07:59 +04:00
2024-12-12 23:36:27 +00:00
2023-11-24 19:15:52 +01:00
2024-04-04 14:43:44 +00:00
2025-05-03 17:22:52 +02:00
2025-05-03 17:22:52 +02:00
2024-02-16 20:02:50 +00:00
2025-08-17 13:01:02 -04:00
2025-08-17 13:01:02 -04:00
2025-08-17 13:01:02 -04:00
2024-02-16 20:02:50 +00:00
2024-02-09 15:43:08 -03:00
2024-02-16 20:02:50 +00:00
2023-04-03 22:28:55 -05:00
2024-04-12 12:59:40 +09:00
2025-06-03 13:35:31 +02:00
2025-06-03 13:35:31 +02:00
2025-06-03 13:35:31 +02:00
2024-05-21 20:16:39 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2025-02-10 20:21:39 +00:00
2023-11-29 18:11:57 +00:00
2024-02-16 20:02:50 +00:00
2023-05-26 06:23:03 +00:00
2023-11-24 19:15:52 +01:00
2023-05-26 06:23:03 +00:00
2023-05-26 06:23:03 +00:00
2023-07-28 14:28:02 +01:00
2025-07-17 23:19:12 +00:00
2023-07-28 14:28:02 +01:00
2025-07-17 23:19:12 +00:00
2023-07-28 14:28:02 +01:00
2025-07-17 23:19:12 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-01-04 02:02:57 +08:00
2025-06-03 13:35:31 +02:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2025-08-13 20:22:18 +08:00
2024-06-17 10:09:27 +00:00
2024-06-17 10:09:27 +00:00
2024-11-26 02:50:48 +08:00
2023-04-03 22:28:55 -05:00
2024-04-12 12:59:40 +09:00
2024-11-26 02:50:48 +08:00
2025-06-16 23:04:33 +00:00
2025-06-16 23:04:33 +00:00
2025-06-03 13:35:31 +02:00
2025-06-03 13:35:31 +02:00
2025-04-08 23:06:31 +03:00
2025-06-03 15:16:51 +00:00
2025-06-16 23:04:33 +00:00
2025-06-16 23:04:33 +00:00
2024-02-16 20:02:50 +00:00
2025-02-14 00:27:13 -08:00
2025-06-03 13:35:31 +02:00
2025-06-03 13:35:31 +02:00
2025-03-22 11:41:42 +08:00
2025-03-22 11:41:42 +08:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2023-04-03 22:28:55 -05:00
2024-04-12 12:59:40 +09:00
2025-06-03 13:35:31 +02:00
2025-06-03 13:35:31 +02:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-07-29 10:32:15 +02:00
2025-07-29 10:32:15 +02:00
2025-08-04 16:43:53 -04:00
2025-08-04 16:43:53 -04:00
2025-08-17 13:01:02 -04:00
2025-08-17 13:01:02 -04:00
2025-08-31 10:55:14 +08:00
2023-11-24 19:15:52 +01:00
2023-08-02 13:40:28 +03:00
2023-08-02 13:40:28 +03:00
2024-02-16 20:02:50 +00:00
2023-08-02 13:40:28 +03:00
2023-11-24 19:15:52 +01:00
2024-02-17 13:59:45 +01:00
2024-02-17 13:59:45 +01:00
2025-03-11 12:05:02 +00:00
2025-07-17 23:59:41 +00:00
2025-07-26 21:21:04 +00:00
2024-02-16 20:02:50 +00:00
2023-12-08 14:26:03 +00:00
2025-06-03 13:35:31 +02:00
2023-06-12 01:02:19 +03:00
2024-02-16 20:02:50 +00:00
2023-08-02 13:40:28 +03:00
2025-04-03 11:08:55 +03:00
2025-04-03 11:08:55 +03:00
2023-08-02 13:40:28 +03:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-11-26 02:50:48 +08:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2025-01-18 20:33:15 +00:00
2025-01-18 20:33:15 +00:00
2023-11-24 19:15:52 +01:00
2024-10-04 23:38:41 +00: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
2023-10-22 21:27:46 +08:00
2023-12-01 12:10:07 +08:00
2024-02-08 12:28:35 +00:00
2024-02-08 12:28:35 +00:00
2024-02-08 12:28:35 +00:00
2025-07-26 21:21:04 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2025-08-27 15:06:05 -04:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2025-07-25 20:38:54 +05:00
2025-07-25 20:38:54 +05:00
2024-02-07 14:59:26 +00:00
2024-02-07 14:59:26 +00:00
2025-09-04 22:56:24 +02:00
2025-09-04 22:56:24 +02:00
2024-03-12 10:59:41 +01:00
2024-03-12 10:59:41 +01:00
2025-02-10 20:21:39 +00:00
2025-09-04 22:56:24 +02:00
2025-09-04 22:56:24 +02:00
2025-02-10 20:21:39 +00:00
2025-01-28 19:42:32 +03:00
2025-02-10 20:21:39 +00:00
2025-06-04 19:32:06 +05:00
2025-06-04 19:32:06 +05:00
2024-06-04 15:34:04 +00:00
2024-06-04 15:34:04 +00:00
2024-06-04 15:34:04 +00:00
2025-01-18 20:33:15 +00:00
2023-11-24 19:15:52 +01:00
2024-03-13 18:37:40 +03:00
2024-03-13 18:37:40 +03:00
2024-02-23 10:57:11 +11:00
2024-02-23 10:57:11 +11:00
2024-02-16 20:02:50 +00:00
2023-12-19 22:33:26 +03:00
2025-07-31 21:25:49 +05:00
2023-04-03 22:28:55 -05:00
2024-04-12 12:59:40 +09:00
2024-06-05 22:25:42 +01:00
2024-06-05 22:25:42 +01:00
2025-03-24 16:57:07 +00:00
2025-03-24 16:57:07 +00:00
2024-02-16 20:02:50 +00:00
2023-04-02 19:42:30 -04:00
2024-02-16 20:02:50 +00:00
2023-04-02 19:42:30 -04:00