about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorHTGAzureX1212. <39023054+HTGAzureX1212@users.noreply.github.com>2024-02-09 18:26:30 +0800
committerHTGAzureX1212. <39023054+HTGAzureX1212@users.noreply.github.com>2024-02-26 10:09:03 +0800
commit8bccceb8fc588d60dd25e6f13beea69aa5fc6b63 (patch)
tree3dfe0a599775f6a40bb40504ea0404e09132903a /tests/ui
parent23a3d777c8a95715977608c827de63e7738fa228 (diff)
downloadrust-8bccceb8fc588d60dd25e6f13beea69aa5fc6b63.tar.gz
rust-8bccceb8fc588d60dd25e6f13beea69aa5fc6b63.zip
separate messages for individual categories
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/lexer/lex-emoji-identifiers.rs2
-rw-r--r--tests/ui/lexer/lex-emoji-identifiers.stderr3
-rw-r--r--tests/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.rs7
-rw-r--r--tests/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.stderr13
4 files changed, 16 insertions, 9 deletions
diff --git a/tests/ui/lexer/lex-emoji-identifiers.rs b/tests/ui/lexer/lex-emoji-identifiers.rs
index bbc088521b7..4fcd102018b 100644
--- a/tests/ui/lexer/lex-emoji-identifiers.rs
+++ b/tests/ui/lexer/lex-emoji-identifiers.rs
@@ -4,7 +4,7 @@ fn invalid_emoji_usages() {
     let wireless🛜 = "basic emoji"; //~ ERROR: identifiers cannot contain emoji
     // FIXME
     let key1️⃣ = "keycap sequence"; //~ ERROR: unknown start of token
-                                    //~^ WARN: identifier contains an uncommon Unicode codepoint
+                                    //~^ WARN: identifier contains an uncommon character: '\u{fe0f}'
     let flag🇺🇳 = "flag sequence"; //~ ERROR: identifiers cannot contain emoji
     let wales🏴 = "tag sequence"; //~ ERROR: identifiers cannot contain emoji
     let folded🙏🏿 = "modifier sequence"; //~ ERROR: identifiers cannot contain emoji
diff --git a/tests/ui/lexer/lex-emoji-identifiers.stderr b/tests/ui/lexer/lex-emoji-identifiers.stderr
index 679b7422bc1..8e2daa6d1d3 100644
--- a/tests/ui/lexer/lex-emoji-identifiers.stderr
+++ b/tests/ui/lexer/lex-emoji-identifiers.stderr
@@ -40,12 +40,13 @@ error: identifiers cannot contain emoji: `folded🙏🏿`
 LL |     let folded🙏🏿 = "modifier sequence";
    |         ^^^^^^^^^^
 
-warning: identifier contains an uncommon Unicode codepoint: '\u{fe0f}'
+warning: identifier contains an uncommon character: '\u{fe0f}'
   --> $DIR/lex-emoji-identifiers.rs:6:9
    |
 LL |     let key1️⃣ = "keycap sequence";
    |         ^^^^
    |
+   = note: this character is included in the Unicode general security profile
    = note: `#[warn(uncommon_codepoints)]` on by default
 
 error: aborting due to 7 previous errors; 1 warning emitted
diff --git a/tests/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.rs b/tests/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.rs
index c3459930a94..a51452f0695 100644
--- a/tests/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.rs
+++ b/tests/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.rs
@@ -1,12 +1,13 @@
 #![deny(uncommon_codepoints)]
 
-const µ: f64 = 0.000001; //~ ERROR identifier contains an uncommon Unicode codepoint
+const µ: f64 = 0.000001; //~ identifier contains a non normalized (NFKC) character: 'µ'
 //~| WARNING should have an upper case name
 
-fn dijkstra() {} //~ ERROR identifier contains an uncommon Unicode codepoint
+fn dijkstra() {}
+//~^ ERROR identifier contains a non normalized (NFKC) character: 'ij'
 
 fn main() {
-    let ㇻㇲㇳ = "rust"; //~ ERROR identifier contains uncommon Unicode codepoints
+    let ㇻㇲㇳ = "rust"; //~ ERROR identifier contains uncommon characters: 'ㇻ', 'ㇲ', and 'ㇳ'
 
     // using the same identifier the second time won't trigger the lint.
     println!("{}", ㇻㇲㇳ);
diff --git a/tests/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.stderr b/tests/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.stderr
index bae5ac654d3..000545a0600 100644
--- a/tests/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.stderr
+++ b/tests/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.stderr
@@ -1,26 +1,31 @@
-error: identifier contains an uncommon Unicode codepoint: 'µ'
+error: identifier contains a non normalized (NFKC) character: 'µ'
   --> $DIR/lint-uncommon-codepoints.rs:3:7
    |
 LL | const µ: f64 = 0.000001;
    |       ^
    |
+   = note: this character is included in the Not_NFKC Unicode general security profile
 note: the lint level is defined here
   --> $DIR/lint-uncommon-codepoints.rs:1:9
    |
 LL | #![deny(uncommon_codepoints)]
    |         ^^^^^^^^^^^^^^^^^^^
 
-error: identifier contains an uncommon Unicode codepoint: 'ij'
+error: identifier contains a non normalized (NFKC) character: 'ij'
   --> $DIR/lint-uncommon-codepoints.rs:6:4
    |
 LL | fn dijkstra() {}
    |    ^^^^^^^
+   |
+   = note: this character is included in the Not_NFKC Unicode general security profile
 
-error: identifier contains uncommon Unicode codepoints: 'ㇻ', 'ㇲ', and 'ㇳ'
-  --> $DIR/lint-uncommon-codepoints.rs:9:9
+error: identifier contains uncommon characters: 'ㇻ', 'ㇲ', and 'ㇳ'
+  --> $DIR/lint-uncommon-codepoints.rs:10:9
    |
 LL |     let ㇻㇲㇳ = "rust";
    |         ^^^^^^
+   |
+   = note: these characters are included in the Unicode general security profile
 
 warning: constant `µ` should have an upper case name
   --> $DIR/lint-uncommon-codepoints.rs:3:7