From b4c85a9d36b2ced648f823f04e8df6024d267726 Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Thu, 22 May 2025 21:25:54 +0200 Subject: [PATCH] Use consistent type parameters in subtyping.md There is no type parameter `T` in this context, so no reason to use `U` instead of `T` for disambiguation. --- src/subtyping.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/subtyping.md b/src/subtyping.md index f09fead..cdb8c51 100644 --- a/src/subtyping.md +++ b/src/subtyping.md @@ -139,7 +139,7 @@ If we remember from the above examples, it was ok for us to treat `&'a T` as a subtype of `&'b T` if `'a <: 'b`, therefore we can say that `&'a T` is *covariant* over `'a`. -Also, we saw that it was not ok for us to treat `&mut &'a U` as a subtype of `&mut &'b U`, +Also, we saw that it was not ok for us to treat `&mut &'a T` as a subtype of `&mut &'b T`, therefore we can say that `&mut T` is *invariant* over `T` Here is a table of some other generic types and their variances: