Unergonomic structured suggestions in rustc #47927
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
While checking
span_help
s that could bespan_suggestion
I noticed that rustc contains lots of code similar towhere we try to get a snippet and if that fails, since we can't produce a nice suggestion, we produce a
help
message that contains a message.We should probably provide a helper for that. First I thought that we could add a helper that does essentially the above without all the duplication, but with the new approximate suggestions (#47540) we can always produce the suggestion, but mark it as approximate if we need to use the fallback value.
I'd assume the above example would look something like this:
cc @Manishearth @nrc
The text was updated successfully, but these errors were encountered: