Skip to content

Commit

Permalink
correct type of SubstsRef (#1347)
Browse files Browse the repository at this point in the history
  • Loading branch information
aliemjay authored May 7, 2022
1 parent acb1fcb commit 2de8cb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In rustc this is done using the `SubstsRef` that we mentioned above (“substs
Conceptually, you can think of `SubstsRef` as a list of types that are to be substituted for the
generic type parameters of the ADT.

`SubstsRef` is a type alias of `List<GenericArg<'tcx>>` (see [`List` rustdocs][list]).
`SubstsRef` is a type alias of `&'tcx List<GenericArg<'tcx>>` (see [`List` rustdocs][list]).
[`GenericArg`] is essentially a space-efficient wrapper around [`GenericArgKind`], which is an enum
indicating what kind of generic the type parameter is (type, lifetime, or const). Thus, `SubstsRef`
is conceptually like a `&'tcx [GenericArgKind<'tcx>]` slice (but it is actually a `List`).
Expand Down

0 comments on commit 2de8cb5

Please sign in to comment.