Open
Description
Summary
non_ascii_literal
is machine-applied by substituting unicode escapes. However, those are incompatible with raw strings.
(And if like me you try using raw strings as formatting targets, you'll then get errors about invalid references to positional arguments.)
Reproducer
This code should trigger the lint:
format!(r#"a raw string with a range {}–{} (and an en dash)"#, 31, 0);
cargo clippy --fix
reported the following:
The following errors were reported:
error: invalid reference to positional argument 2013 (there are (...) arguments)
--> src/filename.rs:(line):(col)
|
line | format!(r#"a raw string with a range {}\u{2013}{} (and an en dash)"#, 31, 0);
Version
rustc 1.62.1 (e092d0b6b 2022-07-16)
binary: rustc
commit-hash: e092d0b6b43f2de967af0887873151bb1c0b18d3
commit-date: 2022-07-16
host: x86_64-apple-darwin
release: 1.62.1
LLVM version: 14.0.5
Additional Labels
@rustbot +label I-suggestion-causes-error I-false-positive