diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-07 17:57:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-07 17:57:17 +0100 |
| commit | 0e3af6af4708b38065688c6bc4462a916083aff7 (patch) | |
| tree | 7e8ed8d904d362bc4b1cfb4ea28e8151eafa4c59 /compiler/rustc_interface/src | |
| parent | e45984b7746737feeef1dffe403475b2cc4e68cd (diff) | |
| parent | 747cdc0dfd784c280d50ad50661a1f00a2677842 (diff) | |
| download | rust-0e3af6af4708b38065688c6bc4462a916083aff7.tar.gz rust-0e3af6af4708b38065688c6bc4462a916083aff7.zip | |
Rollup merge of #107709 - tialaramex:master, r=compiler-errors
Fix problem noticed in PR106859 with char -> u8 suggestion
HN reader `@ayosec` noticed that my #106859 a few weeks back, malfunctions if you have a Unicode escape, the code suggested b'\u{0}' if you tried to use '\u{0}' where a byte should be, when of course b'\u{0}' is not a byte literal, regardless of the codepoint you can't write Unicode escapes in a byte literal at all.
My proposed fix here just checks that the "character" you wrote is fewer than 5 bytes, thus allowing \x7F and similar escapes but conveniently forbidding even the smallest Unicode escape \u{0} before offering the suggestion as before.
I have provided an updated test which includes examples which do and don't work because of this additional rule.
Diffstat (limited to 'compiler/rustc_interface/src')
0 files changed, 0 insertions, 0 deletions
