Suggestions that come from rustc that are multi-line only use LF line
endings. But if the file is checked out on windows with CRLF
line-endings, then you end up with a mix of line endings that don't
match the "fixed.rs" file.
Tracking this at https://github.com/rust-lang/rust/issues/119482.
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.
chore(deps): update rust crate handlebars to `v4.5.0`
In the latest version of `handlebars`, rules for whitespace auto elimination is to check if the directive `{{# xxx}}`` and ``{{/ xxx}}` is holding a whole line, with leading and trailing whitespaces counted, and then remove the trailing NEWLINE (See [`template.rs`](9d7d555628/src/template.rs (L568-L889))).
```md
{{#options}}
<--- this newline will be removed after a standalone block
{{#option "`-o` _outdir_"}}
<--- this newline will be removed
Some content
{{/option}}
<--- this newline will be removed
{{/options}}
<--- this newline will be removed
```
This PR changes includes (fixes#13162):
1. update `handlebars` crate to `v4.5.0`.
2. add extra NEWLINE to helper blocks `options`, `option` to align with the new strip rules, preserving the original behavior.
3. update doc(the rest handlebars expression) to align with the new strip rules..
Like PR 12352 but for homepage and repository
Versions for
* `cargo-credential-1password`
* `cargo-util-schemas`
* `home`
are bumped along with the change.
Avoid writing CACHEDIR.TAG if it already exists
Cargo currently unconditionally writes `CACHEDIR.TAG` files even if they already exist.
This practice causes problems for build systems that disallow multiple writes to the same file.
To implement rust-lang/rfcs#3516, we need to decouple the resolver's
behavior from the unstable flag. Since the code path is now dead, I
went ahead and removed it.
review and remove ignored tests in rustfix
### What does this PR try to resolve?
review ignored tests in rustfix crate per #13034.
### How should we test and review this PR?
CI testing
### Additional information
* Removed unproductive test in `parse_and_replace`
* un-ignore proptests, and reduce runtime from ~2s to ~<.25s