Rollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errors
nll: correctly deal with bivariance fixes #104409 when in a bivariant context, relating stuff should always trivially succeed. Also changes the mir validator to correctly deal with higher ranked regions. r? types cc ``@RalfJung``
This commit is contained in:
commit
00876c68c4
10 changed files with 130 additions and 85 deletions
|
@ -556,8 +556,9 @@ where
|
|||
self.ambient_variance_info = self.ambient_variance_info.xform(info);
|
||||
|
||||
debug!(?self.ambient_variance);
|
||||
|
||||
let r = self.relate(a, b)?;
|
||||
// In a bivariant context this always succeeds.
|
||||
let r =
|
||||
if self.ambient_variance == ty::Variance::Bivariant { a } else { self.relate(a, b)? };
|
||||
|
||||
self.ambient_variance = old_ambient_variance;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue