mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Handle recursive obligations without exiting the inference probe
Conflicts: src/librustc/middle/traits/select.rs
This commit is contained in:
parent
45468f37c8
commit
fc7d8faba8
@ -338,24 +338,21 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
}
|
||||
|
||||
ty::Predicate::Projection(ref data) => {
|
||||
let result = self.infcx.probe(|_| {
|
||||
self.infcx.probe(|_| {
|
||||
let project_obligation = obligation.with(data.clone());
|
||||
project::poly_project_and_unify_type(self, &project_obligation)
|
||||
});
|
||||
match result {
|
||||
Ok(Some(_subobligations)) => {
|
||||
// TODO we should evaluate _subobligations, but doing so leads to an ICE
|
||||
// self.evaluate_predicates_recursively(previous_stack,
|
||||
// subobligations.iter())
|
||||
EvaluatedToAmbig
|
||||
match project::poly_project_and_unify_type(self, &project_obligation) {
|
||||
Ok(Some(subobligations)) => {
|
||||
self.evaluate_predicates_recursively(previous_stack,
|
||||
subobligations.iter())
|
||||
}
|
||||
Ok(None) => {
|
||||
EvaluatedToAmbig
|
||||
}
|
||||
Err(_) => {
|
||||
EvaluatedToErr(Unimplemented)
|
||||
}
|
||||
}
|
||||
Ok(None) => {
|
||||
EvaluatedToAmbig
|
||||
}
|
||||
Err(_) => {
|
||||
EvaluatedToErr(Unimplemented)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user