From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../tests/ui-internal/unnecessary_symbol_str.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.rs (limited to 'src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.rs') diff --git a/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.rs b/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.rs new file mode 100644 index 000000000..1bb5d55f0 --- /dev/null +++ b/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.rs @@ -0,0 +1,21 @@ +// run-rustfix +#![feature(rustc_private)] +#![deny(clippy::internal)] +#![allow( + clippy::borrow_deref_ref, + clippy::unnecessary_operation, + unused_must_use, + clippy::missing_clippy_version_attribute +)] + +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(); +} -- cgit v1.2.3