@@ -436,14 +436,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
436436 /// minimum values.
437437 ///
438438 /// For example:
439- ///
440- /// fn foo<'a, 'b>(.. ) where 'a: 'b
441- ///
439+ /// ```
440+ /// fn foo<'a, 'b>( /* ... */ ) where 'a: 'b { /* ... */ }
441+ /// ```
442442 /// would initialize two variables like so:
443- ///
444- /// R0 = { CFG, R0 } // 'a
445- /// R1 = { CFG, R0, R1 } // 'b
446- ///
443+ /// ```ignore (illustrative)
444+ /// R0 = { CFG, R0 } // 'a
445+ /// R1 = { CFG, R0, R1 } // 'b
446+ /// ```
447447 /// Here, R0 represents `'a`, and it contains (a) the entire CFG
448448 /// and (b) any universally quantified regions that it outlives,
449449 /// which in this case is just itself. R1 (`'b`) in contrast also
@@ -1310,9 +1310,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
13101310 /// whether any of the constraints were too strong. In particular,
13111311 /// we want to check for a case where a universally quantified
13121312 /// region exceeded its bounds. Consider:
1313- ///
1314- /// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
1315- ///
1313+ /// ```compile_fail,E0312
1314+ /// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
1315+ /// ```
13161316 /// In this case, returning `x` requires `&'a u32 <: &'b u32`
13171317 /// and hence we establish (transitively) a constraint that
13181318 /// `'a: 'b`. The `propagate_constraints` code above will
@@ -1366,9 +1366,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
13661366 /// <https://smallcultfollowing.com/babysteps/blog/2019/01/17/polonius-and-region-errors/>
13671367 ///
13681368 /// In the canonical example
1369- ///
1370- /// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
1371- ///
1369+ /// ```compile_fail,E0312
1370+ /// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
1371+ /// ```
13721372 /// returning `x` requires `&'a u32 <: &'b u32` and hence we establish (transitively) a
13731373 /// constraint that `'a: 'b`. It is an error that we have no evidence that this
13741374 /// constraint holds.
0 commit comments