Skip to content

Commit 551c58c

Browse files
Rollup merge of rust-lang#134197 - Enselic:mirror, r=lcnr
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.
2 parents 6896fdc + 165f37e commit 551c58c

File tree

1 file changed

+8
-0
lines changed
  • compiler/rustc_mir_build/src/thir/cx

1 file changed

+8
-0
lines changed

compiler/rustc_mir_build/src/thir/cx/expr.rs

+8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ use crate::thir::cx::Cx;
2525
use crate::thir::util::UserAnnotatedTyHelpers;
2626

2727
impl<'tcx> Cx<'tcx> {
28+
/// Create a THIR expression for the given HIR expression. This expands all
29+
/// adjustments and directly adds the type information from the
30+
/// `typeck_results`. See the [dev-guide] for more details.
31+
///
32+
/// (The term "mirror" in this case does not refer to "flipped" or
33+
/// "reversed".)
34+
///
35+
/// [dev-guide]: https://rustc-dev-guide.rust-lang.org/thir.html
2836
pub(crate) fn mirror_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) -> ExprId {
2937
// `mirror_expr` is recursing very deep. Make sure the stack doesn't overflow.
3038
ensure_sufficient_stack(|| self.mirror_expr_inner(expr))

0 commit comments

Comments
 (0)