1
Fork 0

Rollup merge of #80495 - jyn514:rename-empty, r=petrochenkov

Rename kw::Invalid -> kw::Empty

See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471
for context.

r? `@petrochenkov`
This commit is contained in:
Mara Bos 2020-12-30 20:56:58 +00:00 committed by GitHub
commit 9e8edc8c22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 46 additions and 46 deletions

View file

@ -25,7 +25,7 @@ symbols! {
Keywords {
// Special reserved identifiers used internally for elided lifetimes,
// unnamed method parameters, crate root module, error recovery etc.
Invalid: "",
Empty: "",
PathRoot: "{{root}}",
DollarCrate: "$crate",
Underscore: "_",
@ -1273,7 +1273,7 @@ impl Ident {
#[inline]
pub fn invalid() -> Ident {
Ident::with_dummy_span(kw::Invalid)
Ident::with_dummy_span(kw::Empty)
}
/// Maps a string to an identifier with a dummy span.
@ -1464,7 +1464,7 @@ impl Symbol {
}
pub fn is_empty(self) -> bool {
self == kw::Invalid
self == kw::Empty
}
/// This method is supposed to be used in error messages, so it's expected to be
@ -1648,7 +1648,7 @@ impl Symbol {
/// Returns `true` if this symbol can be a raw identifier.
pub fn can_be_raw(self) -> bool {
self != kw::Invalid && self != kw::Underscore && !self.is_path_segment_keyword()
self != kw::Empty && self != kw::Underscore && !self.is_path_segment_keyword()
}
}