about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2022-07-05 16:56:16 +0000
committerDeadbeef <ent3rm4n@gmail.com>2022-11-18 06:16:20 +0000
commit64a17a09a87118fdb80dae8bf993692d18ea9fa2 (patch)
tree1b53c3e7ba3b0dc91172defd251a712422a21d3c /compiler/rustc_trait_selection
parentc74f155b24005790fdc1ddf787a47e2bda38e01c (diff)
downloadrust-64a17a09a87118fdb80dae8bf993692d18ea9fa2.tar.gz
rust-64a17a09a87118fdb80dae8bf993692d18ea9fa2.zip
Rm diagnostic item, use lang item
Diffstat (limited to 'compiler/rustc_trait_selection')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
index 786cadaa6ce..6bb88db41bd 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
@@ -1705,7 +1705,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                 ty::Bool => Some(0),
                 ty::Char => Some(1),
                 ty::Str => Some(2),
-                ty::Adt(def, _) if tcx.is_diagnostic_item(sym::String, def.did()) => Some(2),
+                ty::Adt(def, _) if Some(def.did()) == tcx.lang_items().string() => Some(2),
                 ty::Int(..)
                 | ty::Uint(..)
                 | ty::Float(..)