Skip to content

Commit aaa5c4e

Browse files
committed
review comment: plural of emoji is emoji
1 parent 07cec2c commit aaa5c4e

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

compiler/rustc_interface/src/passes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ pub fn configure_and_expand(
450450
for (ident, spans) in identifiers.drain() {
451451
sess.diagnostic().span_err(
452452
MultiSpan::from(spans),
453-
&format!("identifiers cannot contain emojis: `{}`", ident),
453+
&format!("identifiers cannot contain emoji: `{}`", ident),
454454
);
455455
}
456456
});

compiler/rustc_parse/src/lexer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl<'a> StringReader<'a> {
193193
token::Ident(sym, is_raw_ident)
194194
}
195195
rustc_lexer::TokenKind::InvalidIdent
196-
// Do not recover an identifier with emojis if the codepoint is a confusable
196+
// Do not recover an identifier with emoji if the codepoint is a confusable
197197
// with a recoverable substitution token, like `➖`.
198198
if UNICODE_ARRAY
199199
.iter()

compiler/rustc_session/src/parse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub struct ParseSess {
123123
/// clashing with keywords in new editions.
124124
pub raw_identifier_spans: Lock<Vec<Span>>,
125125
/// Places where identifiers that contain invalid Unicode codepoints but that look like they
126-
/// should be. Useful to avoid bad tokenization when encountering emojis. We group them to
126+
/// should be. Useful to avoid bad tokenization when encountering emoji. We group them to
127127
/// provide a single error per unique incorrect identifier.
128128
pub bad_unicode_identifiers: Lock<FxHashMap<Symbol, Vec<Span>>>,
129129
source_map: Lrc<SourceMap>,
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
struct ABig👩‍👩‍👧‍👧Family; //~ ERROR identifiers cannot contain emojis
2-
struct 👀; //~ ERROR identifiers cannot contain emojis
1+
struct ABig👩‍👩‍👧‍👧Family; //~ ERROR identifiers cannot contain emoji
2+
struct 👀; //~ ERROR identifiers cannot contain emoji
33
impl 👀 {
4-
fn full_of_() -> 👀 { //~ ERROR identifiers cannot contain emojis
4+
fn full_of_() -> 👀 { //~ ERROR identifiers cannot contain emoji
55
👀
66
}
77
}
8-
fn i_like_to_😅_a_lot() -> 👀 { //~ ERROR identifiers cannot contain emojis
8+
fn i_like_to_😅_a_lot() -> 👀 { //~ ERROR identifiers cannot contain emoji
99
👀::full_of() //~ ERROR no function or associated item named `full_of✨` found for struct `👀`
10-
//~^ ERROR identifiers cannot contain emojis
10+
//~^ ERROR identifiers cannot contain emoji
1111
}
1212
fn main() {
1313
let _ = i_like_to_😄_a_lot()4; //~ ERROR cannot find function `i_like_to_😄_a_lot` in this scope
14-
//~^ ERROR identifiers cannot contain emojis
14+
//~^ ERROR identifiers cannot contain emoji
1515
//~| ERROR unknown start of token: \u{2796}
1616
}

src/test/ui/parser/emoji-identifiers.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ LL | fn i_like_to_😅_a_lot() -> 👀 {
1818
LL | let _ = i_like_to_😄_a_lot() ➖ 4;
1919
| ^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `i_like_to_😅_a_lot`
2020

21-
error: identifiers cannot contain emojis: `i_like_to_😄_a_lot`
21+
error: identifiers cannot contain emoji: `i_like_to_😄_a_lot`
2222
--> $DIR/emoji-identifiers.rs:13:13
2323
|
2424
LL | let _ = i_like_to_😄_a_lot() ➖ 4;
2525
| ^^^^^^^^^^^^^^^^^^
2626

27-
error: identifiers cannot contain emojis: `full_of_✨`
27+
error: identifiers cannot contain emoji: `full_of_✨`
2828
--> $DIR/emoji-identifiers.rs:4:8
2929
|
3030
LL | fn full_of_✨() -> 👀 {
3131
| ^^^^^^^^^^
3232

33-
error: identifiers cannot contain emojis: `full_of✨`
33+
error: identifiers cannot contain emoji: `full_of✨`
3434
--> $DIR/emoji-identifiers.rs:9:8
3535
|
3636
LL | 👀::full_of✨()
3737
| ^^^^^^^^^
3838

39-
error: identifiers cannot contain emojis: `👀`
39+
error: identifiers cannot contain emoji: `👀`
4040
--> $DIR/emoji-identifiers.rs:2:8
4141
|
4242
LL | struct 👀;
@@ -53,13 +53,13 @@ LL | fn i_like_to_😅_a_lot() -> 👀 {
5353
LL | 👀::full_of✨()
5454
| ^^
5555

56-
error: identifiers cannot contain emojis: `i_like_to_😅_a_lot`
56+
error: identifiers cannot contain emoji: `i_like_to_😅_a_lot`
5757
--> $DIR/emoji-identifiers.rs:8:4
5858
|
5959
LL | fn i_like_to_😅_a_lot() -> 👀 {
6060
| ^^^^^^^^^^^^^^^^^^
6161

62-
error: identifiers cannot contain emojis: `ABig👩👩👧👧Family`
62+
error: identifiers cannot contain emoji: `ABig👩👩👧👧Family`
6363
--> $DIR/emoji-identifiers.rs:1:8
6464
|
6565
LL | struct ABig👩👩👧👧Family;

0 commit comments

Comments
 (0)