-
Notifications
You must be signed in to change notification settings - Fork 13.8k
parse and handle where T = U
predicate
#87471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -698,6 +698,17 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { | |
) | ||
} | ||
|
||
ty::PredicateKind::TypeEquate(..) => { | ||
// Errors for `TypeEquate` predicates show up as | ||
// `SelectionError::FIXME(type_equality_constraints)`, | ||
// not `Unimplemented`. | ||
span_bug!( | ||
span, | ||
"type-equate requirement gave wrong error: `{:?}`", | ||
obligation | ||
) | ||
|
||
} | ||
|
||
ty::PredicateKind::TypeWellFormedFromEnv(..) => span_bug!( | ||
span, | ||
"TypeWellFormedFromEnv predicate should only exist in the environment" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -377,6 +377,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> { | |
| ty::PredicateKind::ClosureKind(..) | ||
| ty::PredicateKind::Subtype(_) | ||
| ty::PredicateKind::ConstEvaluatable(..) | ||
| ty::PredicateKind::TypeEquate(..) | ||
| ty::PredicateKind::ConstEquate(..) => { | ||
let pred = infcx.replace_bound_vars_with_placeholders(binder); | ||
ProcessResult::Changed(mk_pending(vec![ | ||
|
@@ -491,6 +492,16 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> { | |
} | ||
} | ||
|
||
ty::PredicateKind::TypeEquate(lhs, rhs) => { | ||
match self.selcx.infcx().can_eq(obligation.param_env, lhs, rhs) { | ||
Ok(()) => ProcessResult::Changed(vec![]), | ||
Err(e) => ProcessResult::Error(FulfillmentErrorCode::CodeSubtypeError( | ||
ExpectedFound::new(false, lhs, rhs), | ||
|
||
e, | ||
)), | ||
} | ||
} | ||
|
||
ty::PredicateKind::ConstEvaluatable(def_id, substs) => { | ||
match const_evaluatable::is_const_evaluatable( | ||
self.selcx.infcx(), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -327,6 +327,7 @@ impl<'a> Clean<Option<WherePredicate>> for ty::Predicate<'a> { | |
ty::PredicateKind::RegionOutlives(pred) => pred.clean(cx), | ||
ty::PredicateKind::TypeOutlives(pred) => pred.clean(cx), | ||
ty::PredicateKind::Projection(pred) => Some(pred.clean(cx)), | ||
ty::PredicateKind::TypeEquate(..) => todo!(), | ||
|
||
ty::PredicateKind::ConstEvaluatable(..) => None, | ||
|
||
ty::PredicateKind::Subtype(..) | ||
|
Uh oh!
There was an error while loading. Please reload this page.