From adae6aa8520feb6abfcb7c0080a1d2845f701295 Mon Sep 17 00:00:00 2001 From: Greg Morenz Date: Fri, 21 Nov 2025 14:10:35 -0500 Subject: [PATCH] Add test for nfc-normalization of idents --- tests/ui/lexer/ident_normalization.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/ui/lexer/ident_normalization.rs diff --git a/tests/ui/lexer/ident_normalization.rs b/tests/ui/lexer/ident_normalization.rs new file mode 100644 index 000000000000..a16c52171106 --- /dev/null +++ b/tests/ui/lexer/ident_normalization.rs @@ -0,0 +1,20 @@ +//@check-pass +//@edition:2021 + +#![allow(non_snake_case)] + +// Tests that identifiers are NFC-normalized as per +// https://rust-lang.github.io/rfcs/2457-non-ascii-idents.html + +// Note that in the first argument of each function `K` is LATIN CAPITAL LETTER K +// and in the second it is K (KELVIN SIGN). + +fn ident_nfc(_p1: K, _p2: K) {} + +fn raw_ident_nfc(_p1: r#K, _p2: r#K) {} + +fn lifetime_nfc<'K>(_p1: &'K str, _p2: &'K str) {} + +fn raw_lifetime_nfc<'K>(_p1: &'r#K str, _p2: &'r#K str) {} + +fn main() {}