Rollup merge of #126354 - compiler-errors:variance, r=lcnr
Use `Variance` glob imported variants everywhere Fully commit to using the globbed variance. Could be convinced the other way, and change this PR to not use the globbed variants anywhere, but I'd rather we do one or the other. r? lcnr
This commit is contained in:
commit
335e320baa
20 changed files with 74 additions and 111 deletions
|
@ -699,7 +699,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
// exactly `T` (i.e., with invariance). The variance field, in
|
||||
// contrast, is intended to be used to relate `T` to the type of
|
||||
// `<expr>`.
|
||||
ty::Variance::Invariant,
|
||||
ty::Invariant,
|
||||
),
|
||||
},
|
||||
);
|
||||
|
|
|
@ -92,7 +92,7 @@ impl<'tcx> Cx<'tcx> {
|
|||
kind: PatKind::AscribeUserType {
|
||||
ascription: Ascription {
|
||||
annotation,
|
||||
variance: ty::Variance::Covariant,
|
||||
variance: ty::Covariant,
|
||||
},
|
||||
subpattern: pattern,
|
||||
},
|
||||
|
|
|
@ -525,7 +525,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
|
|||
};
|
||||
kind = PatKind::AscribeUserType {
|
||||
subpattern: Box::new(Pat { span, ty, kind }),
|
||||
ascription: Ascription { annotation, variance: ty::Variance::Covariant },
|
||||
ascription: Ascription { annotation, variance: ty::Covariant },
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -612,7 +612,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
|
|||
annotation,
|
||||
// Note that use `Contravariant` here. See the
|
||||
// `variance` field documentation for details.
|
||||
variance: ty::Variance::Contravariant,
|
||||
variance: ty::Contravariant,
|
||||
},
|
||||
},
|
||||
ty: const_.ty(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue