import #[macro_export] from crate root help broken by use trees #99695
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
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 is:
If the starting order is reversed, the suggestion puts the macro first in the tree
This is suggesting to change the code to itself 🙃 It needs to move the import into a
use crate::
tree; the easy way is to make a newuse
statement (and let rustfmt clean that up); the medium way is to find an existinguse crate::
context; the hard way is when ause crate::
tree root doesn't already exist (or isn't immediately a tree at that point) determine what import granularity the code is using and match that.Related: #99694
@rustbot label +D-confusing +D-incorrect
The text was updated successfully, but these errors were encountered: