rustc suggests to use path::_;
with as _
trait re-exports
#86035
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-doctests
Area: Documentation tests, run by rustdoc
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code (playground):
The current output for compiling the doctest is:
I'm not sure what the output should be. Originally I hit this issue with
tracing
, which re-exports one trait (soon multiple)as _
in its prelude module. They are of course reachable in another path, so that one could be prefered¹, but I realized that this issue could also crop up with a situation such as what I've constructed above, where the trait is actually unnamable. In that case, either the compiler has to suggest as*
import, or it has to not emit the help item at all.¹ probably needs an annotation like
#[doc(canonical)]
(rust-lang/rfcs#3011)The text was updated successfully, but these errors were encountered: