Report WF error for new solver too
This commit is contained in:
parent
388538fc96
commit
a9d093bd6b
3 changed files with 6 additions and 6 deletions
|
@ -1168,7 +1168,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
ty::PredicateKind::WellFormed(ty) => {
|
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
|
// WF predicates cannot themselves make
|
||||||
// errors. They can only block due to
|
// errors. They can only block due to
|
||||||
// ambiguity; otherwise, they always
|
// ambiguity; otherwise, they always
|
||||||
|
@ -1180,7 +1180,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
// which bounds actually failed to hold.
|
// which bounds actually failed to hold.
|
||||||
self.tcx.sess.struct_span_err(
|
self.tcx.sess.struct_span_err(
|
||||||
span,
|
span,
|
||||||
&format!("the type `{}` is not well-formed (chalk)", ty),
|
&format!("the type `{}` is not well-formed", ty),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,6 @@ fn foo<T: Foo>() {
|
||||||
fn main() {
|
fn main() {
|
||||||
// For some reason, the error is duplicated...
|
// For some reason, the error is duplicated...
|
||||||
|
|
||||||
foo::<S>() //~ 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 (chalk)
|
//~^ ERROR the type `S` is not well-formed
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
--> $DIR/recursive_where_clause_on_type.rs:28:11
|
||||||
|
|
|
|
||||||
LL | foo::<S>()
|
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
|
--> $DIR/recursive_where_clause_on_type.rs:28:5
|
||||||
|
|
|
|
||||||
LL | foo::<S>()
|
LL | foo::<S>()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue