Detect when unresolved import is caused by item that's cfg
ed away
#60279
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-libtest
Area: `#[test]` / the `test` library
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When having an annotated import like
#[cfg(test)] use foo::bar;
and elsewhere in the same scope we haveuse self::bar::baz;
we currently get an error about unresolved imports when building regularly. We should point out that the import would be valid if it wasn't restricted totest
runs and suggest to either remove the other imports annotation or adding one to the current import.The text was updated successfully, but these errors were encountered: