Suggestion to import item via pub use X as _
re-export, which doesn't work
#116164
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
The suggested fix doesn't work, since
_
is a reserved identifier and items may not be imported through it:The appropriate suggestion is to import the item via a valid path.
Other cases
No response
Anything else?
Playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=013d5f59846dad0ae3add3c12d24c755
Came up as a result of triaging: obi1kenobi/cargo-semver-checks#536
The text was updated successfully, but these errors were encountered: