Skip to content

Commit e84537b

Browse files
authored
Rollup merge of rust-lang#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.
2 parents 79b73ac + 5f2ecc3 commit e84537b

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

Diff for: tests/ui-internal/unnecessary_symbol_str.fixed

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ fn main() {
1111
Symbol::intern("foo") == rustc_span::sym::clippy;
1212
Symbol::intern("foo") == rustc_span::symbol::kw::SelfLower;
1313
Symbol::intern("foo") != rustc_span::symbol::kw::SelfUpper;
14-
Ident::invalid().name == rustc_span::sym::clippy;
15-
rustc_span::sym::clippy == Ident::invalid().name;
14+
Ident::empty().name == rustc_span::sym::clippy;
15+
rustc_span::sym::clippy == Ident::empty().name;
1616
}

Diff for: tests/ui-internal/unnecessary_symbol_str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ fn main() {
1111
Symbol::intern("foo").as_str() == "clippy";
1212
Symbol::intern("foo").to_string() == "self";
1313
Symbol::intern("foo").to_ident_string() != "Self";
14-
&*Ident::invalid().as_str() == "clippy";
15-
"clippy" == Ident::invalid().to_string();
14+
&*Ident::empty().as_str() == "clippy";
15+
"clippy" == Ident::empty().to_string();
1616
}

Diff for: tests/ui-internal/unnecessary_symbol_str.stderr

+4-5
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ LL | Symbol::intern("foo").to_ident_string() != "Self";
2626
error: unnecessary `Symbol` to string conversion
2727
--> $DIR/unnecessary_symbol_str.rs:14:5
2828
|
29-
LL | &*Ident::invalid().as_str() == "clippy";
30-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Ident::invalid().name == rustc_span::sym::clippy`
29+
LL | &*Ident::empty().as_str() == "clippy";
30+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Ident::empty().name == rustc_span::sym::clippy`
3131

3232
error: unnecessary `Symbol` to string conversion
3333
--> $DIR/unnecessary_symbol_str.rs:15:5
3434
|
35-
LL | "clippy" == Ident::invalid().to_string();
36-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::clippy == Ident::invalid().name`
35+
LL | "clippy" == Ident::empty().to_string();
36+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::clippy == Ident::empty().name`
3737

3838
error: aborting due to 5 previous errors
39-

0 commit comments

Comments
 (0)