]> git.lizzy.rs Git - rust.git/commitdiff
connect NLL machinery to the `NiceRegionError` code
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 12 Dec 2017 14:06:35 +0000 (09:06 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 20 Dec 2017 19:38:12 +0000 (14:38 -0500)
43 files changed:
src/librustc/infer/error_reporting/mod.rs
src/librustc_mir/borrow_check/nll/region_infer/mod.rs
src/librustc_mir/borrow_check/nll/universal_regions.rs
src/test/compile-fail/mir_check_cast_reify.rs
src/test/compile-fail/mir_check_cast_unsafe_fn.rs
src/test/compile-fail/mir_check_cast_unsize.rs
src/test/compile-fail/nll/where_clauses_in_functions.rs
src/test/compile-fail/nll/where_clauses_in_structs.rs
src/test/compile-fail/regions-static-bound.rs
src/test/ui/nll/closure-requirements/escape-argument-callee.rs
src/test/ui/nll/closure-requirements/escape-argument-callee.stderr
src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs
src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr
src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs
src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr
src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs
src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs
src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs
src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr
src/test/ui/nll/closure-requirements/propagate-approximated-val.rs
src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr
src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs
src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr
src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs
src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr
src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs
src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.stderr
src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs
src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.stderr
src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.stderr
src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs
src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr
src/test/ui/nll/ty-outlives/impl-trait-captures.rs
src/test/ui/nll/ty-outlives/impl-trait-captures.stderr
src/test/ui/nll/ty-outlives/projection-one-region-closure.rs
src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr
src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs
src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs
src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr

index aabe405768578c90562e9232b01eb32b333d435a..1d5ecd1483a2309b9baeedd95bb85fb7817add17 100644 (file)
@@ -78,7 +78,7 @@
 
 mod need_type_info;
 
-mod nice_region_error;
+pub mod nice_region_error;
 
 impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
     pub fn note_and_explain_region(self,
index 5e921cc330d8bf3504248cdbbdab98fcd09875a2..a6fcbdea959c19e96887556a01ee7817049888a1 100644 (file)
 use rustc::infer::RegionObligation;
 use rustc::infer::RegionVariableOrigin;
 use rustc::infer::SubregionOrigin;
+use rustc::infer::error_reporting::nice_region_error::NiceRegionError;
 use rustc::infer::region_constraints::{GenericKind, VarOrigins};
 use rustc::mir::{ClosureOutlivesRequirement, ClosureOutlivesSubject, ClosureRegionRequirements,
                  Local, Location, Mir};
 use rustc::traits::ObligationCause;
 use rustc::ty::{self, RegionVid, Ty, TypeFoldable};
+use rustc::util::common::ErrorReported;
 use rustc_data_structures::indexed_vec::IndexVec;
 use rustc_errors::DiagnosticBuilder;
 use std::fmt;
@@ -230,7 +232,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
     /// `num_region_variables` valid inference variables; the first N
     /// of those will be constant regions representing the free
     /// regions defined in `universal_regions`.
-    pub fn new(
+    pub(crate) fn new(
         var_origins: VarOrigins,
         universal_regions: UniversalRegions<'tcx>,
         mir: &Mir<'tcx>,
@@ -430,7 +432,7 @@ pub(super) fn solve<'gcx>(
 
         self.check_type_tests(infcx, mir, outlives_requirements.as_mut());
 
-        self.check_universal_regions(infcx, mir, outlives_requirements.as_mut());
+        self.check_universal_regions(infcx, mir, mir_def_id, outlives_requirements.as_mut());
 
         let outlives_requirements = outlives_requirements.unwrap_or(vec![]);
 
@@ -807,6 +809,7 @@ fn check_universal_regions<'gcx>(
         &self,
         infcx: &InferCtxt<'_, 'gcx, 'tcx>,
         mir: &Mir<'tcx>,
+        mir_def_id: DefId,
         mut propagated_outlives_requirements: Option<&mut Vec<ClosureOutlivesRequirement<'gcx>>>,
     ) {
         // The universal regions are always found in a prefix of the
@@ -819,7 +822,13 @@ fn check_universal_regions<'gcx>(
         // they did not grow too large, accumulating any requirements
         // for our caller into the `outlives_requirements` vector.
         for (fr, _) in universal_definitions {
-            self.check_universal_region(infcx, mir, fr, &mut propagated_outlives_requirements);
+            self.check_universal_region(
+                infcx,
+                mir,
+                mir_def_id,
+                fr,
+                &mut propagated_outlives_requirements,
+            );
         }
     }
 
@@ -835,6 +844,7 @@ fn check_universal_region<'gcx>(
         &self,
         infcx: &InferCtxt<'_, 'gcx, 'tcx>,
         mir: &Mir<'tcx>,
+        mir_def_id: DefId,
         longer_fr: RegionVid,
         propagated_outlives_requirements: &mut Option<&mut Vec<ClosureOutlivesRequirement<'gcx>>>,
     ) {
@@ -891,7 +901,7 @@ fn check_universal_region<'gcx>(
             // Note: in this case, we use the unapproximated regions
             // to report the error. This gives better error messages
             // in some cases.
-            self.report_error(infcx, mir, longer_fr, shorter_fr, blame_span);
+            self.report_error(infcx, mir, mir_def_id, longer_fr, shorter_fr, blame_span);
         }
     }
 
@@ -907,18 +917,30 @@ fn report_error(
         &self,
         infcx: &InferCtxt<'_, '_, 'tcx>,
         mir: &Mir<'tcx>,
+        mir_def_id: DefId,
         fr: RegionVid,
         outlived_fr: RegionVid,
         blame_span: Span,
     ) {
         // Obviously uncool error reporting.
 
-        let fr_string = match self.definitions[fr].external_name {
+        let fr_name = self.definitions[fr].external_name;
+        let outlived_fr_name = self.definitions[outlived_fr].external_name;
+
+        if let (Some(f), Some(o)) = (fr_name, outlived_fr_name) {
+            let tables = infcx.tcx.typeck_tables_of(mir_def_id);
+            let nice = NiceRegionError::new(infcx.tcx, blame_span, o, f, Some(tables));
+            if let Some(ErrorReported) = nice.try_report() {
+                return;
+            }
+        }
+
+        let fr_string = match fr_name {
             Some(r) => format!("free region `{}`", r),
             None => format!("free region `{:?}`", fr),
         };
 
-        let outlived_fr_string = match self.definitions[outlived_fr].external_name {
+        let outlived_fr_string = match outlived_fr_name {
             Some(r) => format!("free region `{}`", r),
             None => format!("free region `{:?}`", outlived_fr),
         };
index 6eca1b0a14609560fd131ed549f41cb7e60186fe..45604d52958c185f7535ab98a4bc3ebd00ad0d91 100644 (file)
@@ -445,7 +445,7 @@ fn build(mut self) -> UniversalRegions<'tcx> {
         let defining_ty = self.defining_ty();
         debug!("build: defining_ty={:?}", defining_ty);
 
-        let indices = self.compute_indices(fr_static, defining_ty);
+        let mut indices = self.compute_indices(fr_static, defining_ty);
         debug!("build: indices={:?}", indices);
 
         let bound_inputs_and_output = self.compute_inputs_and_output(&indices, defining_ty);
@@ -453,8 +453,12 @@ fn build(mut self) -> UniversalRegions<'tcx> {
         // "Liberate" the late-bound regions. These correspond to
         // "local" free regions.
         let first_local_index = self.infcx.num_region_vars();
-        let inputs_and_output = self.infcx
-            .replace_bound_regions_with_nll_infer_vars(FR, &bound_inputs_and_output);
+        let inputs_and_output = self.infcx.replace_bound_regions_with_nll_infer_vars(
+            FR,
+            self.mir_def_id,
+            &bound_inputs_and_output,
+            &mut indices,
+        );
         let fr_fn_body = self.infcx.next_nll_region_var(FR).to_region_vid();
         let num_universals = self.infcx.num_region_vars();
 
@@ -717,7 +721,7 @@ fn relate_universal_regions(&mut self, fr_a: RegionVid, fr_b: RegionVid) {
     }
 }
 
-pub(crate) trait InferCtxtExt<'tcx> {
+trait InferCtxtExt<'tcx> {
     fn replace_free_regions_with_nll_infer_vars<T>(
         &self,
         origin: NLLRegionVariableOrigin,
@@ -729,7 +733,9 @@ fn replace_free_regions_with_nll_infer_vars<T>(
     fn replace_bound_regions_with_nll_infer_vars<T>(
         &self,
         origin: NLLRegionVariableOrigin,
+        all_outlive_scope: DefId,
         value: &ty::Binder<T>,
+        indices: &mut UniversalRegionIndices<'tcx>,
     ) -> T
     where
         T: TypeFoldable<'tcx>;
@@ -752,18 +758,38 @@ fn replace_free_regions_with_nll_infer_vars<T>(
     fn replace_bound_regions_with_nll_infer_vars<T>(
         &self,
         origin: NLLRegionVariableOrigin,
+        all_outlive_scope: DefId,
         value: &ty::Binder<T>,
+        indices: &mut UniversalRegionIndices<'tcx>,
     ) -> T
     where
         T: TypeFoldable<'tcx>,
     {
-        let (value, _map) = self.tcx
-            .replace_late_bound_regions(value, |_br| self.next_nll_region_var(origin));
+        let (value, _map) = self.tcx.replace_late_bound_regions(value, |br| {
+            let liberated_region = self.tcx.mk_region(ty::ReFree(ty::FreeRegion {
+                scope: all_outlive_scope,
+                bound_region: br,
+            }));
+            let region_vid = self.next_nll_region_var(origin);
+            indices.insert_late_bound_region(liberated_region, region_vid.to_region_vid());
+            region_vid
+        });
         value
     }
 }
 
 impl<'tcx> UniversalRegionIndices<'tcx> {
+    /// Initially, the `UniversalRegionIndices` map contains only the
+    /// early-bound regions in scope. Once that is all setup, we come
+    /// in later and instantiate the late-bound regions, and then we
+    /// insert the `ReFree` version of those into the map as
+    /// well. These are used for error reporting.
+    fn insert_late_bound_region(&mut self, r: ty::Region<'tcx>,
+                                vid: ty::RegionVid)
+    {
+        self.indices.insert(r, vid);
+    }
+
     /// Converts `r` into a local inference variable: `r` can either
     /// by a `ReVar` (i.e., already a reference to an inference
     /// variable) or it can be `'static` or some early-bound
index 1736aea2d6de7604aad69d92284f174b46df9b90..f6ad2820d17ce4d6e651eb1a88198e277767a61e 100644 (file)
@@ -45,7 +45,7 @@ fn bar<'a>(x: &'a u32) -> &'static u32 {
     // as part of checking the `ReifyFnPointer`.
     let f: fn(_) -> _ = foo;
     //~^ WARNING not reporting region error due to -Znll
-    //~| ERROR free region `'_#1r` does not outlive free region `'static`
+    //~| ERROR free region `'a` does not outlive free region `'static`
     f(x)
 }
 
index 39eafa10040264f3cdd40fab10b2534085b0c7e8..c9b378dacd540cb7bfd283efbe2d895a1f5f780c 100644 (file)
@@ -17,7 +17,7 @@ fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
     // in `g`. These are related via the `UnsafeFnPointer` cast.
     let g: unsafe fn(_) -> _ = f;
     //~^ WARNING not reporting region error due to -Znll
-    //~| ERROR free region `'_#1r` does not outlive free region `'static`
+    //~| ERROR free region `'a` does not outlive free region `'static`
     unsafe { g(input) }
 }
 
index bc867047ab5b3bf340ca1db95a4178e14ea1973f..1df56793f73bdab5d5c30c07d6b40f56e4253639 100644 (file)
@@ -16,7 +16,7 @@
 use std::fmt::Debug;
 
 fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
-    //~^ ERROR free region `'_#1r` does not outlive free region `'static`
+    //~^ ERROR free region `'a` does not outlive free region `'static`
     x
     //~^ WARNING not reporting region error due to -Znll
 }
index a13360aeca7f505a475028705477d1b5b5e34a14..ecea8756903aeb9f694ef3830f3a1fa7ab20e2ef 100644 (file)
@@ -21,7 +21,7 @@ fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32)
 
 fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
     foo(x, y)
-    //~^ ERROR free region `'_#1r` does not outlive free region `'_#2r`
+    //~^ ERROR lifetime mismatch [E0623]
     //~| WARNING not reporting region error due to -Znll
 }
 
index 0c4fd5dead3f9dc2a5de8ffa23fbddc30c27f2dd..f1a6dc48e13b80ed809652e7cb18c8042626dfcb 100644 (file)
@@ -21,7 +21,7 @@ struct Foo<'a: 'b, 'b> {
 
 fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) {
     Foo { x, y };
-    //~^ ERROR free region `'_#1r` does not outlive free region `'_#2r`
+    //~^ ERROR lifetime mismatch [E0623]
     //~| WARNING not reporting region error due to -Znll
 }
 
index 678da45fce41fc23bc47ddb38242d2de11333bb6..a217cc9ebfa527a70f768f5ca954cf0c16177065 100644 (file)
@@ -24,10 +24,10 @@ fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
 fn error(u: &(), v: &()) {
     static_id(&u); //[ll]~ ERROR cannot infer an appropriate lifetime
     //[nll]~^ WARNING not reporting region error due to -Znll
-    //[nll]~| ERROR free region `'_#1r` does not outlive free region `'static`
+    //[nll]~| ERROR free region `` does not outlive free region `'static`
     static_id_indirect(&v); //[ll]~ ERROR cannot infer an appropriate lifetime
     //[nll]~^ WARNING not reporting region error due to -Znll
-    //[nll]~| ERROR free region `'_#2r` does not outlive free region `'static`
+    //[nll]~| ERROR free region `` does not outlive free region `'static`
 }
 
 fn main() {}
index 1e34aaf1ea03003e92c37f0138ed0c030b7f1be9..41c744fec6e762024430a75c82cc4ed51acc1534 100644 (file)
@@ -34,7 +34,7 @@ fn test() {
     {
         let y = 22;
         let mut closure = expect_sig(|p, y| *p = y);
-        //~^ ERROR free region `'_#4r` does not outlive free region `'_#3r`
+        //~^ ERROR does not outlive free region
         //~| WARNING not reporting region error due to -Znll
         closure(&mut p, &y);
     }
index 2dfafd8f1725b337b9221fd0b70134628ff04560..3bd02f308c883414032ded73ddc542c6d55d1373 100644 (file)
@@ -4,7 +4,7 @@ warning: not reporting region error due to -Znll
 36 |         let mut closure = expect_sig(|p, y| *p = y);
    |                                                  ^
 
-error: free region `'_#4r` does not outlive free region `'_#3r`
+error: free region `ReFree(DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]), BrAnon(3))` does not outlive free region `ReFree(DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]), BrAnon(2))`
   --> $DIR/escape-argument-callee.rs:36:45
    |
 36 |         let mut closure = expect_sig(|p, y| *p = y);
index 50d7877de50d7be23e3cb9b9692fafd0f30ccb17..30a6dfc5b3edd05bf737f99c8b22c69a633f4427 100644 (file)
@@ -54,7 +54,7 @@ fn supply<'a, 'b, 'c>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>, cell_c: Cell
             // Only works if 'x: 'y:
             let p = x.get();
             //~^ WARN not reporting region error due to -Znll
-            //~| ERROR free region `'_#5r` does not outlive free region `'_#6r`
+            //~| ERROR does not outlive free region
             demand_y(x, y, p)
         },
     );
index f90bc7c175a96ba2810d114eb42759770a056938..7e48c0fc5842a14d61e19fc451f91d945256b083 100644 (file)
@@ -4,7 +4,7 @@ warning: not reporting region error due to -Znll
 55 |             let p = x.get();
    |                     ^^^^^^^
 
-error: free region `'_#5r` does not outlive free region `'_#6r`
+error: free region `ReFree(DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]), BrAnon(1))` does not outlive free region `ReFree(DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]), BrAnon(2))`
   --> $DIR/propagate-approximated-fail-no-postdom.rs:55:17
    |
 55 |             let p = x.get();
@@ -17,7 +17,7 @@ note: No external requirements
 54 | |             // Only works if 'x: 'y:
 55 | |             let p = x.get();
 56 | |             //~^ WARN not reporting region error due to -Znll
-57 | |             //~| ERROR free region `'_#5r` does not outlive free region `'_#6r`
+57 | |             //~| ERROR does not outlive free region
 58 | |             demand_y(x, y, p)
 59 | |         },
    | |_________^
index 80a40581b8957c188640c9ef5d0d3f3eba2264d9..91128035f3d95162d81615b188c68c3ecde35611 100644 (file)
@@ -51,7 +51,7 @@ fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u3
 #[rustc_regions]
 fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-        //~^ ERROR free region `'_#1r` does not outlive free region `'_#2r`
+        //~^ ERROR lifetime mismatch
 
         // Only works if 'x: 'y:
         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to -Znll
index 4bae29ad32617128cbfa4b435b72266b83e8aef1..f9a6999243a9c14ec89868a9df6400689bf53783 100644 (file)
@@ -9,7 +9,7 @@ note: External requirements
    |
 53 |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
    |  _______________________________________________^
-54 | |         //~^ ERROR free region `'_#1r` does not outlive free region `'_#2r`
+54 | |         //~^ ERROR lifetime mismatch
 55 | |
 56 | |         // Only works if 'x: 'y:
 57 | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to -Znll
@@ -23,18 +23,22 @@ note: External requirements
    = note: number of external vids: 3
    = note: where '_#1r: '_#2r
 
-error: free region `'_#1r` does not outlive free region `'_#2r`
+error[E0623]: lifetime mismatch
   --> $DIR/propagate-approximated-ref.rs:53:29
    |
+52 | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+   |                                -------                -------
+   |                                |
+   |                                these two types are declared with different lifetimes...
 53 |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-   |                             ^^^^^^^
+   |                             ^^^^^^^ ...but data from `cell_a` flows into `cell_b` here
 
 note: No external requirements
   --> $DIR/propagate-approximated-ref.rs:52:1
    |
 52 | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 53 | |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-54 | |         //~^ ERROR free region `'_#1r` does not outlive free region `'_#2r`
+54 | |         //~^ ERROR lifetime mismatch
 55 | |
 ...  |
 58 | |     });
index 244929d71dba8ed9b81b20dd05c1f3bc25d7f1b2..f210346a82a675b1f9a5062cbd063f320a56306d 100644 (file)
@@ -31,7 +31,7 @@ fn case1() {
     foo(cell, |cell_a, cell_x| {
         //~^ WARNING not reporting region error due to -Znll
         cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
-        //~^ ERROR free region `'_#2r` does not outlive free region `'_#1r`
+        //~^ ERROR does not outlive free region
     })
 }
 
index 45dc5d913ee13f5b9ce5b97f12f4e81cc54fda53..290377996c942a593bf17d08f3de7d50f54cae86 100644 (file)
@@ -4,7 +4,7 @@ warning: not reporting region error due to -Znll
 31 |     foo(cell, |cell_a, cell_x| {
    |     ^^^
 
-error: free region `'_#2r` does not outlive free region `'_#1r`
+error: free region `ReFree(DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]), BrAnon(1))` does not outlive free region `'_#1r`
   --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:9
    |
 33 |         cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
@@ -17,7 +17,7 @@ note: No external requirements
    |  _______________^
 32 | |         //~^ WARNING not reporting region error due to -Znll
 33 | |         cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
-34 | |         //~^ ERROR free region `'_#2r` does not outlive free region `'_#1r`
+34 | |         //~^ ERROR does not outlive free region
 35 | |     })
    | |_____^
    |
index 54007f0191da1f5ba1127806d80353892bc32057..c66472d5ce9b1ec1060843ca0532457e56e61e1c 100644 (file)
@@ -43,7 +43,7 @@ fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u3
 #[rustc_regions]
 fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
-        //~^ ERROR free region `'_#1r` does not outlive free region `ReStatic`
+        //~^ ERROR does not outlive free region
 
         // Only works if 'x: 'y:
         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to -Znll
index 86b9fecb80e2ef989cfd0fa9935cf1030885f3b1..13aedc408cf06ed8ca7e9e8b7d0ef292eef379b9 100644 (file)
@@ -9,7 +9,7 @@ note: External requirements
    |
 45 |       establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
    |  _______________________________________________^
