cargo/crates/rustfix/tests/everything
Eric Huss a21997f0cc rustfix: Support inserting new lines.
If rustfix received a suggestion which inserts new lines without
replacing existing lines, it would ignore the suggestion. This is
because `parse_snippet` would immediately return if the `lines` to
replace was empty.

The solution here is to just drop the code which messes with the
original text line. `cargo fix` (and compiletest) currently do not use
this. This was originally added back in the days when rustfix supported
an interactive UI which showed color highlighting of what it looks like
with the replacement. My feeling is that when we add something like this
back in, I would prefer to instead use a real diff library and display
instead of trying to do various text manipulation for display. This
particular code has generally been buggy, and has been a problem several
times.

The included test fails without this fix because the changes do not
apply, and the code cannot compile.
2023-12-31 10:18:22 -08:00
..
.gitignore Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
closure-immutable-outer-variable.fixed.rs Remove copyright headers in tests. 2023-11-19 08:20:21 -08:00
closure-immutable-outer-variable.json Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
closure-immutable-outer-variable.rs Remove copyright headers in tests. 2023-11-19 08:20:21 -08:00
E0178.fixed.rs Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
E0178.json Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
E0178.rs Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
handle-insert-only.fixed.rs Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
handle-insert-only.json Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
handle-insert-only.rs Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
lt-generic-comp.fixed.rs Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
lt-generic-comp.json Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
lt-generic-comp.rs Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
multiple-solutions.fixed.rs Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
multiple-solutions.json Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
multiple-solutions.rs Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
replace-only-one-char.fixed.rs Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
replace-only-one-char.json Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
replace-only-one-char.rs Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
str-lit-type-mismatch.fixed.rs Remove copyright headers in tests. 2023-11-19 08:20:21 -08:00
str-lit-type-mismatch.json Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00
str-lit-type-mismatch.rs Remove copyright headers in tests. 2023-11-19 08:20:21 -08:00
use-insert.fixed.rs rustfix: Support inserting new lines. 2023-12-31 10:18:22 -08:00
use-insert.json rustfix: Support inserting new lines. 2023-12-31 10:18:22 -08:00
use-insert.rs rustfix: Support inserting new lines. 2023-12-31 10:18:22 -08:00