diff options
| author | Martin Nordholts <martin.nordholts@codetale.se> | 2024-12-12 06:32:22 +0100 |
|---|---|---|
| committer | Martin Nordholts <martin.nordholts@codetale.se> | 2024-12-13 16:45:18 +0100 |
| commit | 165f37e375750dcb8f03252193d69227a686c7ce (patch) | |
| tree | 406727bc19bd41956d6a1c6849a442535c1c5463 | |
| parent | 1f3bf231e160b9869e2a85260fd6805304bfcee2 (diff) | |
| download | rust-165f37e375750dcb8f03252193d69227a686c7ce.tar.gz rust-165f37e375750dcb8f03252193d69227a686c7ce.zip | |
rustc_mir_build: Clarify that 'mirrored' does not mean 'flipped' or 'reversed'
My intuition for 'mirrored' is that it means 'flipped' or 'reversed'. Clarify that that is not what is meant to 'mirror' the THIR from the HIR.
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/cx/expr.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index d75f01dfba0..831b0445ca7 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -26,6 +26,14 @@ use crate::thir::cx::Cx; use crate::thir::util::UserAnnotatedTyHelpers; impl<'tcx> Cx<'tcx> { + /// Create a THIR expression for the given HIR expression. This expands all + /// adjustments and directly adds the type information from the + /// `typeck_results`. See the [dev-guide] for more details. + /// + /// (The term "mirror" in this case does not refer to "flipped" or + /// "reversed".) + /// + /// [dev-guide]: https://rustc-dev-guide.rust-lang.org/thir.html pub(crate) fn mirror_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) -> ExprId { // `mirror_expr` is recursing very deep. Make sure the stack doesn't overflow. ensure_sufficient_stack(|| self.mirror_expr_inner(expr)) |
