Matthias Krüger
0e3af6af47
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.
2023-02-07 17:57:17 +01:00
..
2023-01-30 20:12:19 +00:00
2023-01-11 14:49:55 -08:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-25 08:58:27 -05:00
2023-01-25 08:58:27 -05:00
2023-01-15 19:46:20 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-13 22:43:17 +00:00
2023-01-13 22:43:17 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-11 14:40:02 -08:00
2023-01-11 14:40:02 -08:00
2023-01-15 16:33:08 +00:00
2023-01-30 20:12:19 +00:00
2023-01-11 19:46:45 +00:00
2023-01-11 19:46:45 +00:00
2023-01-11 19:31:34 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-22 17:02:47 +00:00
2023-01-22 17:02:47 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-22 17:02:47 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-20 02:26:12 -05:00
2023-01-20 02:26:12 -05:00
2023-01-30 20:12:19 +00:00
2023-01-11 19:46:45 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:21 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-12 20:17:25 +08:00
2023-01-12 20:17:25 +08:00
2023-01-12 20:17:25 +08:00
2023-01-30 20:12:19 +00:00
2023-01-25 19:26:53 +00:00
2023-01-25 19:37:10 +00:00
2023-01-11 21:30:10 +00:00
2023-01-30 20:12:19 +00:00
2023-01-22 17:02:47 +00:00
2023-01-22 17:02:47 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-15 19:46:20 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 13:39:25 -08:00
2023-01-30 13:39:25 -08:00
2023-01-17 13:48:43 +01:00
2023-01-30 20:12:21 +00:00
2023-02-06 11:26:36 -08:00
2023-02-06 11:26:36 -08:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-13 13:34:55 +09:00
2023-01-30 20:12:19 +00:00
2023-02-03 21:37:41 +00:00
2023-02-03 21:37:41 +00:00
2023-02-03 21:37:41 +00:00
2023-01-30 20:12:19 +00:00
2023-01-23 00:42:20 +08:00
2023-01-23 00:42:20 +08:00
2023-01-30 20:12:19 +00:00
2023-01-11 21:38:54 +00:00
2023-01-11 21:38:54 +00:00
2023-01-11 21:38:54 +00:00
2023-01-11 21:38:54 +00:00
2023-01-11 21:38:54 +00:00
2023-01-11 21:38:54 +00:00
2023-01-11 21:39:07 +00:00
2023-01-11 21:39:07 +00:00
2023-01-11 21:39:07 +00:00
2023-01-30 20:12:21 +00:00
2023-01-30 20:12:21 +00:00
2023-02-06 21:48:10 +00:00
2023-02-06 21:48:10 +00:00
2023-01-12 22:04:30 +00:00
2023-01-30 20:12:19 +00:00