Rollup merge of #89990 - petrochenkov:idempty, r=wesleywiser
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 as well.
This commit is contained in:
commit
e84537bcdd
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user