Tokenize emoji as if they were valid identifiers - #88781
Conversation
|
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
commented
Sep 9, 2021
|
cc @Manishearth |
| LL | fn i_like_to_😅_a_lot() -> 👀 { | ||
| | ^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| error: identifiers cannot contain emoji: `ABig👩👩👧👧Family` |
commented
Sep 13, 2021
|
@bors r+ rollup |
commented
Sep 13, 2021
|
📌 Commit 5979ed5 has been approved by |
commented
Sep 13, 2021
| /// Places where identifiers that contain invalid Unicode codepoints but that look like they | ||
| /// should be. Useful to avoid bad tokenization when encountering emoji. We group them to | ||
| /// provide a single error per unique incorrect identifier. | ||
| pub bad_unicode_identifiers: Lock<FxHashMap<Symbol, Vec<Span>>>, |
There was a problem hiding this comment.
| pub bad_unicode_identifiers: Lock<FxHashMap<Symbol, Vec<Span>>>, | |
| pub bad_unicode_identifiers: Lock<VecMap<Symbol, Vec<Span>>>, |
Hash maps are great, until they aren't XD
There was a problem hiding this comment.
Tried using it's API, but it really doesn't fit well with this case. I'm sorting the output before emitting the diagnostic instead.
5979ed5 to
30f9807
Compare
commented
Sep 14, 2021
|
@bors r=oli-obk |
commented
Sep 14, 2021
|
📌 Commit 30f9807 has been approved by |
commented
Nov 24, 2021
|
Once rust-lang/cargo#10117 is pulled into this repo, we can merge this PR. |
commented
Nov 24, 2021
|
@estebank Feel free to update cargo in this PR ( |
commented
Nov 25, 2021
|
@bors r=oli-obk |
commented
Nov 25, 2021
|
📌 Commit d929164 has been approved by |
commented
Nov 25, 2021
|
⌛ Testing commit d929164 with merge 9dc1d2de4eb6199a77eedd3b61e644919794b59c... |
commented
Nov 25, 2021
|
The job Click to see the possible cause of the failure (guessed by this bot) |
commented
Nov 25, 2021
|
💔 Test failed - checks-actions |
commented
Nov 25, 2021
commented
Nov 25, 2021
commented
Nov 25, 2021
|
☀️ Test successful - checks-actions |
commented
Nov 25, 2021
|
Finished benchmarking commit (23a4366): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
In the lexer, consider emojis to be valid identifiers and reject
them later to avoid knock down parse errors.
Partially address #86102.