rust/tests/ui-internal/unnecessary_symbol_str.fixed
Vadim Petrochenkov 5f2ecc37f8 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.
2021-10-17 23:20:30 +03:00

17 lines
496 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") == rustc_span::sym::clippy;
Symbol::intern("foo") == rustc_span::symbol::kw::SelfLower;
Symbol::intern("foo") != rustc_span::symbol::kw::SelfUpper;
Ident::empty().name == rustc_span::sym::clippy;
rustc_span::sym::clippy == Ident::empty().name;
}