mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +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) => {
|
ty::Predicate::Projection(ref data) => {
|
||||||
let result = self.infcx.probe(|_| {
|
self.infcx.probe(|_| {
|
||||||
let project_obligation = obligation.with(data.clone());
|
let project_obligation = obligation.with(data.clone());
|
||||||
project::poly_project_and_unify_type(self, &project_obligation)
|
match project::poly_project_and_unify_type(self, &project_obligation) {
|
||||||
});
|
Ok(Some(subobligations)) => {
|
||||||
match result {
|
self.evaluate_predicates_recursively(previous_stack,
|
||||||
Ok(Some(_subobligations)) => {
|
subobligations.iter())
|
||||||
// TODO we should evaluate _subobligations, but doing so leads to an ICE
|
}
|
||||||
// self.evaluate_predicates_recursively(previous_stack,
|
Ok(None) => {
|
||||||
// subobligations.iter())
|
EvaluatedToAmbig
|
||||||
EvaluatedToAmbig
|
}
|
||||||
|
Err(_) => {
|
||||||
|
EvaluatedToErr(Unimplemented)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(None) => {
|
})
|
||||||
EvaluatedToAmbig
|
|
||||||
}
|
|
||||||
Err(_) => {
|
|
||||||
EvaluatedToErr(Unimplemented)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user