Open ehuss opened 3 years ago
Attempt to resolve. @rustbot claim
The particular example mentioned in the issue is (now) being successfully handled by cargo fix
. I think this issue needs an updated test case.
@rustbot label: +S-needs-info, -S-accepted
Some suggestions include overlapping regions. These cause rustfix to fail with an error like:
Could not replace range 22...47 in file -- maybe parts of it were already replaced?
An example that triggers this is the following where multiple trait bounds are to be removed:
This results in the following suggestion:
With the suggested JSON:
This has three overlapping spans that suggest a replacement of an empty string:
I think it might be feasible to support this. At least, the new diff output from rustc is able to handle it, and clicking the "fix" suggestions in my editor is able to handle it (the regions are "smart" and know when the text within it is modified).
Note: This is relatively new behavior introduced by rust-lang/rustfix#195.