Skip to content

Commit 5ee4525

Browse files
committed
add comment
1 parent be012c7 commit 5ee4525

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_middle/src/ty/context.rs

+6
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,12 @@ pub struct CanonicalUserTypeAnnotation<'tcx> {
834834
pub user_ty: CanonicalUserType<'tcx>,
835835
pub span: Span,
836836
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.
837843
pub variance: Variance,
838844
}
839845

0 commit comments

Comments
 (0)