Commit 8679628
committed
Lex lifetimes using emoji and emit appropriate error
Lex and parse emoji in lifetimes, and disallow them in the parser with a hard error. Allow emoji to start a lifetime name even if they are not XID_Start.
```
error: lifetimes cannot contain emoji
--> $DIR/emoji-in-lifetime.rs:1:22
|
LL | fn bad_lifetime_name<'🐛🐛🐛family👨👩👧👦>(
| ^^^^^^^^^^^^^^^^^^^^^
```1 parent 35f1109 commit 8679628
File tree
4 files changed
+50
-5
lines changed- compiler
- rustc_lexer/src
- rustc_parse/src/lexer
- tests/ui/lexer
4 files changed
+50
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| |||
975 | 976 | | |
976 | 977 | | |
977 | 978 | | |
| 979 | + | |
978 | 980 | | |
979 | 981 | | |
980 | 982 | | |
981 | 983 | | |
982 | 984 | | |
983 | 985 | | |
984 | 986 | | |
985 | | - | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
986 | 993 | | |
987 | 994 | | |
988 | 995 | | |
| |||
1012 | 1019 | | |
1013 | 1020 | | |
1014 | 1021 | | |
1015 | | - | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
1016 | 1029 | | |
1017 | 1030 | | |
1018 | 1031 | | |
| |||
1024 | 1037 | | |
1025 | 1038 | | |
1026 | 1039 | | |
1027 | | - | |
| 1040 | + | |
1028 | 1041 | | |
1029 | 1042 | | |
1030 | 1043 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
325 | 326 | | |
326 | | - | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
332 | 335 | | |
333 | 336 | | |
334 | 337 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments