1
Fork 0

Use Variance glob import everywhere

This commit is contained in:
Michael Goulet 2024-06-12 15:36:35 -04:00
parent 1d43fbbc73
commit 54fa4b0b74
20 changed files with 74 additions and 111 deletions

View file

@ -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,
),
},
);

View file

@ -92,7 +92,7 @@ impl<'tcx> Cx<'tcx> {
kind: PatKind::AscribeUserType {
ascription: Ascription {
annotation,
variance: ty::Variance::Covariant,
variance: ty::Covariant,
},
subpattern: pattern,
},

View file

@ -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(),