Skip to content

Commit 35ac908

Browse files
committed
Add test to check unicode identifier version
1 parent f33a8c6 commit 35ac908

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

compiler/rustc_lexer/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub mod unescape;
3333
mod tests;
3434

3535
use unicode_properties::UnicodeEmoji;
36+
pub use unicode_xid::UNICODE_VERSION;
3637

3738
use self::LiteralKind::*;
3839
use self::TokenKind::*;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
11+
#![feature(rustc_private)]
12+
13+
extern crate rustc_driver;
14+
extern crate rustc_lexer;
15+
16+
fn main() {
17+
println!("Unicode version is: {:?}", rustc_lexer::UNICODE_VERSION);
18+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Unicode version is: (16, 0, 0)

triagebot.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,10 @@ cc = ["@Zalathar"]
991991
[mentions."src/tools/opt-dist"]
992992
cc = ["@kobzol"]
993993

994+
[mentions."tests/ui-fulldeps/lexer/unicode-version.run.stdout"]
995+
message = "Unicode version has changed."
996+
cc = ["@ehuss"]
997+
994998
[assign]
995999
warn_non_default_branch = true
9961000
contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html"

0 commit comments

Comments
 (0)