Skip to content

Commit 7b54e83

Browse files
arielb1nikomatsakis
authored andcommittedOct 6, 2017
fix logic error in rust-lang#44269's prune_cache_value_obligations
We want to retain obligations that *contain* inference variables, not obligations that *don't contain* them, in order to fix rust-lang#43132. Because of surrounding changes to inference, the ICE doesn't occur in its original case, but I believe it could still be made to occur on master. Maybe I should try to write a new test case? Certainly not right now (I'm mainly trying to get us a beta that we can ship) but maybe before we land this PR on nightly? This seems to cause a 10% performance regression in my imprecise attempt to benchmark item-body checking for rust-lang#43613, but it's better to be slow and right than fast and wrong. If we want to recover that, I think we can change the constrained-type-parameter code to actually give a list of projections that are important for resolving inference variables and filter everything else out.
1 parent 41d7051 commit 7b54e83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/librustc/traits/project.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ fn prune_cache_value_obligations<'a, 'gcx, 'tcx>(infcx: &'a InferCtxt<'a, 'gcx,
604604
// but we have `T: Foo<X = ?1>` and `?1: Bar<X =
605605
// ?0>`).
606606
ty::Predicate::Projection(ref data) =>
607-
!infcx.any_unresolved_type_vars(&data.ty()),
607+
infcx.any_unresolved_type_vars(&data.ty()),
608608

609609
// We are only interested in `T: Foo<X = U>` predicates, whre
610610
// `U` references one of `unresolved_type_vars`. =)

0 commit comments

Comments
 (0)