-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Compiler suggestions send me into an endless loop #71394
Copy link
Copy link
Closed
Labels
A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
which outputs
Note the suggestion
Changing the type of
pointsto&mut [i8]will simply swap the suggestion to sayFrom<&[u8]>is not implemented for&mut [i8], but it is implemented for&[i8], ultimately making me chase my own tail. I have scoured the docs and came to the conclusion thatFrom<&[u8]>is not implemented for either of those types, so why does the compiler suggest it is?This behaviour occurs across stable, beta and nightly on 1.42.