Help messages could include required use
line.
#77270
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
P-low
Low priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
{This specific case originates from the following issue & comment: #47168 (comment) }
Playground link
I tried this code:
I expected to see this happen:
(Or similar.)
i.e. An error message that includes the required
use
line necessary for the suggestion to compile.Instead, this happened:
(Which would be fine if there is a pre-existing
use std::convert::TryInto;
.)This meant that--after applying the suggested fix--when compiling I got another error relating to the suggested code:
This was surprising to me because I thought the compiler diagnostics were magic & infallible . :D
Note: Example code & messages were copy & pasted from original issue.
The text was updated successfully, but these errors were encountered: