Rename kw::Invalid -> kw::Empty

See 220054471
for context.
This commit is contained in:
Joshua Nelson 2020-12-29 20:28:08 -05:00
parent dc6121ca68
commit edeac1778c
27 changed files with 46 additions and 46 deletions

View file

@ -1065,7 +1065,7 @@ pub fn decode_syntax_context<
parent: SyntaxContext::root(),
opaque: SyntaxContext::root(),
opaque_and_semitransparent: SyntaxContext::root(),
dollar_crate_name: kw::Invalid,
dollar_crate_name: kw::Empty,
});
let mut ctxts = outer_ctxts.lock();
let new_len = raw_id as usize + 1;
@ -1092,7 +1092,7 @@ pub fn decode_syntax_context<
ctxt_data,
);
// Make sure nothing weird happening while `decode_data` was running
assert_eq!(dummy.dollar_crate_name, kw::Invalid);
assert_eq!(dummy.dollar_crate_name, kw::Empty);
});
Ok(new_ctxt)

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.
@ -1470,7 +1470,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
@ -1654,7 +1654,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()
}
}