We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be012c7 commit 5ee4525Copy full SHA for 5ee4525
compiler/rustc_middle/src/ty/context.rs
@@ -834,6 +834,12 @@ pub struct CanonicalUserTypeAnnotation<'tcx> {
834
pub user_ty: CanonicalUserType<'tcx>,
835
pub span: Span,
836
pub inferred_ty: Ty<'tcx>,
837
+ /// The variance relation inferred type and the user type.
838
+ ///
839
+ /// If this is covariant, then `inferred_ty` has to be a subtype of `user_ty`.
840
841
+ /// As the variance is already applied from `user_ty` to `inferred_ty`, all
842
+ /// other uses of `inferred_ty` should be invariant.
843
pub variance: Variance,
844
}
845
0 commit comments