Skip to content

Commit

Permalink
Rollup merge of rust-lang#106525 - compiler-errors:new-solver-wf, r=j…
Browse files Browse the repository at this point in the history
…ackh726

Report WF error for chalk *and* new solver

addressing this nit rust-lang#106385 (comment)

No test yet because new solver is currently unusable, lol

r? `@lcnr`
  • Loading branch information
compiler-errors authored Jan 7, 2023
2 parents 84f22e4 + a9d093b commit 258257a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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),
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/chalkify/recursive_where_clause_on_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ fn foo<T: Foo>() {
fn main() {
// For some reason, the error is duplicated...

foo::<S>() //~ ERROR the type `S` is not well-formed (chalk)
//~^ ERROR the type `S` is not well-formed (chalk)
foo::<S>() //~ ERROR the type `S` is not well-formed
//~^ ERROR the type `S` is not well-formed
}
4 changes: 2 additions & 2 deletions src/test/ui/chalkify/recursive_where_clause_on_type.stderr
Original file line number Diff line number Diff line change
@@ -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::<S>()
| ^

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::<S>()
Expand Down

0 comments on commit 258257a

Please sign in to comment.