diff --git a/text/0000-trait-alias.md b/text/0000-trait-alias.md index e289dd2310e..4df5d233a08 100644 --- a/text/0000-trait-alias.md +++ b/text/0000-trait-alias.md @@ -133,6 +133,14 @@ the same way associated types are bound with regular traits: fn foo(int_iter: I) where I: IntoIntIterator> {} ``` +A trait alias can be parameterized over types and lifetimes, just like traits themselves: + +```rust +trait LifetimeParametric<'a> = Iterator>;` + +trait TypeParametric = Iterator>; +``` + --- Specifically, the grammar being added is, in informal notation: @@ -144,6 +152,8 @@ ATTRIBUTE* VISIBILITY? trait IDENTIFIER()? = GENERIC_BOUNDS (whe `GENERIC_BOUNDS` is a list of zero or more traits and lifetimes separated by `+`, the same as the current syntax for bounds on a type parameter, and `PREDICATES` is a comma-separated list of zero or more predicates, just like any other `where` clause. +`GENERIC_PARAMS` is a comma-separated list of zero or more lifetime and type parameters, +with optional bounds, just like other generic definitions. ## Use semantics