Skip to content

Commit

Permalink
rustc_mir_build: Clarify that 'mirrored' does not mean 'flipped' or '…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Enselic committed Dec 12, 2024
1 parent 1f3bf23 commit aaff8b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_mir_build/src/thir/cx/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ use crate::thir::cx::Cx;
use crate::thir::util::UserAnnotatedTyHelpers;

impl<'tcx> Cx<'tcx> {
// Create a THIR expression that is "the same" as the HIR expression. The
// term "mirror" in this case does not refer to "flipped" or "reversed".
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))
Expand Down

0 comments on commit aaff8b1

Please sign in to comment.