mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-27 07:55:03 +00:00
5f2ecc37f8
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.
17 lines
449 B
Rust
17 lines
449 B
Rust
// run-rustfix
|
|
#![feature(rustc_private)]
|
|
#![deny(clippy::internal)]
|
|
#![allow(clippy::unnecessary_operation, unused_must_use)]
|
|
|
|
extern crate rustc_span;
|
|
|
|
use rustc_span::symbol::{Ident, Symbol};
|
|
|
|
fn main() {
|
|
Symbol::intern("foo").as_str() == "clippy";
|
|
Symbol::intern("foo").to_string() == "self";
|
|
Symbol::intern("foo").to_ident_string() != "Self";
|
|
&*Ident::empty().as_str() == "clippy";
|
|
"clippy" == Ident::empty().to_string();
|
|
}
|