@@ -436,14 +436,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
436
436
/// minimum values.
437
437
///
438
438
/// For example:
439
- ///
440
- /// fn foo<'a, 'b>(.. ) where 'a: 'b
441
- ///
439
+ /// ```
440
+ /// fn foo<'a, 'b>( /* ... */ ) where 'a: 'b { /* ... */ }
441
+ /// ```
442
442
/// 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
+ /// ```
447
447
/// Here, R0 represents `'a`, and it contains (a) the entire CFG
448
448
/// and (b) any universally quantified regions that it outlives,
449
449
/// which in this case is just itself. R1 (`'b`) in contrast also
@@ -1310,9 +1310,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1310
1310
/// whether any of the constraints were too strong. In particular,
1311
1311
/// we want to check for a case where a universally quantified
1312
1312
/// 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
+ /// ```
1316
1316
/// In this case, returning `x` requires `&'a u32 <: &'b u32`
1317
1317
/// and hence we establish (transitively) a constraint that
1318
1318
/// `'a: 'b`. The `propagate_constraints` code above will
@@ -1366,9 +1366,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1366
1366
/// <https://smallcultfollowing.com/babysteps/blog/2019/01/17/polonius-and-region-errors/>
1367
1367
///
1368
1368
/// 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
+ /// ```
1372
1372
/// returning `x` requires `&'a u32 <: &'b u32` and hence we establish (transitively) a
1373
1373
/// constraint that `'a: 'b`. It is an error that we have no evidence that this
1374
1374
/// constraint holds.
0 commit comments