-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linker error with non-reachable type #16734
Comments
Another example: #20201 (comment) |
This example now builds just fine with Cargo, but the example from the comment still fails with rustc. |
I came across a related issue today, put an example of the problematic project here: https://github.com/davidrhyswhite/rust-structs-example Essentially when running Also a little more information from the rust IRC channel:
|
I stumbled across a variation (slightly simpler since there is no templated type). Repo |
FWIW, properly exporting everything used in public interfaces is the next thing in my queue after #29822 |
The problem in my example is that the compiler is happy to export a public function ( |
No, according to that RFC, what should happen is that:
My understanding of the RFC is thus that the compiler currently allows behaviour it shouldn't. Maybe there are some cases where code does this even though it shouldn't, but they will need to enable a gated feature to continue doing so. |
I agree, the current rules are somewhat counterintuitive, but changing them requires writing a new RFC and breaking some (pretty rare) code. |
Just hit this during a refactoring: had a pub-in-private type that I forgot to explicitly re-export. |
Ok, I'll try to allocate some time this weekend and fix this, people continue hitting this bug again and again. |
Fixes #16734 and probably some other issues This is a continuation of #29822, but the algorithm is mostly a copy of #29973, so r? @alexcrichton or @nikomatsakis
There are a number of problems with this, and they may likely all be inter-related.
Baz
is a publicly visible private type.Nominating due to the publicly visible private type not generating an error.
The text was updated successfully, but these errors were encountered: