review comment: plural of emoji is emoji

This commit is contained in:
Esteban Kuber 2021-09-10 07:30:58 +00:00
parent 21224e6ee0
commit d68add9ecc
5 changed files with 15 additions and 15 deletions

View File

@ -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),
);
}
});

View File

@ -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()

View File

@ -123,7 +123,7 @@ pub struct ParseSess {
/// clashing with keywords in new editions.
pub raw_identifier_spans: Lock<Vec<Span>>,
/// 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<FxHashMap<Symbol, Vec<Span>>>,
source_map: Lrc<SourceMap>,

View File

@ -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}
}

View File

@ -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;