Note that type aliases cannot be recursive

This commit is contained in:
Noah Lev 2021-08-19 20:30:33 -07:00
parent 2f48bfa88c
commit cd0fc444fb
7 changed files with 84 additions and 2 deletions

View file

@ -5,6 +5,9 @@ LL | type X = Vec<X>;
| ^
|
= note: ...which immediately requires expanding type alias `X` again
= note: type aliases cannot be recursive
= help: consider using a struct, enum, or union instead to break the cycle
= help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information
note: cycle used when collecting item types in top-level module
--> $DIR/infinite-vec-type-recursion.rs:1:1
|