Skip to content

Commit 92fc085

Browse files
committed
More comments for lower_inline_const
1 parent c3eea53 commit 92fc085

File tree

1 file changed

+4
-1
lines changed
  • compiler/rustc_mir_build/src/thir/pattern

1 file changed

+4
-1
lines changed

compiler/rustc_mir_build/src/thir/pattern/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
688688
pattern
689689
}
690690

691-
/// Converts inline const patterns.
691+
/// Lowers an inline const block (e.g. `const { 1 + 1 }`) to a pattern.
692692
fn lower_inline_const(
693693
&mut self,
694694
block: &'tcx hir::ConstBlock,
@@ -708,6 +708,9 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
708708

709709
let ct = ty::UnevaluatedConst { def: def_id.to_def_id(), args };
710710
let subpattern = self.const_to_pat(ty::Const::new_unevaluated(self.tcx, ct), ty, id, span);
711+
712+
// Wrap the pattern in a marker node to indicate that it is the result
713+
// of lowering an inline const block.
711714
PatKind::ExpandedConstant { subpattern, def_id: def_id.to_def_id(), is_inline: true }
712715
}
713716

0 commit comments

Comments
 (0)