Bad suggestion for dependency_on_unit_never_type_fallback for wildcard assignment expression #133688
Labels
A-edition-2024
Area: The 2024 edition
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
D-edition
Diagnostics: An error or lint that should account for edition differences.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
L-dependency_on_unit_never_type_fallback
Lint: dependency_on_unit_never_type_fallback
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The
dependency_on_unit_never_type_fallback
lint seems to provide a bad suggestion for an assignment to a wildcard pattern. Example (sorry, not minimized further, this is based on serde):This gives a suggestion to modify it with:
This is not valid syntax, as an assignment expression does not allow qualifying with types.
In this case, I'm uncertain if the fallback can actually be a problem? If not, then maybe the lint shouldn't fire? Or if a type annotation is needed, then maybe use fully-qualified syntax?
cc @WaffleLapkin
The text was updated successfully, but these errors were encountered: