@@ -74,9 +74,9 @@ HIR is built, some basic type inference and type checking is done. During the ty
7474figure out what the ` ty::Ty ` of everything is and we also check if the type of something is
7575ambiguous. The ` ty::Ty ` is then used for type checking while making sure everything has the
7676expected type. The [ ` astconv ` module] [ astconv ] is where the code responsible for converting a
77- ` rustc_hir::Ty ` into a ` ty::Ty ` is located. This occurs during the type-checking phase,
78- but also in other parts of the compiler that want to ask questions like "what argument types does
79- this function expect?"
77+ ` rustc_hir::Ty ` into a ` ty::Ty ` is located. The main routine used is ` ast_ty_to_ty ` . This occurs
78+ during the type-checking phase, but also in other parts of the compiler that want to ask
79+ questions like "what argument types does this function expect?"
8080
8181[ astconv ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/astconv/index.html
8282
@@ -137,11 +137,13 @@ benefits of interning.
137137
138138## Allocating and working with types
139139
140- To allocate a new type, you can use the various ` mk_ ` methods defined on the ` tcx ` . These have names
140+ To allocate a new type, you can use the various ` new_* ` methods defined on
141+ [ ` Ty ` ] ( https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Ty.html ) .
142+ These have names
141143that correspond mostly to the various kinds of types. For example:
142144
143145``` rust,ignore
144- let array_ty = tcx.mk_array(elem_ty, len * 2);
146+ let array_ty = Ty::new_array_with_const_len(tcx, ty, count)
145147```
146148
147149These methods all return a ` Ty<'tcx> ` – note that the lifetime you get back is the lifetime of the
0 commit comments