rustc_span: Ident::invalid -> Ident::empty

The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s.
This commit is contained in:
Vadim Petrochenkov 2021-10-17 23:20:30 +03:00
parent 0a23fff82d
commit 5f2ecc37f8
3 changed files with 8 additions and 9 deletions

View File

@ -11,6 +11,6 @@ fn main() {
Symbol::intern("foo") == rustc_span::sym::clippy;
Symbol::intern("foo") == rustc_span::symbol::kw::SelfLower;
Symbol::intern("foo") != rustc_span::symbol::kw::SelfUpper;
Ident::invalid().name == rustc_span::sym::clippy;
rustc_span::sym::clippy == Ident::invalid().name;
Ident::empty().name == rustc_span::sym::clippy;
rustc_span::sym::clippy == Ident::empty().name;
}

View File

@ -11,6 +11,6 @@ fn main() {
Symbol::intern("foo").as_str() == "clippy";
Symbol::intern("foo").to_string() == "self";
Symbol::intern("foo").to_ident_string() != "Self";
&*Ident::invalid().as_str() == "clippy";
"clippy" == Ident::invalid().to_string();
&*Ident::empty().as_str() == "clippy";
"clippy" == Ident::empty().to_string();
}

View File

@ -26,14 +26,13 @@ LL | Symbol::intern("foo").to_ident_string() != "Self";
error: unnecessary `Symbol` to string conversion
--> $DIR/unnecessary_symbol_str.rs:14:5
|
LL | &*Ident::invalid().as_str() == "clippy";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Ident::invalid().name == rustc_span::sym::clippy`
LL | &*Ident::empty().as_str() == "clippy";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Ident::empty().name == rustc_span::sym::clippy`
error: unnecessary `Symbol` to string conversion
--> $DIR/unnecessary_symbol_str.rs:15:5
|
LL | "clippy" == Ident::invalid().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::clippy == Ident::invalid().name`
LL | "clippy" == Ident::empty().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::clippy == Ident::empty().name`
error: aborting due to 5 previous errors