From d75742b1eb42f0f5c1be42fc68a88c1444b4fb57 Mon Sep 17 00:00:00 2001 From: Ellen Date: Sat, 29 May 2021 05:37:45 +0100 Subject: Fix missing note on type mismatch error diagnostics --- compiler/rustc_middle/src/ty/diagnostics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_middle/src') diff --git a/compiler/rustc_middle/src/ty/diagnostics.rs b/compiler/rustc_middle/src/ty/diagnostics.rs index 982c8a354b4..866df2958a0 100644 --- a/compiler/rustc_middle/src/ty/diagnostics.rs +++ b/compiler/rustc_middle/src/ty/diagnostics.rs @@ -54,7 +54,7 @@ impl<'tcx> TyS<'tcx> { /// ADTs with no type arguments. pub fn is_simple_text(&self) -> bool { match self.kind() { - Adt(_, substs) => substs.types().next().is_none(), + Adt(_, substs) => substs.types().next().is_none() && substs.consts().next().is_none(), Ref(_, ty, _) => ty.is_simple_text(), _ => self.is_simple_ty(), } -- cgit 1.4.1-3-g733a5 From 47fe696d8f247d91c67068c25bb91767713aeb60 Mon Sep 17 00:00:00 2001 From: Ellen Date: Tue, 8 Jun 2021 09:07:52 +0100 Subject: use non_erasable_generics --- compiler/rustc_middle/src/ty/diagnostics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_middle/src') diff --git a/compiler/rustc_middle/src/ty/diagnostics.rs b/compiler/rustc_middle/src/ty/diagnostics.rs index 866df2958a0..bfb4c0cb538 100644 --- a/compiler/rustc_middle/src/ty/diagnostics.rs +++ b/compiler/rustc_middle/src/ty/diagnostics.rs @@ -54,7 +54,7 @@ impl<'tcx> TyS<'tcx> { /// ADTs with no type arguments. pub fn is_simple_text(&self) -> bool { match self.kind() { - Adt(_, substs) => substs.types().next().is_none() && substs.consts().next().is_none(), + Adt(_, substs) => substs.non_erasable_generics().next().is_none(), Ref(_, ty, _) => ty.is_simple_text(), _ => self.is_simple_ty(), } -- cgit 1.4.1-3-g733a5