-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Diagnostic doesn't mention cfg
-ed item referenced through glob import
#141256
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
Comments
For prioritization purpose: was this encountered in real code or is this more theoretical? |
@Urgau, this was encountered in real code. Roughly, an omnibus crate that wants to let users depend only on the omnibus crate and import In case it's useful for context, here's a PR for the omnibus that adds some details and pitches a workaround: bevyengine/bevy#19297. |
Bevy maintainer here: this is real code, and users have tripped over this multiple times. It's easy to teach them what to do if they reach out for help, but the compiler should be the first line of defense here :) We have this setup due to our dynamic linking setup, which is in place to improve compile times. |
That should be the problem, I need to investigate further. rust/compiler/rustc_resolve/src/diagnostics.rs Lines 2020 to 2042 in a8e4c68
|
consider glob imports in cfg suggestion Fixes rust-lang#141256 r? `@petrochenkov`
consider glob imports in cfg suggestion Fixes rust-lang#141256 r? ``@petrochenkov``
Uh oh!
There was an error while loading. Please reload this page.
Code
Current output
Desired output
Rationale and extra context
If an item in a
cfg
gated module is directly referenced then the diagnostic will mention the gate. This does not happen if the gated module is re-exported through a glob import.Rust Version
Anything else?
Compiler Explorer: https://godbolt.org/z/d3rr35G4T
The text was updated successfully, but these errors were encountered: