33The lowering of [ HIR] to [ MIR] occurs for the following (probably incomplete)
44list of items:
55
6- * Function and Closure bodies
6+ * Function and closure bodies
77* Initializers of ` static ` and ` const ` items
88* Initializers of enum discriminants
9- * Glue and Shims of any kind
9+ * Glue and shims of any kind
1010 * Tuple struct initializer functions
1111 * Drop code (the ` Drop::drop ` function is not called directly)
1212 * Drop implementations of types without an explicit ` Drop ` implementation
@@ -20,9 +20,10 @@ without explicit syntax) like coercions, autoderef, autoref and overloaded metho
2020calls have become explicit casts, deref operations, reference expressions or
2121concrete function calls.
2222
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
2627without having to create an in-memory copy of the entire [ HIR] .
2728[ MIR] lowering will first convert the topmost expression from
2829[ HIR] to [ THIR] (in [ ` rustc_mir_build::thir::cx::expr ` ] ) and then process
0 commit comments