Skip to content

Commit 3c56c36

Browse files
committed
fix comment on check_type_tests
1 parent 03bfb0f commit 3c56c36

File tree

1 file changed

+3
-12
lines changed
  • src/librustc_mir/borrow_check/nll/region_infer

1 file changed

+3
-12
lines changed

src/librustc_mir/borrow_check/nll/region_infer/mod.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -432,18 +432,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
432432
}
433433

434434
/// Once regions have been propagated, this method is used to see
435-
/// whether any of the constraints were too strong. In particular,
436-
/// we want to check for a case where a universally quantified
437-
/// region exceeded its bounds. Consider:
438-
///
439-
/// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
440-
///
441-
/// In this case, returning `x` requires `&'a u32 <: &'b u32`
442-
/// and hence we establish (transitively) a constraint that
443-
/// `'a: 'b`. The `propagate_constraints` code above will
444-
/// therefore add `end('a)` into the region for `'b` -- but we
445-
/// have no evidence that `'b` outlives `'a`, so we want to report
446-
/// an error.
435+
/// whether the "type tests" produced by typeck were satisfied;
436+
/// type tests encode type-outlives relationships like `T:
437+
/// 'a`. See `TypeTest` for more details.
447438
fn check_type_tests<'gcx>(
448439
&self,
449440
infcx: &InferCtxt<'_, 'gcx, 'tcx>,

0 commit comments

Comments
 (0)