Skip to content

Commit

Permalink
Rollup merge of rust-lang#134197 - Enselic:mirror, r=lcnr
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GuillaumeGomez authored Dec 16, 2024
2 parents 6896fdc + 165f37e commit 551c58c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions compiler/rustc_mir_build/src/thir/cx/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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))
Expand Down

0 comments on commit 551c58c

Please sign in to comment.