]> git.lizzy.rs Git - rust.git/commitdiff
fix comment on `check_type_tests`
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 19 Dec 2017 09:21:57 +0000 (04:21 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 19 Dec 2017 09:21:57 +0000 (04:21 -0500)
src/librustc_mir/borrow_check/nll/region_infer/mod.rs

index e2a36e6863ee24647f04f713282f5238c7a73b64..58e16e7673afc75f11eaee271958b6740d287c3d 100644 (file)
@@ -432,18 +432,9 @@ fn propagate_constraints(&mut self, mir: &Mir<'tcx>) {
     }
 
     /// Once regions have been propagated, this method is used to see
-    /// whether any of the constraints were too strong. In particular,
-    /// we want to check for a case where a universally quantified
-    /// region exceeded its bounds.  Consider:
-    ///
-    ///     fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
-    ///
-    /// In this case, returning `x` requires `&'a u32 <: &'b u32`
-    /// and hence we establish (transitively) a constraint that
-    /// `'a: 'b`. The `propagate_constraints` code above will
-    /// therefore add `end('a)` into the region for `'b` -- but we
-    /// have no evidence that `'b` outlives `'a`, so we want to report
-    /// an error.
+    /// whether the "type tests" produced by typeck were satisfied;
+    /// type tests encode type-outlives relationships like `T:
+    /// 'a`. See `TypeTest` for more details.
     fn check_type_tests<'gcx>(
         &self,
         infcx: &InferCtxt<'_, 'gcx, 'tcx>,