You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the [`rustc_middle::ty`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Ty.html). These have names
141
141
that correspond mostly to the various kinds of types. For example:
142
142
143
143
```rust,ignore
144
-
let array_ty = tcx.mk_array(elem_ty, len * 2);
144
+
let array_ty = Ty::new_array_with_const_len(tcx, ty,count)
145
145
```
146
146
147
147
These methods all return a `Ty<'tcx>` – note that the lifetime you get back is the lifetime of the
0 commit comments