Machine applicable suggestion ignores empty where bounds #120838
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
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.
I tried this code:
(from https://github.com/rust-lang/rust/blob/cf2dff2b1e3fa55fa5415d524200070d0d7aacfe/tests/ui/trait-impl-bound-suggestions.rs)
I expected to see this happen:
just add the new predicate
Instead, this happened:
I noticed this because a change to the compiler caused two predicates to get added, so even without an empty where clause (so with none), you'd get
where X: std::marker::Copy where X: std::marker::Copy
, because the usual suggestion application logic does not see that there is a conflict, because the spans don't actually overlap.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: