cannot fix with overlapping suggestions #13026
Labels
Command-fix
S-needs-info
Status: Needs more info, such as a reproduction or more background for a feature request.
Uh oh!
There was an error while loading. Please reload this page.
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.
The text was updated successfully, but these errors were encountered: