diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-11-08 11:23:51 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-08 11:23:51 +0530 |
| commit | 4946ee7c8fd9a6b5b7e506373950cac57a4e8015 (patch) | |
| tree | 7fed610bfab0aebbd6df7c16f391be76c9fbb502 /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs | |
| parent | b695ed3f2032d349a5cb9f26a8df67936943c075 (diff) | |
| parent | f5e390e8631a759579674b0899087a51bb073dd3 (diff) | |
| download | rust-4946ee7c8fd9a6b5b7e506373950cac57a4e8015.tar.gz rust-4946ee7c8fd9a6b5b7e506373950cac57a4e8015.zip | |
Rollup merge of #103651 - Alexendoo:parse-format-unicode-escapes, r=wesleywiser
Fix `rustc_parse_format` spans following escaped utf-8 multibyte chars
Currently too many skips are created for char escapes that are larger than 1 byte when encoded in UTF-8, [playground:](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c77a9dc669b69b167271b59ed2c8d88c)
```rust
fn main() {
format!("\u{df}{a}");
format!("\u{211d}{a}");
format!("\u{1f4a3}{a}");
}
```
```
error[[E0425]](https://doc.rust-lang.org/stable/error-index.html#E0425): cannot find value `a` in this scope
--> src/main.rs:2:22
|
2 | format!("\u{df}{a}");
| ^ not found in this scope
error[[E0425]](https://doc.rust-lang.org/stable/error-index.html#E0425): cannot find value `a` in this scope
--> src/main.rs:3:25
|
3 | format!("\u{211d}{a}");
| ^ not found in this scope
error[[E0425]](https://doc.rust-lang.org/stable/error-index.html#E0425): cannot find value `a` in this scope
--> src/main.rs:4:27
|
4 | format!("\u{1f4a3}{a}");
| ^ not found in this scope
```
This reduces the number of skips to account for that
Fixes https://github.com/rust-lang/rust-clippy/issues/9727
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions
