]> git.lizzy.rs Git - rust.git/commitdiff
Region inference error messages no longer start with 'free region'
authorDavid Wood <david@davidtw.co>
Thu, 26 Jul 2018 13:36:41 +0000 (15:36 +0200)
committerDavid Wood <david@davidtw.co>
Fri, 27 Jul 2018 11:14:56 +0000 (13:14 +0200)
src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr
src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr
src/test/ui/issue-10291.nll.stderr
src/test/ui/issue-40510-3.nll.stderr
src/test/ui/issue-52213.nll.stderr
src/test/ui/nll/closure-requirements/escape-argument-callee.stderr
src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.stderr

index c88259d5e8fe34455d9ceae4ca651edd82de82e0..c2c5c6771b01fd76d0524ac9adb314869dc9e8ea 100644 (file)
@@ -39,12 +39,13 @@ enum ConstraintCategory {
 
 impl fmt::Display for ConstraintCategory {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        // Must end with a space. Allows for empty names to be provided.
         match self {
-            ConstraintCategory::Assignment => write!(f, "assignment"),
-            ConstraintCategory::Return => write!(f, "return"),
-            ConstraintCategory::Cast => write!(f, "cast"),
-            ConstraintCategory::CallArgument => write!(f, "argument"),
-            _ => write!(f, "free region"),
+            ConstraintCategory::Assignment => write!(f, "assignment "),
+            ConstraintCategory::Return => write!(f, "return "),
+            ConstraintCategory::Cast => write!(f, "cast "),
+            ConstraintCategory::CallArgument => write!(f, "argument "),
+            _ => write!(f, ""),
         }
     }
 }
@@ -421,7 +422,7 @@ fn report_general_error(
             },
             _ => {
                 diag.span_label(span, format!(
-                    "{} requires that `{}` must outlive `{}`",
+                    "{}requires that `{}` must outlive `{}`",
                     category, fr_name, outlived_fr_name,
                 ));
             },
index 14d889dca73dfc4fe1b7a480d5754614df469f94..0ac295c54bccbb34ae8206916228d87fbd2e51f0 100644 (file)
@@ -10,7 +10,7 @@ error: unsatisfied lifetime constraints
 LL |     invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
    |                ----------^^^^^-----------------
    |                |   |     |
-   |                |   |     free region requires that `'1` must outlive `'2`
+   |                |   |     requires that `'1` must outlive `'2`
    |                |   has type `&'1 i32`
    |                lifetime `'2` appears in return type
 
index 123a93636d237e36e85b3367cc78890161199025..bbc63e6fecaf5c7b790f1c9bf64e2a0720d98e61 100644 (file)
@@ -16,13 +16,13 @@ error: unsatisfied lifetime constraints
 LL |     fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
    |                         - let's call the lifetime of this reference `'1`
 LL |         self.x.iter().map(|a| a.0)
-   |         ^^^^^^^^^^^^^ free region requires that `'1` must outlive `'static`
+   |         ^^^^^^^^^^^^^ requires that `'1` must outlive `'static`
 
 error: unsatisfied lifetime constraints
   --> $DIR/static-return-lifetime-infered.rs:21:9
    |
 LL |         self.x.iter().map(|a| a.0)
-   |         ^^^^^^^^^^^^^ free region requires that `'a` must outlive `'static`
+   |         ^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
 
 error: aborting due to 2 previous errors
 
index 1358fe010b443c5d8a607c5a908973e41adc9cc7..6de00ffd48cc1ddd230c715d4c922ed6cae74491 100644 (file)
@@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints
   --> $DIR/issue-10291.rs:12:5
    |
 LL |     drop::<Box<for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ free region requires that `'x` must outlive `'static`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'x` must outlive `'static`
 
 error: aborting due to previous error
 
index 4133c69f031a563c21d09925871bcd747600dd92..eb44850e639abbf3d683bd1fde79402f3a51b942 100644 (file)
@@ -9,7 +9,7 @@ LL |  ||         || {
    |  ||_________^
 LL | |||             x.push(())
 LL | |||         }
-   | |||_________^ free region requires that `'1` must outlive `'2`
+   | |||_________^ requires that `'1` must outlive `'2`
 LL |  ||     };
    |  ||     -
    |  ||_____|
index c288cf9ed820c8dc2f8baf8034570d49847d8214..7dd513d1b712c2e31fd8a016664b021fb3ff114c 100644 (file)
@@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints
   --> $DIR/issue-52213.rs:13:11
    |
 LL |         ((u,),) => u,
-   |           ^ free region requires that `'a` must outlive `'b`
+   |           ^ requires that `'a` must outlive `'b`
 
 error: aborting due to previous error
 
index 99da2141ce91ac8d84b26ee63e0398c85cdeb9fa..ccf116e640d429ec4fed4e09a447664a93a65af5 100644 (file)
@@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints
   --> $DIR/escape-argument-callee.rs:36:45
    |
 LL |         let mut closure = expect_sig(|p, y| *p = y);
-   |                                       -  -  ^^^^^^ free region requires that `'1` must outlive `'2`
+   |                                       -  -  ^^^^^^ requires that `'1` must outlive `'2`
    |                                       |  |
    |                                       |  has type `&'1 i32`
    |                                       has type `&mut &'2 i32`
index d012dca25271c62af9e2a6ccd4fbfac91dd8bf9a..b0562711627387d59157493727b9bfe0681f784d 100644 (file)
@@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints
   --> $DIR/region-lbr-named-does-not-outlive-static.rs:19:5
    |
 LL |     &*x
-   |     ^^^ free region requires that `'a` must outlive `'static`
+   |     ^^^ requires that `'a` must outlive `'static`
 
 error: aborting due to previous error