From a9d093bd6b88e0f129cfd9d063337940dd8823b8 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Fri, 6 Jan 2023 00:28:39 +0000 Subject: [PATCH] Report WF error for new solver too --- .../rustc_trait_selection/src/traits/error_reporting/mod.rs | 4 ++-- src/test/ui/chalkify/recursive_where_clause_on_type.rs | 4 ++-- src/test/ui/chalkify/recursive_where_clause_on_type.stderr | 4 ++-- 3 files changed, 6 insertions(+), 6 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 6996ddd872994..571067cc2214d 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -1168,7 +1168,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { } ty::PredicateKind::WellFormed(ty) => { - if self.tcx.sess.opts.unstable_opts.trait_solver != TraitSolver::Chalk { + if self.tcx.sess.opts.unstable_opts.trait_solver == TraitSolver::Classic { // WF predicates cannot themselves make // errors. They can only block due to // ambiguity; otherwise, they always @@ -1180,7 +1180,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { // which bounds actually failed to hold. self.tcx.sess.struct_span_err( span, - &format!("the type `{}` is not well-formed (chalk)", ty), + &format!("the type `{}` is not well-formed", ty), ) } } diff --git a/src/test/ui/chalkify/recursive_where_clause_on_type.rs b/src/test/ui/chalkify/recursive_where_clause_on_type.rs index 5855f000c7b93..c2c8aa6aabec2 100644 --- a/src/test/ui/chalkify/recursive_where_clause_on_type.rs +++ b/src/test/ui/chalkify/recursive_where_clause_on_type.rs @@ -25,6 +25,6 @@ fn foo() { fn main() { // For some reason, the error is duplicated... - foo::() //~ ERROR the type `S` is not well-formed (chalk) - //~^ ERROR the type `S` is not well-formed (chalk) + foo::() //~ ERROR the type `S` is not well-formed + //~^ ERROR the type `S` is not well-formed } diff --git a/src/test/ui/chalkify/recursive_where_clause_on_type.stderr b/src/test/ui/chalkify/recursive_where_clause_on_type.stderr index fddd58959278e..cead5adeaaadb 100644 --- a/src/test/ui/chalkify/recursive_where_clause_on_type.stderr +++ b/src/test/ui/chalkify/recursive_where_clause_on_type.stderr @@ -1,10 +1,10 @@ -error: the type `S` is not well-formed (chalk) +error: the type `S` is not well-formed --> $DIR/recursive_where_clause_on_type.rs:28:11 | LL | foo::() | ^ -error: the type `S` is not well-formed (chalk) +error: the type `S` is not well-formed --> $DIR/recursive_where_clause_on_type.rs:28:5 | LL | foo::()