From d68add9eccf2561380177d07d4e7b31433562a2b Mon Sep 17 00:00:00 2001 From: Esteban Kuber Date: Fri, 10 Sep 2021 07:30:58 +0000 Subject: [PATCH] review comment: plural of emoji is emoji --- compiler/rustc_interface/src/passes.rs | 2 +- compiler/rustc_parse/src/lexer/mod.rs | 2 +- compiler/rustc_session/src/parse.rs | 2 +- src/test/ui/parser/emoji-identifiers.rs | 12 ++++++------ src/test/ui/parser/emoji-identifiers.stderr | 12 ++++++------ 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 7286209040c33..67b5833ca4740 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -455,7 +455,7 @@ pub fn configure_and_expand( for (ident, spans) in identifiers.drain() { sess.diagnostic().span_err( MultiSpan::from(spans), - &format!("identifiers cannot contain emojis: `{}`", ident), + &format!("identifiers cannot contain emoji: `{}`", ident), ); } }); diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index 9403e0af595e6..1a620968d56a8 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -224,7 +224,7 @@ impl<'a> StringReader<'a> { token::Ident(sym, is_raw_ident) } rustc_lexer::TokenKind::InvalidIdent - // Do not recover an identifier with emojis if the codepoint is a confusable + // Do not recover an identifier with emoji if the codepoint is a confusable // with a recoverable substitution token, like `โž–`. if UNICODE_ARRAY .iter() diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 4e0f6c32e57b8..d5b520325e550 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -123,7 +123,7 @@ pub struct ParseSess { /// clashing with keywords in new editions. pub raw_identifier_spans: Lock>, /// Places where identifiers that contain invalid Unicode codepoints but that look like they - /// should be. Useful to avoid bad tokenization when encountering emojis. We group them to + /// should be. Useful to avoid bad tokenization when encountering emoji. We group them to /// provide a single error per unique incorrect identifier. pub bad_unicode_identifiers: Lock>>, source_map: Lrc, diff --git a/src/test/ui/parser/emoji-identifiers.rs b/src/test/ui/parser/emoji-identifiers.rs index e07e0573e7594..ef18939bbb80c 100644 --- a/src/test/ui/parser/emoji-identifiers.rs +++ b/src/test/ui/parser/emoji-identifiers.rs @@ -1,16 +1,16 @@ -struct ABig๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘งFamily; //~ ERROR identifiers cannot contain emojis -struct ๐Ÿ‘€; //~ ERROR identifiers cannot contain emojis +struct ABig๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘งFamily; //~ ERROR identifiers cannot contain emoji +struct ๐Ÿ‘€; //~ ERROR identifiers cannot contain emoji impl ๐Ÿ‘€ { - fn full_of_โœจ() -> ๐Ÿ‘€ { //~ ERROR identifiers cannot contain emojis + fn full_of_โœจ() -> ๐Ÿ‘€ { //~ ERROR identifiers cannot contain emoji ๐Ÿ‘€ } } -fn i_like_to_๐Ÿ˜…_a_lot() -> ๐Ÿ‘€ { //~ ERROR identifiers cannot contain emojis +fn i_like_to_๐Ÿ˜…_a_lot() -> ๐Ÿ‘€ { //~ ERROR identifiers cannot contain emoji ๐Ÿ‘€::full_ofโœจ() //~ ERROR no function or associated item named `full_ofโœจ` found for struct `๐Ÿ‘€` - //~^ ERROR identifiers cannot contain emojis + //~^ ERROR identifiers cannot contain emoji } fn main() { let _ = i_like_to_๐Ÿ˜„_a_lot() โž– 4; //~ ERROR cannot find function `i_like_to_๐Ÿ˜„_a_lot` in this scope - //~^ ERROR identifiers cannot contain emojis + //~^ ERROR identifiers cannot contain emoji //~| ERROR unknown start of token: \u{2796} } diff --git a/src/test/ui/parser/emoji-identifiers.stderr b/src/test/ui/parser/emoji-identifiers.stderr index a73681d91966b..a69a9c542d6e9 100644 --- a/src/test/ui/parser/emoji-identifiers.stderr +++ b/src/test/ui/parser/emoji-identifiers.stderr @@ -18,25 +18,25 @@ LL | fn i_like_to_๐Ÿ˜…_a_lot() -> ๐Ÿ‘€ { LL | let _ = i_like_to_๐Ÿ˜„_a_lot() โž– 4; | ^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `i_like_to_๐Ÿ˜…_a_lot` -error: identifiers cannot contain emojis: `i_like_to_๐Ÿ˜„_a_lot` +error: identifiers cannot contain emoji: `i_like_to_๐Ÿ˜„_a_lot` --> $DIR/emoji-identifiers.rs:13:13 | LL | let _ = i_like_to_๐Ÿ˜„_a_lot() โž– 4; | ^^^^^^^^^^^^^^^^^^ -error: identifiers cannot contain emojis: `full_of_โœจ` +error: identifiers cannot contain emoji: `full_of_โœจ` --> $DIR/emoji-identifiers.rs:4:8 | LL | fn full_of_โœจ() -> ๐Ÿ‘€ { | ^^^^^^^^^^ -error: identifiers cannot contain emojis: `full_ofโœจ` +error: identifiers cannot contain emoji: `full_ofโœจ` --> $DIR/emoji-identifiers.rs:9:8 | LL | ๐Ÿ‘€::full_ofโœจ() | ^^^^^^^^^ -error: identifiers cannot contain emojis: `๐Ÿ‘€` +error: identifiers cannot contain emoji: `๐Ÿ‘€` --> $DIR/emoji-identifiers.rs:2:8 | LL | struct ๐Ÿ‘€; @@ -53,13 +53,13 @@ LL | fn i_like_to_๐Ÿ˜…_a_lot() -> ๐Ÿ‘€ { LL | ๐Ÿ‘€::full_ofโœจ() | ^^ -error: identifiers cannot contain emojis: `i_like_to_๐Ÿ˜…_a_lot` +error: identifiers cannot contain emoji: `i_like_to_๐Ÿ˜…_a_lot` --> $DIR/emoji-identifiers.rs:8:4 | LL | fn i_like_to_๐Ÿ˜…_a_lot() -> ๐Ÿ‘€ { | ^^^^^^^^^^^^^^^^^^ -error: identifiers cannot contain emojis: `ABig๐Ÿ‘ฉ๐Ÿ‘ฉ๐Ÿ‘ง๐Ÿ‘งFamily` +error: identifiers cannot contain emoji: `ABig๐Ÿ‘ฉ๐Ÿ‘ฉ๐Ÿ‘ง๐Ÿ‘งFamily` --> $DIR/emoji-identifiers.rs:1:8 | LL | struct ABig๐Ÿ‘ฉ๐Ÿ‘ฉ๐Ÿ‘ง๐Ÿ‘งFamily;