Skip to content

Commit 3b6a1bd

Browse files
tshepangJohnTitor
andauthored
first mention of type, and add a link (#1643)
Co-authored-by: Yuki Okushi <[email protected]>
1 parent 9bdc399 commit 3b6a1bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/generics.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inference, type checking, and trait solving. Conceptually, during these routines
66
that one type is equal to another type and want to swap one out for the other and then swap that out
77
for another type and so on until we eventually get some concrete types (or an error).
88

9-
In rustc this is done using the `SubstsRef` that we mentioned above (“substs” = “substitutions”).
9+
In rustc this is done using [SubstsRef] (“substs” = “substitutions”).
1010
Conceptually, you can think of `SubstsRef` as a list of types that are to be substituted for the
1111
generic type parameters of the ADT.
1212

@@ -18,6 +18,7 @@ is conceptually like a `&'tcx [GenericArgKind<'tcx>]` slice (but it is actually
1818
[list]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.List.html
1919
[`GenericArg`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.GenericArg.html
2020
[`GenericArgKind`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/enum.GenericArgKind.html
21+
[SubstsRef]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/type.SubstsRef.html
2122

2223
So why do we use this `List` type instead of making it really a slice? It has the length "inline",
2324
so `&List` is only 32 bits. As a consequence, it cannot be "subsliced" (that only works if the

0 commit comments

Comments
 (0)