-46 | |         //~^ ERROR free region `'_#1r` does not outlive free region `ReStatic`
+46 | |         //~^ ERROR does not outlive free region
 47 | |
 48 | |         // Only works if 'x: 'y:
 49 | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to -Znll
@@ -23,12 +23,12 @@ note: External requirements
    = note: number of external vids: 2
    = note: where '_#1r: '_#0r
 
-error: free region `'_#1r` does not outlive free region `ReStatic`
+error: free region `ReFree(DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]), BrNamed(crate0:DefIndex(1:16), 'a))` does not outlive free region `ReStatic`
   --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:47
    |
 45 |       establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
    |  _______________________________________________^
-46 | |         //~^ ERROR free region `'_#1r` does not outlive free region `ReStatic`
+46 | |         //~^ ERROR does not outlive free region
 47 | |
 48 | |         // Only works if 'x: 'y:
 49 | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to -Znll
@@ -40,7 +40,7 @@ note: No external requirements
    |
 44 | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 45 | |     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
-46 | |         //~^ ERROR free region `'_#1r` does not outlive free region `ReStatic`
+46 | |         //~^ ERROR does not outlive free region
 47 | |
 ...  |
 50 | |     });
index 68d51e2b7d105f15833592f51e5055b056347f3a..f4011a0e5335e8fdee25a809af6ef98ef133a545 100644 (file)
@@ -46,7 +46,7 @@ fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u3
 #[rustc_regions]
 fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-        //~^ ERROR free region `'_#1r` does not outlive free region `ReStatic`
+        //~^ ERROR does not outlive free region
         // Only works if 'x: 'y:
         demand_y(x, y, x.get())
         //~^ WARNING not reporting region error due to -Znll
index adc6b1ac595e928205ce528bb8d462f183622c4d..947ed650e6bcac055cc7496d60923841452df962 100644 (file)
@@ -9,7 +9,7 @@ note: External requirements
    |
 48 |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
    |  _______________________________________________^
-49 | |         //~^ ERROR free region `'_#1r` does not outlive free region `ReStatic`
+49 | |         //~^ ERROR does not outlive free region
 50 | |         // Only works if 'x: 'y:
 51 | |         demand_y(x, y, x.get())
 52 | |         //~^ WARNING not reporting region error due to -Znll
@@ -23,12 +23,12 @@ note: External requirements
    = note: number of external vids: 3
    = note: where '_#1r: '_#0r
 
-error: free region `'_#1r` does not outlive free region `ReStatic`
+error: free region `ReFree(DefId(0/0:6 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]), BrNamed(crate0:DefIndex(1:16), 'a))` does not outlive free region `ReStatic`
   --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:47
    |
 48 |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
    |  _______________________________________________^
-49 | |         //~^ ERROR free region `'_#1r` does not outlive free region `ReStatic`
+49 | |         //~^ ERROR does not outlive free region
 50 | |         // Only works if 'x: 'y:
 51 | |         demand_y(x, y, x.get())
 52 | |         //~^ WARNING not reporting region error due to -Znll
@@ -40,7 +40,7 @@ note: No external requirements
    |
 47 | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 48 | |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-49 | |         //~^ ERROR free region `'_#1r` does not outlive free region `ReStatic`
+49 | |         //~^ ERROR does not outlive free region
 50 | |         // Only works if 'x: 'y:
 ...  |
 53 | |     });
index b4a759d5e705d24078973eedb3e50115599c8bc3..d163f304ae5b17f2509448dd3f1404e8b2aec70c 100644 (file)
@@ -44,7 +44,7 @@ fn demand_y<'x, 'y>(_outlives1: Cell<&&'x u32>, _outlives2: Cell<&'y &u32>, _y:
 #[rustc_regions]
 fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-        //~^ ERROR free region `'_#1r` does not outlive free region `'_#2r`
+        //~^ ERROR lifetime mismatch
 
         // Only works if 'x: 'y:
         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to -Znll
index 43d61fdf1b5f820bab8cf588d855a3b741715f7b..64766296e65a55388b1fee1cab1e88743a2f955e 100644 (file)
@@ -9,7 +9,7 @@ note: External requirements
    |
 46 |       establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
    |  _____________________________________________^
-47 | |         //~^ ERROR free region `'_#1r` does not outlive free region `'_#2r`
+47 | |         //~^ ERROR lifetime mismatch
 48 | |
 49 | |         // Only works if 'x: 'y:
 50 | |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to -Znll
@@ -23,18 +23,22 @@ note: External requirements
    = note: number of external vids: 3
    = note: where '_#1r: '_#2r
 
-error: free region `'_#1r` does not outlive free region `'_#2r`
+error[E0623]: lifetime mismatch
   --> $DIR/propagate-approximated-val.rs:46:29
    |
+45 | fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+   |                              -------                -------
+   |                              |
+   |                              these two types are declared with different lifetimes...
 46 |     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-   |                             ^^^^^^
+   |                             ^^^^^^ ...but data from `cell_a` flows into `cell_b` here
 
 note: No external requirements
   --> $DIR/propagate-approximated-val.rs:45:1
    |
 45 | / fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 46 | |     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-47 | |         //~^ ERROR free region `'_#1r` does not outlive free region `'_#2r`
+47 | |         //~^ ERROR lifetime mismatch
 48 | |
 ...  |
 51 | |     });
index 4bbdcc4494486040f42bb0e41ccc18f97ce69888..eb512a3b9b1fb13eded1a71570b5c7510a9b82ac 100644 (file)
@@ -46,7 +46,7 @@ fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
         // Only works if 'x: 'y:
         demand_y(x, y, x.get())
         //~^ WARN not reporting region error due to -Znll
-        //~| ERROR free region `'_#6r` does not outlive free region `'_#4r`
+        //~| ERROR does not outlive free region
     });
 }
 
index f3c40c838fb3ede207b78e55e819a78e877a783f..08dcfb042b5f4152f74284d22d27b24effbaeff3 100644 (file)
@@ -4,7 +4,7 @@ warning: not reporting region error due to -Znll
 47 |         demand_y(x, y, x.get())
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
-error: free region `'_#6r` does not outlive free region `'_#4r`
+error: free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(4))` does not outlive free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(2))`
   --> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:47:18
    |
 47 |         demand_y(x, y, x.get())
@@ -18,7 +18,7 @@ note: No external requirements
 46 | |         // Only works if 'x: 'y:
 47 | |         demand_y(x, y, x.get())
 48 | |         //~^ WARN not reporting region error due to -Znll
-49 | |         //~| ERROR free region `'_#6r` does not outlive free region `'_#4r`
+49 | |         //~| ERROR does not outlive free region
 50 | |     });
    | |_____^
    |
index 69fad354792f08775bc1585addd96a8e4988b6af..930742464297202f9abd7f651fa9189c11935d01 100644 (file)
@@ -50,7 +50,7 @@ fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
         // Only works if 'x: 'y:
         demand_y(x, y, x.get())
         //~^ WARN not reporting region error due to -Znll
-        //~| ERROR free region `'_#5r` does not outlive free region `'_#7r`
+        //~| ERROR does not outlive free region
     });
 }
 
index a66c2a7897024bc3d3b961901011df5f508a6bcf..502f56502497046b3488d0558d562ab650c371df 100644 (file)
@@ -4,7 +4,7 @@ warning: not reporting region error due to -Znll
 51 |         demand_y(x, y, x.get())
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
-error: free region `'_#5r` does not outlive free region `'_#7r`
+error: free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(2))` does not outlive free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(4))`
   --> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:18
    |
 51 |         demand_y(x, y, x.get())
@@ -18,7 +18,7 @@ note: No external requirements
 50 | |         // Only works if 'x: 'y:
 51 | |         demand_y(x, y, x.get())
 52 | |         //~^ WARN not reporting region error due to -Znll
-53 | |         //~| ERROR free region `'_#5r` does not outlive free region `'_#7r`
+53 | |         //~| ERROR does not outlive free region
 54 | |     });
    | |_____^
    |
index c61cf8a940f95dcc1361735ae20205126b40a721..3f56dfe5af48dbe9cfd2cc9ecc3c08eeb3d24f4c 100644 (file)
@@ -18,7 +18,7 @@
 fn foo(x: &u32) -> &'static u32 {
     &*x
         //~^ WARN not reporting region error due to -Znll
-        //~| ERROR free region `'_#1r` does not outlive free region `ReStatic`
+        //~| ERROR does not outlive free region
 }
 
 fn main() { }
index ef7ea9239127bccde3aa7500a924c3b43d963e91..6648e38e7dea8c44f21f746feca5a2e298db305c 100644 (file)
@@ -4,7 +4,7 @@ warning: not reporting region error due to -Znll
 19 |     &*x
    |     ^^^
 
-error: free region `'_#1r` does not outlive free region `ReStatic`
+error: free region `ReFree(DefId(0/0:3 ~ region_lbr_anon_does_not_outlive_static[317d]::foo[0]), BrAnon(0))` does not outlive free region `ReStatic`
   --> $DIR/region-lbr-anon-does-not-outlive-static.rs:19:5
    |
 19 |     &*x
index fcda5c5420bfe4a8046f7a66d2eb6060c71b7ad9..a1be8e851851599161c10f5e79b868bede8f43d3 100644 (file)
@@ -18,7 +18,7 @@
 fn foo<'a>(x: &'a u32) -> &'static u32 {
     &*x
         //~^ WARN not reporting region error due to -Znll
-        //~| ERROR free region `'_#1r` does not outlive free region `ReStatic`
+        //~| ERROR does not outlive free region
 }
 
 fn main() { }
index 6dcb8e7cf122d55f6da98b59e850a314c1ef4b41..1edceba7b0916e4c14b8ae12600e0dec1429e47f 100644 (file)
@@ -4,7 +4,7 @@ warning: not reporting region error due to -Znll
 19 |     &*x
    |     ^^^
 
-error: free region `'_#1r` does not outlive free region `ReStatic`
+error: free region `ReFree(DefId(0/0:3 ~ region_lbr_named_does_not_outlive_static[317d]::foo[0]), BrNamed(crate0:DefIndex(1:9), 'a))` does not outlive free region `ReStatic`
   --> $DIR/region-lbr-named-does-not-outlive-static.rs:19:5
    |
 19 |     &*x
index c1e4dee00656ba61dce2d15406add294dfaa37c6..00b09e2ab21ada08e8600b54eb510271993ea1c1 100644 (file)
@@ -18,7 +18,7 @@
 fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
     &*x
         //~^ WARN not reporting region error due to -Znll
-        //~| ERROR free region `'_#1r` does not outlive free region `'_#2r`
+        //~| ERROR lifetime mismatch
 }
 
 fn main() { }
index c1b2f440309497c6d6238af5aae96cb0f56decfe..efe0b73f195a905c8aacc6f3ea76c15d97811807 100644 (file)
@@ -4,11 +4,15 @@ warning: not reporting region error due to -Znll
 19 |     &*x
    |     ^^^
 
-error: free region `'_#1r` does not outlive free region `'_#2r`
+error[E0623]: lifetime mismatch
   --> $DIR/region-lbr1-does-not-outlive-ebr2.rs:19:5
    |
+18 | fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
+   |                   -------                 -------
+   |                   |
+   |                   this parameter and the return type are declared with different lifetimes...
 19 |     &*x
-   |     ^^^
+   |     ^^^ ...but data from `x` is returned here
 
 error: aborting due to previous error
 
index 9314bbf94322256db21fd4c6819c5f039becc649..754df4f2c5db624b95f6dfdab3b49da248635869 100644 (file)
@@ -20,7 +20,7 @@
 fn test() {
     expect_sig(|a, b| b); // ought to return `a`
     //~^ WARN not reporting region error due to -Znll
-    //~| ERROR free region `'_#3r` does not outlive free region `'_#2r`
+    //~| ERROR does not outlive free region
 }
 
 fn expect_sig<F>(f: F) -> F
index cb2b2e2f1186086d58a27833284b1bd684d5a53d..58a26e61e57671ccf12afd159afce367ff81355f 100644 (file)
@@ -4,7 +4,7 @@ warning: not reporting region error due to -Znll
 21 |     expect_sig(|a, b| b); // ought to return `a`
    |                       ^
 
-error: free region `'_#3r` does not outlive free region `'_#2r`
+error: free region `ReFree(DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]), BrAnon(2))` does not outlive free region `ReFree(DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]), BrAnon(1))`
   --> $DIR/return-wrong-bound-region.rs:21:23
    |
 21 |     expect_sig(|a, b| b); // ought to return `a`
@@ -27,7 +27,7 @@ note: No external requirements
 20 | / fn test() {
 21 | |     expect_sig(|a, b| b); // ought to return `a`
 22 | |     //~^ WARN not reporting region error due to -Znll
-23 | |     //~| ERROR free region `'_#3r` does not outlive free region `'_#2r`
+23 | |     //~| ERROR does not outlive free region
 24 | | }
    | |_^
    |
index 896b74b579b60143334620f76f350777e28287d8..850cd1e7336d739fa9df08a06f695f4edaa44e57 100644 (file)
@@ -21,7 +21,7 @@ impl<'a, T> Foo<'a> for T { }
 fn foo<'a, T>(x: &T) -> impl Foo<'a> {
     x
         //~^ WARNING not reporting region error due to -Znll
-        //~| ERROR free region `'_#2r` does not outlive free region `ReEarlyBound(0, 'a)`
+        //~| ERROR explicit lifetime required in the type of `x` [E0621]
 }
 
 fn main() {}
index 7de994dae888d9b1fe1d1f141d46596c4d639833..4cfd12002e79612d1c91fa16690ba579d5f8b9b2 100644 (file)
@@ -4,11 +4,13 @@ warning: not reporting region error due to -Znll
 22 |     x
    |     ^
 
-error: free region `'_#2r` does not outlive free region `ReEarlyBound(0, 'a)`
+error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/impl-trait-captures.rs:22:5
    |
+21 | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
+   |               - consider changing the type of `x` to `&ReEarlyBound(0, 'a) T`
 22 |     x
-   |     ^
+   |     ^ lifetime `ReEarlyBound(0, 'a)` required
 
 error: aborting due to previous error
 
index e2a2d20d77d5c8475089917f56e2705896562846..5d68cc6a7a9fa981c4c81d6f8e25493435a85ad3 100644 (file)
@@ -56,7 +56,7 @@ fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
     with_signature(cell, t, |cell, t| require(cell, t));
     //~^ WARNING not reporting region error due to -Znll
     //~| ERROR `T` does not outlive
-    //~| ERROR free region `ReEarlyBound(0, 'b)` does not outlive free region `'_#2r`
+    //~| ERROR does not outlive free region
 }
 
 #[rustc_regions]
@@ -68,7 +68,7 @@ fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
     with_signature(cell, t, |cell, t| require(cell, t));
     //~^ WARNING not reporting region error due to -Znll
     //~| ERROR `T` does not outlive
-    //~| ERROR free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
+    //~| ERROR does not outlive free region
 }
 
 #[rustc_regions]
index cbd80d70bf95553504b351513166ea2ec6a38bf0..73cfa0d18fa4a2b8ba4ed589bd382ceb2c0a8251 100644 (file)
@@ -89,7 +89,7 @@ error: `T` does not outlive `'_#5r`
 56 |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: free region `ReEarlyBound(0, 'b)` does not outlive free region `'_#2r`
