11# Rust types
22
3- Rust types are represented by the [ ` Ty ` ] and [ ` TyData ` ] types.
3+ Rust types are represented by the [ ` Ty ` ] and [ ` TyKind ` ] types.
44You use [ ` Ty ` ] to represent "some Rust type". But to actually inspect
5- what sort of type you have, you invoke the [ ` data ` ] method, which
6- returns a [ ` TyData ` ] . As described earlier, the actual in-memory
5+ what sort of type you have, you invoke the [ ` kind ` ] method, which
6+ returns a [ ` TyKind ` ] . As described earlier, the actual in-memory
77representation of types is controlled by the [ ` Interner ` ] trait.
88
99[ `Interner` ] : http://rust-lang.github.io/chalk/chalk_ir/interner/trait.Interner.html
1010[ `Ty` ] : http://rust-lang.github.io/chalk/chalk_ir/struct.Ty.html
11- [ `TyData ` ] : http://rust-lang.github.io/chalk/chalk_ir/enum.TyData .html
11+ [ `TyKind ` ] : http://rust-lang.github.io/chalk/chalk_ir/enum.TyKind .html
1212[ `data` ] : http://rust-lang.github.io/chalk/chalk_ir/struct.Ty.html#method.data
1313
14- ## The ` TyData ` variants and how they map to Rust syntax
14+ ## The ` TyKind ` variants and how they map to Rust syntax
1515
1616This section covers the variants we use to categorize types. We have
1717endeavored to create a breakdown that simplifies the Rust "surface
@@ -22,16 +22,17 @@ differences in how they are handled.
2222
2323| Chalk variant | Example Rust types |
2424| ------------- | ------------------ |
25- | ` Apply ` | ` Vec<u32> ` , ` f32 ` |
2625| ` Placeholder ` | how we represent ` T ` when type checking ` fn foo<T>() { .. } ` |
2726| ` Dyn ` | ` dyn Trait ` |
2827| ` Fn ` | ` fn(&u8) ` |
2928| ` Alias ` | ` <T as Iterator>::Item ` , or the ` Foo ` in ` type Foo = impl Trait ` and ` type Foo = u32 ` |
3029| ` BoundVariable ` | an uninstantiated generic parameter like the ` T ` in ` struct Foo<T> ` |
30+ | ` Adt ` | ` struct Foo<T> ` |
31+ | ... | ... |
3132
3233## Justification for each variant
3334
34- Each variant of ` TyData ` generally wraps a single struct, which
35+ Each variant of ` TyKind ` generally wraps a single struct, which
3536represents a type known to be of that particular variant. This section
3637goes through the variants in a bit more detail, and in particular
3738describes why each variant exists.
0 commit comments