Check projections are well-formed when using projection candidates

This commit is contained in:
Matthew Jasper 2020-06-28 12:41:46 +01:00
parent 87f2f42dc2
commit b3057f4d5f
13 changed files with 278 additions and 30 deletions

View file

@ -323,9 +323,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
_ => return,
}
let result = self
.infcx
.probe(|_| self.match_projection_obligation_against_definition_bounds(obligation));
let result = self.infcx.probe(|_| {
self.match_projection_obligation_against_definition_bounds(obligation).is_some()
});
if result {
candidates.vec.push(ProjectionCandidate);