-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
parser/lexer: bump to Unicode 17, use faster unicode-ident #148321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
At the moment there is this test in place, checking that Would expanding this test to all the Unicode-version dependent crates used in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, to clarify, this is exactly what I was proposing in this comment: #148321 (comment) I was looking into it, and my particular method I was going with was just adding an anonymous constant in each of the crates to make a static assertion. So, for example, in // ensure that unicode version is same as libstd
const _: () = {
let internal = std::char::UNICODE_VERSION;
let properties = unicode_properties::UNICODE_VERSION;
assert!(internal.0 as u64 == properties.0);
assert!(internal.1 as u64 == properties.1);
assert!(internal.2 as u64 == properties.2);
};
const _: () = {
let internal = std::char::UNICODE_VERSION;
let xid = unicode_xid::UNICODE_VERSION;
assert!(internal.0 as u64 == xid.0);
assert!(internal.1 as u64 == xid.1);
assert!(internal.2 as u64 == xid.2);
};(note: I'm using libstd's version as an anchor because it's the most convenient: if all of them match, then libstd should match. also, while I could use unstable features to make this simpler with |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| Checking if Unicode version changed. | ||
| If the Unicode version changes are intentional, it should also be updated in the reference at https://github.com/rust-lang/reference/blob/HEAD/src/identifiers.md. | ||
| Unicode XID version is: (16, 0, 0) | ||
| Unicode normalization version is: (16, 0, 0) | ||
| Unicode version used in rustc_parse is: (17, 0, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay, #149226 use-case spotted in the wild