cargo fix
: Panic with "Cannot replace slice of data that was already replaced" #13030
Description
I have a PR to add a new suggestion to rustc: rust-lang/rust#88672. It uses Diagnostic::multipart_suggestions
since there are multiple ways for the user to change their code. These multiple suggestions are exclusive since they modify the same code.
However, rustfix is panicking when I use run-rustfix
in a test: "Cannot replace slice of data that was already replaced".
The relevant code in my PR is here: https://github.com/rust-lang/rust/blob/6a89e97ab14cd4c6be70b47fd139c87fd90150b7/compiler/rustc_parse/src/parser/diagnostics.rs#L226-L234
and here: https://github.com/rust-lang/rust/blob/6a89e97ab14cd4c6be70b47fd139c87fd90150b7/compiler/rustc_parse/src/parser/diagnostics.rs#L1272-L1277
I'm not sure how to fix this problem in rustfix, but I'm willing to try with some mentoring :)