-
Notifications
You must be signed in to change notification settings - Fork 13.3k
make a help text for 'cannot find macro' actionable #102881
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
make a help text for 'cannot find macro' actionable #102881
Conversation
r? @TaKO8Ki (rust-highfive has picked a reviewer for you, use r? to override) |
I'll fix any other ui tests had forgot to update after reviews. |
This comment has been minimized.
This comment has been minimized.
| ^^^^^^^^ | ||
| | ||
= help: consider importing this macro: | ||
use hey::bitflags; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure there's a way to make this into an actual applicable suggestion, instead of just editing the message that this formats. I think that should be done instead of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one question.
As you say, err.span_suggestions()
is more appropriate instead of err.help
to show a suggestion.
The output will be like this.
help: consider importing this macro
|
LL | use hey::bitflags;
|
I don't know what to do with the argument Span
that I pass to err_suggestions
because it is a process in a clause where use_placement_span
is None
.
if let (IsPattern::Yes, Some(span)) = (is_pattern, use_placement_span){
.....
} else if let Some(span) = use_placement_span {
......
}
else {
msg.push(':');
for candidate in accessible_path_strings {
msg.push('\n');
msg.push_str(&format!("use {};", &candidate.0));
}
err.help(&msg); <- I wanna replace it
}
Do you have any idea or are these any code of similar processing?
r? compiler-errors i'll take a look at this later |
r? @compiler-errors oops 😅 |
@togami2864: Disregard my last suggestion about |
de66eb0
to
5c8e3c0
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
☔ The latest upstream changes (presumably #106984) made this pull request unmergeable. Please resolve the merge conflicts. |
@togami2864 any updates on this? |
Closing this as inactive. Feel free to make a new pr if needed |
fix #102601