+error: free region `ReEarlyBound(0, 'b)` does not outlive free region `ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:17), 'a))`
   --> $DIR/projection-one-region-closure.rs:56:20
    |
 56 |     with_signature(cell, t, |cell, t| require(cell, t));
@@ -103,7 +103,7 @@ note: No external requirements
 54 | |     T: Anything<'b>,
 55 | | {
 ...  |
-59 | |     //~| ERROR free region `ReEarlyBound(0, 'b)` does not outlive free region `'_#2r`
+59 | |     //~| ERROR does not outlive free region
 60 | | }
    | |_^
    |
@@ -132,7 +132,7 @@ note: No external requirements
 65 | |     T: Anything<'b>,
 66 | |     'a: 'a,
 ...  |
-71 | |     //~| ERROR free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
+71 | |     //~| ERROR does not outlive free region
 72 | | }
    | |_^
    |
index e179927dfb0b9f05b5033d5142e29d73de54d36e..232025b57355cf98f5037d52e371b6e1e1358f90 100644 (file)
@@ -47,7 +47,7 @@ fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 {
     with_signature(cell, t, |cell, t| require(cell, t));
     //~^ WARNING not reporting region error due to -Znll
-    //~| ERROR free region `ReEarlyBound(0, 'b)` does not outlive free region `'_#2r`
+    //~| ERROR does not outlive free region
 }
 
 #[rustc_regions]
@@ -58,7 +58,7 @@ fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 {
     with_signature(cell, t, |cell, t| require(cell, t));
     //~^ WARNING not reporting region error due to -Znll
-    //~| ERROR free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
+    //~| ERROR does not outlive free region
 }
 
 #[rustc_regions]
@@ -79,7 +79,7 @@ fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 
     with_signature(cell, t, |cell, t| require(cell, t));
     //~^ WARNING not reporting region error due to -Znll
-    //~| ERROR free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
+    //~| ERROR does not outlive free region
 }
 
 #[rustc_regions]
index 1088ae846fee54073aa815db2f3387dd75fb75ae..5053b8486959a4cb8f2bc8d49f35629f6feef2c6 100644 (file)
@@ -94,7 +94,7 @@ note: External requirements
     = note: number of external vids: 3
     = note: where '_#1r: '_#2r
 
-error: free region `ReEarlyBound(0, 'b)` does not outlive free region `'_#2r`
+error: free region `ReEarlyBound(0, 'b)` does not outlive free region `ReFree(DefId(0/0:8 ~ projection_one_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:17), 'a))`
   --> $DIR/projection-one-region-trait-bound-closure.rs:48:20
    |
 48 |     with_signature(cell, t, |cell, t| require(cell, t));
@@ -108,7 +108,7 @@ note: No external requirements
 46 | |     T: Anything<'b>,
 47 | | {
 ...  |
-50 | |     //~| ERROR free region `ReEarlyBound(0, 'b)` does not outlive free region `'_#2r`
+50 | |     //~| ERROR does not outlive free region
 51 | | }
    | |_^
    |
@@ -131,7 +131,7 @@ note: No external requirements
 56 | |     T: Anything<'b>,
 57 | |     'a: 'a,
 ...  |
-61 | |     //~| ERROR free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
+61 | |     //~| ERROR does not outlive free region
 62 | | }
    | |_^
    |
@@ -155,7 +155,7 @@ note: No external requirements
 67 | |     T: Anything<'b>,
 68 | |     T::AssocType: 'a,
 ...  |
-82 | |     //~| ERROR free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
+82 | |     //~| ERROR does not outlive free region
 83 | | }
    | |_^
    |
index 42bfdfcf9f91b8684b6a5c455632e089c2b379d1..e129ac146fcf3b2c4e69d796859afcc9e857e8c7 100644 (file)
@@ -108,7 +108,7 @@ fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 {
     with_signature(cell, t, |cell, t| require(cell, t));
     //~^ WARNING not reporting region error due to -Znll
-    //~| ERROR free region `ReEarlyBound(0, 'b)` does not outlive free region `'_#2r`
+    //~| ERROR does not outlive free region
 }
 
 #[rustc_regions]
index 5b708a0d7e6297d70f46f3c907e0b285f962a4ac..b26cf2ca4cb288fe13f711ae3d7c895fb177eca2 100644 (file)
@@ -264,7 +264,7 @@ note: No external requirements
                 T
             ]
 
-error: free region `ReEarlyBound(0, 'b)` does not outlive free region `'_#2r`
+error: free region `ReEarlyBound(0, 'b)` does not outlive free region `ReFree(DefId(0/0:13 ~ projection_two_region_trait_bound_closure[317d]::two_regions[0]), BrNamed(crate0:DefIndex(1:44), 'a))`
    --> $DIR/projection-two-region-trait-bound-closure.rs:109:20
     |
 109 |     with_signature(cell, t, |cell, t| require(cell, t));
@@ -278,7 +278,7 @@ note: No external requirements
 107 | |     T: Anything<'b, 'b>,
 108 | | {
 ...   |
-111 | |     //~| ERROR free region `ReEarlyBound(0, 'b)` does not outlive free region `'_#2r`
+111 | |     //~| ERROR does not outlive free region
 112 | | }
     | |_^
     |