rust_2021_prelude_collisions suggestions cause compile error with generics #88442
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-edition-2021
Area: The 2021 edition
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
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:
The
rust_2021_prelude_collisions
lint provides two suggestions, both of which fail with different errors. The first:fails with "type annotations needed" because the generics in the path
::<usize>
are lost.The second:
fails with "the trait bound
(): From<u64>
is not satisfied".Ideally I think the suggestions should be:
Found in the 2021 crate run migrating https://crater-reports.s3.amazonaws.com/pr-87190-3/try%23a7a572ce3edd6d476191fbfe92c9c1986e009b34/reg/kamadak-exif-0.5.4/log.txt
The text was updated successfully, but these errors were encountered: