From 747dc21fb929165db1aade840339608c75211290 Mon Sep 17 00:00:00 2001 From: GilRtr <69752800+GilRtr@users.noreply.github.com> Date: Fri, 4 Jun 2021 01:44:44 +0300 Subject: [PATCH 1/2] Added missing TypeParamBounds --- src/items/type-aliases.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/items/type-aliases.md b/src/items/type-aliases.md index 3d555d563..029d508a3 100644 --- a/src/items/type-aliases.md +++ b/src/items/type-aliases.md @@ -3,6 +3,7 @@ > **Syntax**\ > _TypeAlias_ :\ >    `type` [IDENTIFIER] [_GenericParams_]? +> ( `:` [_TypeParamBounds_] )? > [_WhereClause_]? ( `=` [_Type_] )? `;` A _type alias_ defines a new name for an existing [type]. Type aliases are @@ -35,6 +36,7 @@ A type alias without the [_Type_] specification may only appear as an [IDENTIFIER]: ../identifiers.md [_GenericParams_]: generics.md +[_TypeParamBounds_]: ../trait-bounds.md [_WhereClause_]: generics.md#where-clauses [_Type_]: ../types.md#type-expressions [associated type]: associated-items.md#associated-types From 7820e7c5c7d4e406e78aeab6b114fa3a9d372712 Mon Sep 17 00:00:00 2001 From: GilRtr <69752800+GilRtr@users.noreply.github.com> Date: Wed, 23 Jun 2021 22:27:57 +0300 Subject: [PATCH 2/2] Added limitation of `TypeParamBounds` --- src/items/type-aliases.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/items/type-aliases.md b/src/items/type-aliases.md index 029d508a3..26aaf5255 100644 --- a/src/items/type-aliases.md +++ b/src/items/type-aliases.md @@ -34,6 +34,9 @@ let _ = TypeAlias(5); // Doesn't work A type alias without the [_Type_] specification may only appear as an [associated type] in a [trait]. +A type alias with [_TypeParamBounds_] may only specified when used as +an [associated type] in a [trait]. + [IDENTIFIER]: ../identifiers.md [_GenericParams_]: generics.md [_TypeParamBounds_]: ../trait-bounds.md