3
3
The lowering of [ HIR] to [ MIR] occurs for the following (probably incomplete)
4
4
list of items:
5
5
6
- * Function and Closure bodies
6
+ * Function and closure bodies
7
7
* Initializers of ` static ` and ` const ` items
8
8
* Initializers of enum discriminants
9
- * Glue and Shims of any kind
9
+ * Glue and shims of any kind
10
10
* Tuple struct initializer functions
11
11
* Drop code (the ` Drop::drop ` function is not called directly)
12
12
* Drop implementations of types without an explicit ` Drop ` implementation
@@ -20,9 +20,10 @@ without explicit syntax) like coercions, autoderef, autoref and overloaded metho
20
20
calls have become explicit casts, deref operations, reference expressions or
21
21
concrete function calls.
22
22
23
- The [ THIR] has datatypes that mirror the [ HIR] datatypes, but instead of e.g. ` -x `
24
- being a ` thir::ExprKind::Neg(thir::Expr) ` it is a ` thir::ExprKind::Neg(hir::Expr) ` .
25
- This shallowness enables the ` THIR ` to represent all datatypes that [ HIR] has, but
23
+ The [ THIR] has datatypes that mirror the [ HIR] datatypes, but the [ THIR] is a shallow
24
+ wrapper around [ HIR] . For example, instead of ` -x ` being a ` thir::ExprKind::Neg(thir::Expr) `
25
+ (a deep copy), it is a ` thir::ExprKind::Neg(hir::Expr) ` (a shallow copy).
26
+ This shallowness enables the [ THIR] to represent all datatypes that [ HIR] has, but
26
27
without having to create an in-memory copy of the entire [ HIR] .
27
28
[ MIR] lowering will first convert the topmost expression from
28
29
[ HIR] to [ THIR] (in [ ` rustc_mir_build::thir::cx::expr ` ] ) and then process
0 commit comments