diff options
| author | Catherine Flores <catherine.3.flores@gmail.com> | 2025-01-28 19:29:57 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-28 19:29:57 +0000 |
| commit | 6a209cdc9045f6770031de0764217081a176aee6 (patch) | |
| tree | d2c2409dd8401f7978047c01bdc96785d88c6bbf /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | 9ede32fe0057cba9632355cad67d03567cdc6fc0 (diff) | |
| parent | 65b95a2cfb21daccddba238980b545f82ed8fd35 (diff) | |
| download | rust-6a209cdc9045f6770031de0764217081a176aee6.tar.gz rust-6a209cdc9045f6770031de0764217081a176aee6.zip | |
Fix escaping problem in `write_literal` and `print_literal` lint suggestion (#13990)
fix #13959 The current implementation of the `write_literal` and `print_literal` lint performs escaping for the second argument of `write!` ,`writeln!`, `print!` and `println!` of the suggestion by first replacing `"` with `\"`, and then replacing `\` with `\\`. Performing these replacements in this order may lead to unnecessary backslashes being added if the original code contains `"` (e.g. `"` -> `\\"`), potentially resulting in a suggestion that causes the code to fail to compile. In the issue mentioned above, it’s suggested to use raw strings as raw strings, but implementing this would require an ad-hoc change to the current implementation, so it has been deferred. (I'll implement this in another PR) changelog: [`write_literal`]: fix incorrect escaping of suggestions changelog: [`print_literal`]: fix incorrect escaping of suggestions
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
