]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/format.rs
Rm diagnostic item, use lang item
[rust.git] / clippy_lints / src / format.rs
index bc0c68f535a96f23e1cfd0d9b75ef55665b7d875..d0fab6949604090dfb02129c971eccb4246dd7be 100644 (file)
@@ -73,7 +73,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
                 if format_args.format_string.parts == [kw::Empty];
                 if arg.format.is_default();
                 if match cx.typeck_results().expr_ty(value).peel_refs().kind() {
-                    ty::Adt(adt, _) => cx.tcx.is_diagnostic_item(sym::String, adt.did()),
+                    ty::Adt(adt, _) => Some(adt.did()) == cx.tcx.lang_items().string(),
                     ty::Str => true,
                     _ => false,
                 };