diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs index 5b5cb8ae13e..a7eb883f337 100644 --- a/src/librustc/middle/traits/select.rs +++ b/src/librustc/middle/traits/select.rs @@ -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) - } - } + }) } } }