@@ -410,11 +410,11 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelation<'cx, 'gcx, 'tcx>
410410 ) ;
411411
412412 if self . ambient_covariance ( ) {
413- // Covariance, so we want `for<'a > A <: for<'b. ..> B` --
414- // therefore we replace all of the `'b...` regions with
415- // placeholders and then replace `'a...` with
416- // existentials. We then check if any instantiation of A
417- // can match against the placeholders in B .
413+ // Covariance, so we want `for<.. > A <: for<..> B` --
414+ // therefore we compare any instantiation of A (i.e., A
415+ // instantiated with existentials) against every
416+ // instantiation of B (i.e., B instantiated with
417+ // universals) .
418418
419419 let b_scope = self . create_scope ( b, UniversallyQuantified ( true ) ) ;
420420 let a_scope = self . create_scope ( a, UniversallyQuantified ( false ) ) ;
@@ -443,9 +443,11 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelation<'cx, 'gcx, 'tcx>
443443 }
444444
445445 if self . ambient_contravariance ( ) {
446- // Contravariance, so we want `for<'a> A :> for<'b...> B`
447- // -- do the opposite, therefore, of covariant. Replace
448- // the `'a...` placeholders with `'b...` variables.
446+ // Contravariance, so we want `for<..> A :> for<..> B`
447+ // -- therefore we compare every instantiation of A (i.e.,
448+ // A instantiated with universals) against any
449+ // instantiation of B (i.e., B instantiated with
450+ // existentials). Opposite of above.
449451
450452 let a_scope = self . create_scope ( a, UniversallyQuantified ( true ) ) ;
451453 let b_scope = self . create_scope ( b, UniversallyQuantified ( false ) ) ;
0 commit comments