File tree Expand file tree Collapse file tree 5 files changed +40
-0
lines changed Expand file tree Collapse file tree 5 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ pub mod unescape;
3333mod tests;
3434
3535use unicode_properties:: UnicodeEmoji ;
36+ pub use unicode_xid:: UNICODE_VERSION as UNICODE_XID_VERSION ;
3637
3738use self :: LiteralKind :: * ;
3839use self :: TokenKind :: * ;
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ use rustc_data_structures::sync::Lrc;
2424use rustc_errors:: { Diag , FatalError , PResult } ;
2525use rustc_session:: parse:: ParseSess ;
2626use rustc_span:: { FileName , SourceFile , Span } ;
27+ pub use unicode_normalization:: UNICODE_VERSION as UNICODE_NORMALIZATION_VERSION ;
2728
2829pub const MACRO_ARGUMENTS : Option < & str > = Some ( "macro arguments" ) ;
2930
Original file line number Diff line number Diff line change 1+ // This test is used to validate which version of Unicode is used for parsing
2+ // identifiers. If the Unicode version changes, it should also be updated in
3+ // the reference at
4+ // https://github.com/rust-lang/reference/blob/HEAD/src/identifiers.md.
5+
6+ //@ run-pass
7+ //@ check-run-results
8+ //@ ignore-cross-compile
9+ //@ reference: ident.unicode
10+ //@ reference: ident.normalization
11+
12+ #![ feature( rustc_private) ]
13+
14+ extern crate rustc_driver;
15+ extern crate rustc_lexer;
16+ extern crate rustc_parse;
17+
18+ fn main ( ) {
19+ println ! ( "Checking if Unicode version changed." ) ;
20+ println ! (
21+ "If the Unicode version changes are intentional, \
22+ it should also be updated in the reference at \
23+ https://github.com/rust-lang/reference/blob/HEAD/src/identifiers.md."
24+ ) ;
25+ println ! ( "Unicode XID version is: {:?}" , rustc_lexer:: UNICODE_XID_VERSION ) ;
26+ println ! ( "Unicode normalization version is: {:?}" , rustc_parse:: UNICODE_NORMALIZATION_VERSION ) ;
27+ }
Original file line number Diff line number Diff line change 1+ Checking if Unicode version changed.
2+ 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.
3+ Unicode XID version is: (16, 0, 0)
4+ Unicode normalization version is: (16, 0, 0)
Original file line number Diff line number Diff line change @@ -991,6 +991,13 @@ cc = ["@Zalathar"]
991991[mentions ."src/tools/opt-dist" ]
992992cc = [" @kobzol" ]
993993
994+ [mentions ."tests/ui-fulldeps/lexer/unicode-version .run .stdout" ]
995+ message = """ If the Unicode version changes are intentional,
996+ it should also be updated in the reference at
997+ https://github.com/rust-lang/reference/blob/HEAD/src/identifiers.md.
998+ """
999+ cc = [" @ehuss" ]
1000+
9941001[assign ]
9951002warn_non_default_branch = true
9961003contributing_url = " https://rustc-dev-guide.rust-lang.org/getting-started.html"
You can’t perform that action at this time.
0 commit comments