-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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 | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not entirely sure what this was referencing, I suspect it's fine to leave this? |
||
} | ||
|
||
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), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO create a new fulfillment error code |
||
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!(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO not entirely sure whether to make this |
||
ty::PredicateKind::ConstEvaluatable(..) => None, | ||
|
||
ty::PredicateKind::Subtype(..) | ||
|
Uh oh!
There was an error while loading. Please reload this page.