diff --git a/src/librustc_passes/region.rs b/src/librustc_passes/region.rs index b828e014cfc9..7630e3e8950c 100644 --- a/src/librustc_passes/region.rs +++ b/src/librustc_passes/region.rs @@ -512,6 +512,7 @@ fn resolve_local<'tcx>( /// Returns `true` if `pat` match the `P&` non-terminal. /// + /// ```text /// P& = ref X /// | StructName { ..., P&, ... } /// | VariantName(..., P&, ...) @@ -519,6 +520,7 @@ fn resolve_local<'tcx>( /// | ( ..., P&, ... ) /// | ... "|" P& "|" ... /// | box P& + /// ``` fn is_binding_pat(pat: &hir::Pat<'_>) -> bool { // Note that the code below looks for *explicit* refs only, that is, it won't // know about *implicit* refs as introduced in #42640. @@ -575,6 +577,7 @@ fn resolve_local<'tcx>( /// If `expr` matches the `E&` grammar, then records an extended rvalue scope as appropriate: /// + /// ```text /// E& = & ET /// | StructName { ..., f: E&, ... } /// | [ ..., E&, ... ] @@ -583,6 +586,7 @@ fn resolve_local<'tcx>( /// | box E& /// | E& as ... /// | ( E& ) + /// ``` fn record_rvalue_scope_if_borrow_expr<'tcx>( visitor: &mut RegionResolutionVisitor<'tcx>, expr: &hir::Expr<'_>, @@ -623,11 +627,13 @@ fn resolve_local<'tcx>( /// More formally, if `expr` matches the grammar `ET`, record the rvalue scope of the matching /// `` as `blk_id`: /// + /// ```text /// ET = *ET /// | ET[...] /// | ET.f /// | (ET) /// | + /// ``` /// /// Note: ET is intended to match "rvalues or places based on rvalues". fn record_rvalue_scope<'tcx>(