forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#134043 - ehuss:unicode-version, r=jieyouxu Add test to check unicode identifier version This adds a test to verify which version of Unicode is used for identifiers. This is part of the language, documented at https://doc.rust-lang.org/nightly/reference/identifiers.html#r-ident.unicode. The version here often changes implicitly due to dependency updates pulling in new versions, and thus we often don't notice it has changed leaving the documentation out of date. The intent here is to have a canary to give us a notification when it changes so that we can update the documentation.
- Loading branch information
Showing
5 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This test is used to validate which version of Unicode is used for parsing | ||
// identifiers. If the Unicode version changes, it should also be updated in | ||
// the reference at | ||
// https://github.com/rust-lang/reference/blob/HEAD/src/identifiers.md. | ||
|
||
//@ run-pass | ||
//@ check-run-results | ||
//@ ignore-cross-compile | ||
//@ reference: ident.unicode | ||
//@ reference: ident.normalization | ||
|
||
#![feature(rustc_private)] | ||
|
||
extern crate rustc_driver; | ||
extern crate rustc_lexer; | ||
extern crate rustc_parse; | ||
|
||
fn main() { | ||
println!("Checking if Unicode version changed."); | ||
println!( | ||
"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." | ||
); | ||
println!("Unicode XID version is: {:?}", rustc_lexer::UNICODE_XID_VERSION); | ||
println!("Unicode normalization version is: {:?}", rustc_parse::UNICODE_NORMALIZATION_VERSION); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters