1
Fork 0

Rm diagnostic item, use lang item

This commit is contained in:
Deadbeef 2022-07-05 16:56:16 +00:00
parent c74f155b24
commit 64a17a09a8
32 changed files with 103 additions and 100 deletions

View file

@ -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(..)