]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #53134 - alexcrichton:tweak-travis, r=Mark-Simulacrum
authorbors <bors@rust-lang.org>
Tue, 7 Aug 2018 00:07:56 +0000 (00:07 +0000)
committerbors <bors@rust-lang.org>
Tue, 7 Aug 2018 00:07:56 +0000 (00:07 +0000)
More debugging for travis shutting down

Requested by Travis!

74 files changed:
src/librustc/hir/lowering.rs
src/librustc/infer/error_reporting/nice_region_error/mod.rs
src/librustc/lib.rs
src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
src/libsyntax/feature_gate.rs
src/test/compile-fail/nll/where_clauses_in_functions.rs
src/test/compile-fail/nll/where_clauses_in_structs.rs
src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.rs [new file with mode: 0644]
src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.stderr [new file with mode: 0644]
src/test/ui/feature-gate-impl_header_lifetime_elision.rs [new file with mode: 0644]
src/test/ui/feature-gate-impl_header_lifetime_elision.stderr [new file with mode: 0644]
src/test/ui/feature-gate-in_band_lifetimes-impl.rs [deleted file]
src/test/ui/feature-gate-in_band_lifetimes-impl.stderr [deleted file]
src/test/ui/feature-gate-in_band_lifetimes.rs
src/test/ui/feature-gate-in_band_lifetimes.stderr
src/test/ui/impl-header-lifetime-elision/assoc-type.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/assoc-type.stderr [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/dyn-trait.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/path-elided.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/path-elided.stderr [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/path-underscore.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/ref-underscore.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/trait-elided.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/trait-elided.stderr [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/trait-underscore.rs [new file with mode: 0644]
src/test/ui/in-band-lifetimes/impl/assoc-type.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/assoc-type.stderr [deleted file]
src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr [deleted file]
src/test/ui/in-band-lifetimes/impl/dyn-trait.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr [deleted file]
src/test/ui/in-band-lifetimes/impl/path-elided.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/path-elided.stderr [deleted file]
src/test/ui/in-band-lifetimes/impl/path-underscore.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/ref-underscore.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/trait-elided.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/trait-elided.stderr [deleted file]
src/test/ui/in-band-lifetimes/impl/trait-underscore.rs [deleted file]
src/test/ui/in-band-lifetimes/mismatched.nll.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr
src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr
src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr
src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.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-val.rs
src/test/ui/nll/closure-requirements/propagate-approximated-val.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/issue-52113.rs
src/test/ui/nll/issue-52113.stderr

index 4b69e3b6bc70db8d0db5ba99597f68e0b9f649d6..0cc5d3034e0a6c7e8e6fc957c840f87dcafcd4a5 100644 (file)
@@ -123,8 +123,8 @@ pub struct LoweringContext<'a> {
     // Whether or not in-band lifetimes are being collected. This is used to
     // indicate whether or not we're in a place where new lifetimes will result
     // in in-band lifetime definitions, such a function or an impl header.
-    // This will always be false unless the `in_band_lifetimes` feature is
-    // enabled.
+    // This will always be false unless the `in_band_lifetimes` or
+    // `impl_header_lifetime_elision` feature is enabled.
     is_collecting_in_band_lifetimes: bool,
 
     // Currently in-scope lifetimes defined in impl headers, fn headers, or HRTB.
@@ -658,9 +658,11 @@ fn collect_in_band_defs<T, F>(
         assert!(self.lifetimes_to_define.is_empty());
         let old_anonymous_lifetime_mode = self.anonymous_lifetime_mode;
 
-        self.is_collecting_in_band_lifetimes = self.sess.features_untracked().in_band_lifetimes;
-        if self.is_collecting_in_band_lifetimes {
+        if self.sess.features_untracked().impl_header_lifetime_elision {
             self.anonymous_lifetime_mode = anonymous_lifetime_mode;
+            self.is_collecting_in_band_lifetimes = true;
+        } else if self.sess.features_untracked().in_band_lifetimes {
+            self.is_collecting_in_band_lifetimes = true;
         }
 
         let (in_band_ty_params, res) = f(self);
@@ -718,6 +720,10 @@ fn maybe_collect_in_band_lifetime(&mut self, ident: Ident) {
             return;
         }
 
+        if !self.sess.features_untracked().in_band_lifetimes {
+            return;
+        }
+
         if self.in_scope_lifetimes.contains(&ident.modern()) {
             return;
         }
index f50c23b0aa75209e498c70f3d2df5ddb2d546a9b..ddeb291a13aa32b2a82a233387db7cdca51e903a 100644 (file)
@@ -64,6 +64,12 @@ pub fn new_from_span(
         Self { tcx, error: None, regions: Some((span, sub, sup)), tables }
     }
 
+    pub fn try_report_from_nll(&self) -> Option<ErrorReported> {
+        // Due to the improved diagnostics returned by the MIR borrow checker, only a subset of
+        // the nice region errors are required when running under the MIR borrow checker.
+        self.try_report_named_anon_conflict()
+    }
+
     pub fn try_report(&self) -> Option<ErrorReported> {
         self.try_report_named_anon_conflict()
             .or_else(|| self.try_report_anon_anon_conflict())
index a5913467b80db48370bbaa044ebe4fcaadc5c290..804481846afdcc63ac03421febfa6cc1f816ad16 100644 (file)
@@ -68,6 +68,7 @@
 #![feature(step_trait)]
 #![feature(integer_atomics)]
 #![feature(test)]
+#![cfg_attr(not(stage0), feature(impl_header_lifetime_elision))]
 #![feature(in_band_lifetimes)]
 #![feature(macro_at_most_once_rep)]
 #![feature(crate_in_paths)]
index 8fbb4aafc1f67d2ad37e81cf456cfa57040c0833..c2670389e2d69cbccb05edb051cd032bb88b0692 100644 (file)
@@ -310,7 +310,7 @@ pub(super) fn report_error(
         if let (Some(f), Some(o)) = (self.to_error_region(fr), self.to_error_region(outlived_fr)) {
             let tables = infcx.tcx.typeck_tables_of(mir_def_id);
             let nice = NiceRegionError::new_from_span(infcx.tcx, span, o, f, Some(tables));
-            if let Some(_error_reported) = nice.try_report() {
+            if let Some(_error_reported) = nice.try_report_from_nll() {
                 return;
             }
         }
index 193e560893f37455e45f055e77bb9a28912d0842..a3822a4a1f93b1c8ee522d19474855879f2be112 100644 (file)
@@ -380,7 +380,7 @@ pub fn use_extern_macros(&self) -> bool {
     (active, crate_in_paths, "1.23.0", Some(45477), Some(Edition::Edition2018)),
 
     // In-band lifetime bindings (e.g. `fn foo(x: &'a u8) -> &'a u8`)
-    (active, in_band_lifetimes, "1.23.0", Some(44524), Some(Edition::Edition2018)),
+    (active, in_band_lifetimes, "1.23.0", Some(44524), None),
 
     // generic associated types (RFC 1598)
     (active, generic_associated_types, "1.23.0", Some(44265), None),
@@ -481,6 +481,10 @@ pub fn use_extern_macros(&self) -> bool {
     (active, alloc_error_handler, "1.29.0", Some(51540), None),
 
     (active, abi_amdgpu_kernel, "1.29.0", Some(51575), None),
+
+    // impl<I:Iterator> Iterator for &mut Iterator
+    // impl Debug for Foo<'_>
+    (active, impl_header_lifetime_elision, "1.30.0", Some(15872), Some(Edition::Edition2018)),
 );
 
 declare_features! (
index 1a3dc76005db4629f86595c575aef3e1e5641b04..0efdd19df3c884e4def262a3f6047630e0a79b51 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 lifetime mismatch [E0623]
+    //~^ ERROR unsatisfied lifetime constraints
     //~| WARNING not reporting region error due to nll
 }
 
index 69f0f43af13425af0d5942286d4cefc3d1806a51..92e7db861734432398c73f28dd6b07091608b479 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 lifetime mismatch [E0623]
+    //~^ ERROR unsatisfied lifetime constraints
     //~| WARNING not reporting region error due to nll
 }
 
diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.rs b/src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.rs
new file mode 100644 (file)
index 0000000..b7e07e1
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(warnings)]
+
+// Make sure this related feature didn't accidentally enable this
+#![feature(in_band_lifetimes)]
+
+trait MyTrait<'a> { }
+
+impl MyTrait<'a> for &u32 { }
+//~^ ERROR missing lifetime specifier
+
+struct MyStruct;
+trait MarkerTrait {}
+
+impl MarkerTrait for &'_ MyStruct { }
+//~^ ERROR missing lifetime specifier
+
+fn main() {}
diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.stderr b/src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.stderr
new file mode 100644 (file)
index 0000000..9487d11
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/feature-gate-impl_header_lifetime_elision-with-in_band.rs:18:22
+   |
+LL | impl MyTrait<'a> for &u32 { }
+   |                      ^ expected lifetime parameter
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/feature-gate-impl_header_lifetime_elision-with-in_band.rs:24:23
+   |
+LL | impl MarkerTrait for &'_ MyStruct { }
+   |                       ^^ expected lifetime parameter
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision.rs b/src/test/ui/feature-gate-impl_header_lifetime_elision.rs
new file mode 100644 (file)
index 0000000..3eb2ac1
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(warnings)]
+
+trait MyTrait<'a> { }
+
+impl<'a> MyTrait<'a> for &u32 { }
+//~^ ERROR missing lifetime specifier
+
+impl<'a> MyTrait<'_> for &'a f32 { }
+//~^ ERROR missing lifetime specifier
+
+fn main() {}
diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision.stderr b/src/test/ui/feature-gate-impl_header_lifetime_elision.stderr
new file mode 100644 (file)
index 0000000..2c8a7dd
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/feature-gate-impl_header_lifetime_elision.rs:15:26
+   |
+LL | impl<'a> MyTrait<'a> for &u32 { }
+   |                          ^ expected lifetime parameter
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/feature-gate-impl_header_lifetime_elision.rs:18:18
+   |
+LL | impl<'a> MyTrait<'_> for &'a f32 { }
+   |                  ^^ expected lifetime parameter
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/feature-gate-in_band_lifetimes-impl.rs b/src/test/ui/feature-gate-in_band_lifetimes-impl.rs
deleted file mode 100644 (file)
index 3eb2ac1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![allow(warnings)]
-
-trait MyTrait<'a> { }
-
-impl<'a> MyTrait<'a> for &u32 { }
-//~^ ERROR missing lifetime specifier
-
-impl<'a> MyTrait<'_> for &'a f32 { }
-//~^ ERROR missing lifetime specifier
-
-fn main() {}
diff --git a/src/test/ui/feature-gate-in_band_lifetimes-impl.stderr b/src/test/ui/feature-gate-in_band_lifetimes-impl.stderr
deleted file mode 100644 (file)
index 95bf81f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0106]: missing lifetime specifier
-  --> $DIR/feature-gate-in_band_lifetimes-impl.rs:15:26
-   |
-LL | impl<'a> MyTrait<'a> for &u32 { }
-   |                          ^ expected lifetime parameter
-
-error[E0106]: missing lifetime specifier
-  --> $DIR/feature-gate-in_band_lifetimes-impl.rs:18:18
-   |
-LL | impl<'a> MyTrait<'_> for &'a f32 { }
-   |                  ^^ expected lifetime parameter
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0106`.
index ae1f81c2f5721fd54742b3036ebd2b7d0dcb8b60..23b30711cf3c0540ca5761918683d7f4ac21da67 100644 (file)
@@ -10,6 +10,9 @@
 
 #![allow(warnings)]
 
+// Make sure this related feature didn't accidentally enable this
+#![feature(impl_header_lifetime_elision)]
+
 fn foo(x: &'x u8) -> &'x u8 { x }
 //~^ ERROR use of undeclared lifetime name
 //~^^ ERROR use of undeclared lifetime name
index cc0855306e162e97d984ca8807d8cebbd90b6aeb..5fe143959d2c5470e41e239b7fd4f4eb127c2739 100644 (file)
 error[E0261]: use of undeclared lifetime name `'x`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:13:12
+  --> $DIR/feature-gate-in_band_lifetimes.rs:16:12
    |
 LL | fn foo(x: &'x u8) -> &'x u8 { x }
    |            ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'x`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:13:23
+  --> $DIR/feature-gate-in_band_lifetimes.rs:16:23
    |
 LL | fn foo(x: &'x u8) -> &'x u8 { x }
    |                       ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:25:12
+  --> $DIR/feature-gate-in_band_lifetimes.rs:28:12
    |
 LL | impl<'a> X<'b> {
    |            ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:27:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:30:27
    |
 LL |     fn inner_2(&self) -> &'b u8 {
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:33:8
+  --> $DIR/feature-gate-in_band_lifetimes.rs:36:8
    |
 LL | impl X<'b> {
    |        ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:35:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:38:27
    |
 LL |     fn inner_3(&self) -> &'b u8 {
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:43:9
+  --> $DIR/feature-gate-in_band_lifetimes.rs:46:9
    |
 LL | impl Y<&'a u8> {
    |         ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:45:25
+  --> $DIR/feature-gate-in_band_lifetimes.rs:48:25
    |
 LL |     fn inner(&self) -> &'a u8 {
    |                         ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:53:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:56:27
    |
 LL |     fn any_lifetime() -> &'b u8;
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:55:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:58:27
    |
 LL |     fn borrowed_lifetime(&'b self) -> &'b u8;
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:55:40
+  --> $DIR/feature-gate-in_band_lifetimes.rs:58:40
    |
 LL |     fn borrowed_lifetime(&'b self) -> &'b u8;
    |                                        ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:60:14
+  --> $DIR/feature-gate-in_band_lifetimes.rs:63:14
    |
 LL | impl MyTrait<'a> for Y<&'a u8> {
    |              ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:60:25
+  --> $DIR/feature-gate-in_band_lifetimes.rs:63:25
    |
 LL | impl MyTrait<'a> for Y<&'a u8> {
    |                         ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:63:31
+  --> $DIR/feature-gate-in_band_lifetimes.rs:66:31
    |
 LL |     fn my_lifetime(&self) -> &'a u8 { self.0 }
    |                               ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:65:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:68:27
    |
 LL |     fn any_lifetime() -> &'b u8 { &0 }
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:67:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:70:27
    |
 LL |     fn borrowed_lifetime(&'b self) -> &'b u8 { &*self.0 }
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:67:40
+  --> $DIR/feature-gate-in_band_lifetimes.rs:70:40
    |
 LL |     fn borrowed_lifetime(&'b self) -> &'b u8 { &*self.0 }
    |                                        ^^ undeclared lifetime
diff --git a/src/test/ui/impl-header-lifetime-elision/assoc-type.rs b/src/test/ui/impl-header-lifetime-elision/assoc-type.rs
new file mode 100644 (file)
index 0000000..15cf077
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that we do not yet support elision in associated types, even
+// when there is just one name we could take from the impl header.
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait {
+    type Output;
+}
+
+impl MyTrait for &i32 {
+    type Output = &i32;
+    //~^ ERROR missing lifetime specifier
+}
+
+impl MyTrait for &u32 {
+    type Output = &'_ i32;
+    //~^ ERROR missing lifetime specifier
+}
+
+// This is what you have to do:
+impl<'a> MyTrait for &'a f32 {
+    type Output = &'a f32;
+}
+
+fn main() { }
diff --git a/src/test/ui/impl-header-lifetime-elision/assoc-type.stderr b/src/test/ui/impl-header-lifetime-elision/assoc-type.stderr
new file mode 100644 (file)
index 0000000..59b2cfd
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/assoc-type.rs:23:19
+   |
+LL |     type Output = &i32;
+   |                   ^ expected lifetime parameter
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/assoc-type.rs:28:20
+   |
+LL |     type Output = &'_ i32;
+   |                    ^^ expected lifetime parameter
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr
new file mode 100644 (file)
index 0000000..f5d98e0
--- /dev/null
@@ -0,0 +1,16 @@
+warning: not reporting region error due to nll
+  --> $DIR/dyn-trait.rs:32:16
+   |
+LL |     static_val(x); //~ ERROR cannot infer
+   |                ^
+
+error: borrowed data escapes outside of function
+  --> $DIR/dyn-trait.rs:32:5
+   |
+LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
+   |                              - `x` is a reference that is only valid in the function body
+LL |     static_val(x); //~ ERROR cannot infer
+   |     ^^^^^^^^^^^^^ `x` escapes the function body here
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs b/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs
new file mode 100644 (file)
index 0000000..661bfa8
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
+// 'b> MyTrait<'a> for &'b i32`.
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+use std::fmt::Debug;
+
+// Equivalent to `Box<dyn Debug + 'static>`:
+trait StaticTrait { }
+impl StaticTrait for Box<dyn Debug> { }
+
+// Equivalent to `Box<dyn Debug + 'static>`:
+trait NotStaticTrait { }
+impl NotStaticTrait for Box<dyn Debug + '_> { }
+
+fn static_val<T: StaticTrait>(_: T) {
+}
+
+fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
+    static_val(x); //~ ERROR cannot infer
+}
+
+fn not_static_val<T: NotStaticTrait>(_: T) {
+}
+
+fn with_dyn_debug_not_static<'a>(x: Box<dyn Debug + 'a>) {
+    not_static_val(x); // OK
+}
+
+fn main() {
+}
diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr
new file mode 100644 (file)
index 0000000..3e54ebe
--- /dev/null
@@ -0,0 +1,22 @@
+error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
+  --> $DIR/dyn-trait.rs:32:16
+   |
+LL |     static_val(x); //~ ERROR cannot infer
+   |                ^
+   |
+note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 31:26...
+  --> $DIR/dyn-trait.rs:31:26
+   |
+LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
+   |                          ^^
+   = note: ...so that the expression is assignable:
+           expected std::boxed::Box<dyn std::fmt::Debug>
+              found std::boxed::Box<(dyn std::fmt::Debug + 'a)>
+   = note: but, the lifetime must be valid for the static lifetime...
+   = note: ...so that the types are compatible:
+           expected StaticTrait
+              found StaticTrait
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/impl-header-lifetime-elision/path-elided.rs b/src/test/ui/impl-header-lifetime-elision/path-elided.rs
new file mode 100644 (file)
index 0000000..f88c899
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait { }
+
+struct Foo<'a> { x: &'a u32 }
+
+impl MyTrait for Foo {
+    //~^ ERROR missing lifetime specifier
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-header-lifetime-elision/path-elided.stderr b/src/test/ui/impl-header-lifetime-elision/path-elided.stderr
new file mode 100644 (file)
index 0000000..6c1d724
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/path-elided.rs:18:18
+   |
+LL | impl MyTrait for Foo {
+   |                  ^^^ expected lifetime parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/impl-header-lifetime-elision/path-underscore.rs b/src/test/ui/impl-header-lifetime-elision/path-underscore.rs
new file mode 100644 (file)
index 0000000..38118f0
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that `impl MyTrait for Foo<'_>` works.
+
+// run-pass
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait { }
+
+struct Foo<'a> { x: &'a u32 }
+
+impl MyTrait for Foo<'_> {
+}
+
+fn impls_my_trait<T: MyTrait>() { }
+
+fn impls_my_trait_val<T: MyTrait>(_: T) {
+    impls_my_trait::<T>();
+}
+
+fn random_where_clause()
+where for<'a> Foo<'a>: MyTrait { }
+
+fn main() {
+    let x = 22;
+    let f = Foo { x: &x };
+
+    // This type is `Foo<'x>` for a local lifetime `'x`; so the impl
+    // must apply to any lifetime to apply to this.
+    impls_my_trait_val(f);
+
+    impls_my_trait::<Foo<'static>>();
+
+    random_where_clause();
+}
diff --git a/src/test/ui/impl-header-lifetime-elision/ref-underscore.rs b/src/test/ui/impl-header-lifetime-elision/ref-underscore.rs
new file mode 100644 (file)
index 0000000..96a56aa
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that `impl MyTrait for &i32` works and is equivalent to any lifetime.
+
+// run-pass
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait { }
+
+impl MyTrait for &i32 {
+}
+
+fn impls_my_trait<T: MyTrait>() { }
+
+fn impls_my_trait_val<T: MyTrait>(_: T) {
+    impls_my_trait::<T>();
+}
+
+fn random_where_clause()
+where for<'a> &'a i32: MyTrait { }
+
+fn main() {
+    let x = 22;
+    let f = &x;
+
+    impls_my_trait_val(f);
+
+    impls_my_trait::<&'static i32>();
+
+    random_where_clause();
+}
diff --git a/src/test/ui/impl-header-lifetime-elision/trait-elided.rs b/src/test/ui/impl-header-lifetime-elision/trait-elided.rs
new file mode 100644 (file)
index 0000000..afdf220
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait<'a> { }
+
+impl MyTrait for u32 {
+    //~^ ERROR missing lifetime specifier
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-header-lifetime-elision/trait-elided.stderr b/src/test/ui/impl-header-lifetime-elision/trait-elided.stderr
new file mode 100644 (file)
index 0000000..fe3ded8
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/trait-elided.rs:16:6
+   |
+LL | impl MyTrait for u32 {
+   |      ^^^^^^^ expected lifetime parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/impl-header-lifetime-elision/trait-underscore.rs b/src/test/ui/impl-header-lifetime-elision/trait-underscore.rs
new file mode 100644 (file)
index 0000000..98242ff
--- /dev/null
@@ -0,0 +1,47 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
+// 'b> MyTrait<'a> for &'b i32`.
+//
+// run-pass
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait<'a> { }
+
+// This is equivalent to `MyTrait<'a> for &'b i32`, which is proven by
+// the code below.
+impl MyTrait<'_> for &i32 {
+}
+
+// When called, T will be `&'x i32` for some `'x`, so since we can
+// prove that `&'x i32: for<'a> MyTrait<'a>, then we know that the
+// lifetime parameter above is disconnected.
+fn impls_my_trait<T: for<'a> MyTrait<'a>>() { }
+
+fn impls_my_trait_val<T: for<'a> MyTrait<'a>>(_: T) {
+    impls_my_trait::<T>();
+}
+
+fn random_where_clause()
+where for<'a, 'b> &'a i32: MyTrait<'b> { }
+
+fn main() {
+    let x = 22;
+    let f = &x;
+    impls_my_trait_val(f);
+
+    impls_my_trait::<&'static i32>();
+
+    random_where_clause();
+}
diff --git a/src/test/ui/in-band-lifetimes/impl/assoc-type.rs b/src/test/ui/in-band-lifetimes/impl/assoc-type.rs
deleted file mode 100644 (file)
index ab35331..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that we do not yet support elision in associated types, even
-// when there is just one name we could take from the impl header.
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait {
-    type Output;
-}
-
-impl MyTrait for &i32 {
-    type Output = &i32;
-    //~^ ERROR missing lifetime specifier
-}
-
-impl MyTrait for &u32 {
-    type Output = &'_ i32;
-    //~^ ERROR missing lifetime specifier
-}
-
-// This is what you have to do:
-impl MyTrait for &'a f32 {
-    type Output = &'a f32;
-}
-
-fn main() { }
diff --git a/src/test/ui/in-band-lifetimes/impl/assoc-type.stderr b/src/test/ui/in-band-lifetimes/impl/assoc-type.stderr
deleted file mode 100644 (file)
index 59b2cfd..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0106]: missing lifetime specifier
-  --> $DIR/assoc-type.rs:23:19
-   |
-LL |     type Output = &i32;
-   |                   ^ expected lifetime parameter
-
-error[E0106]: missing lifetime specifier
-  --> $DIR/assoc-type.rs:28:20
-   |
-LL |     type Output = &'_ i32;
-   |                    ^^ expected lifetime parameter
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr b/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr
deleted file mode 100644 (file)
index f5d98e0..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-warning: not reporting region error due to nll
-  --> $DIR/dyn-trait.rs:32:16
-   |
-LL |     static_val(x); //~ ERROR cannot infer
-   |                ^
-
-error: borrowed data escapes outside of function
-  --> $DIR/dyn-trait.rs:32:5
-   |
-LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
-   |                              - `x` is a reference that is only valid in the function body
-LL |     static_val(x); //~ ERROR cannot infer
-   |     ^^^^^^^^^^^^^ `x` escapes the function body here
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/in-band-lifetimes/impl/dyn-trait.rs b/src/test/ui/in-band-lifetimes/impl/dyn-trait.rs
deleted file mode 100644 (file)
index c27bbe7..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
-// 'b> MyTrait<'a> for &'b i32`.
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-use std::fmt::Debug;
-
-// Equivalent to `Box<dyn Debug + 'static>`:
-trait StaticTrait { }
-impl StaticTrait for Box<dyn Debug> { }
-
-// Equivalent to `Box<dyn Debug + 'static>`:
-trait NotStaticTrait { }
-impl NotStaticTrait for Box<dyn Debug + '_> { }
-
-fn static_val<T: StaticTrait>(_: T) {
-}
-
-fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
-    static_val(x); //~ ERROR cannot infer
-}
-
-fn not_static_val<T: NotStaticTrait>(_: T) {
-}
-
-fn with_dyn_debug_not_static<'a>(x: Box<dyn Debug + 'a>) {
-    not_static_val(x); // OK
-}
-
-fn main() {
-}
diff --git a/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr b/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr
deleted file mode 100644 (file)
index 3e54ebe..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/dyn-trait.rs:32:16
-   |
-LL |     static_val(x); //~ ERROR cannot infer
-   |                ^
-   |
-note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 31:26...
-  --> $DIR/dyn-trait.rs:31:26
-   |
-LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
-   |                          ^^
-   = note: ...so that the expression is assignable:
-           expected std::boxed::Box<dyn std::fmt::Debug>
-              found std::boxed::Box<(dyn std::fmt::Debug + 'a)>
-   = note: but, the lifetime must be valid for the static lifetime...
-   = note: ...so that the types are compatible:
-           expected StaticTrait
-              found StaticTrait
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/in-band-lifetimes/impl/path-elided.rs b/src/test/ui/in-band-lifetimes/impl/path-elided.rs
deleted file mode 100644 (file)
index 8a758b1..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait { }
-
-struct Foo<'a> { x: &'a u32 }
-
-impl MyTrait for Foo {
-    //~^ ERROR missing lifetime specifier
-}
-
-fn main() {}
diff --git a/src/test/ui/in-band-lifetimes/impl/path-elided.stderr b/src/test/ui/in-band-lifetimes/impl/path-elided.stderr
deleted file mode 100644 (file)
index 6c1d724..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0106]: missing lifetime specifier
-  --> $DIR/path-elided.rs:18:18
-   |
-LL | impl MyTrait for Foo {
-   |                  ^^^ expected lifetime parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/in-band-lifetimes/impl/path-underscore.rs b/src/test/ui/in-band-lifetimes/impl/path-underscore.rs
deleted file mode 100644 (file)
index 756991d..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that `impl MyTrait for Foo<'_>` works.
-
-// run-pass
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait { }
-
-struct Foo<'a> { x: &'a u32 }
-
-impl MyTrait for Foo<'_> {
-}
-
-fn impls_my_trait<T: MyTrait>() { }
-
-fn impls_my_trait_val<T: MyTrait>(_: T) {
-    impls_my_trait::<T>();
-}
-
-fn random_where_clause()
-where for<'a> Foo<'a>: MyTrait { }
-
-fn main() {
-    let x = 22;
-    let f = Foo { x: &x };
-
-    // This type is `Foo<'x>` for a local lifetime `'x`; so the impl
-    // must apply to any lifetime to apply to this.
-    impls_my_trait_val(f);
-
-    impls_my_trait::<Foo<'static>>();
-
-    random_where_clause();
-}
diff --git a/src/test/ui/in-band-lifetimes/impl/ref-underscore.rs b/src/test/ui/in-band-lifetimes/impl/ref-underscore.rs
deleted file mode 100644 (file)
index 99708af..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that `impl MyTrait for &i32` works and is equivalent to any lifetime.
-
-// run-pass
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait { }
-
-impl MyTrait for &i32 {
-}
-
-fn impls_my_trait<T: MyTrait>() { }
-
-fn impls_my_trait_val<T: MyTrait>(_: T) {
-    impls_my_trait::<T>();
-}
-
-fn random_where_clause()
-where for<'a> &'a i32: MyTrait { }
-
-fn main() {
-    let x = 22;
-    let f = &x;
-
-    impls_my_trait_val(f);
-
-    impls_my_trait::<&'static i32>();
-
-    random_where_clause();
-}
diff --git a/src/test/ui/in-band-lifetimes/impl/trait-elided.rs b/src/test/ui/in-band-lifetimes/impl/trait-elided.rs
deleted file mode 100644 (file)
index e0709ab..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait<'a> { }
-
-impl MyTrait for u32 {
-    //~^ ERROR missing lifetime specifier
-}
-
-fn main() {}
diff --git a/src/test/ui/in-band-lifetimes/impl/trait-elided.stderr b/src/test/ui/in-band-lifetimes/impl/trait-elided.stderr
deleted file mode 100644 (file)
index fe3ded8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0106]: missing lifetime specifier
-  --> $DIR/trait-elided.rs:16:6
-   |
-LL | impl MyTrait for u32 {
-   |      ^^^^^^^ expected lifetime parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/in-band-lifetimes/impl/trait-underscore.rs b/src/test/ui/in-band-lifetimes/impl/trait-underscore.rs
deleted file mode 100644 (file)
index 971fd1f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
-// 'b> MyTrait<'a> for &'b i32`.
-//
-// run-pass
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait<'a> { }
-
-// This is equivalent to `MyTrait<'a> for &'b i32`, which is proven by
-// the code below.
-impl MyTrait<'_> for &i32 {
-}
-
-// When called, T will be `&'x i32` for some `'x`, so since we can
-// prove that `&'x i32: for<'a> MyTrait<'a>, then we know that the
-// lifetime parameter above is disconnected.
-fn impls_my_trait<T: for<'a> MyTrait<'a>>() { }
-
-fn impls_my_trait_val<T: for<'a> MyTrait<'a>>(_: T) {
-    impls_my_trait::<T>();
-}
-
-fn random_where_clause()
-where for<'a, 'b> &'a i32: MyTrait<'b> { }
-
-fn main() {
-    let x = 22;
-    let f = &x;
-    impls_my_trait_val(f);
-
-    impls_my_trait::<&'static i32>();
-
-    random_where_clause();
-}
index cd2ebc341ead136a8f265704f73999b99b8d0257..c923e6610ce0f2742a4fb3000dddaf2be1c31437 100644 (file)
@@ -18,15 +18,15 @@ LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime re
    |                    |
    |                    consider changing the type of `y` to `&'a u32`
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/mismatched.rs:16:46
    |
 LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
-   |                        -------     -------   ^ ...but data from `y` is returned here
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
+   |             --          --                   ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
+   |             |           |
+   |             |           lifetime `'b` defined here
+   |             lifetime `'a` defined here
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0621, E0623.
-For more information about an error, try `rustc --explain E0621`.
+For more information about this error, try `rustc --explain E0621`.
index 71e9c34ac2b97b006a5f9ef420d83f1002bd2a21..b6bf646132e39e99daf54cfa4ea19cca78010b13 100644 (file)
@@ -4,17 +4,16 @@ warning: not reporting region error due to nll
 LL |         if x > y { x } else { y } //~ ERROR lifetime mismatch
    |                    ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:21:12
    |
 LL |     fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |                   ----                 -------
-   |                   |
-   |                   this parameter and the return type are declared with different lifetimes...
+   |            --     - let's call the lifetime of this reference `'1`
+   |            |
+   |            lifetime `'a` defined here
 LL | 
 LL |         if x > y { x } else { y } //~ ERROR lifetime mismatch
-   |            ^^^^^ ...but data from `x` is returned here
+   |            ^^^^^ requires that `'1` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 6c16d6a608ec8a2853f2e758808d086a5d32a94b..93eac05e8d2c7697bb95b806edd2e49e1893be59 100644 (file)
@@ -4,17 +4,16 @@ warning: not reporting region error due to nll
 LL |     x //~ ERROR lifetime mismatch
    |     ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:18:5
    |
 LL |   fn foo<'a>(&self, x: &'a i32) -> &i32 {
-   |                        -------     ----
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
+   |          --  - let's call the lifetime of this reference `'1`
+   |          |
+   |          lifetime `'a` defined here
 LL | 
 LL |     x //~ ERROR lifetime mismatch
-   |     ^ ...but data from `x` is returned here
+   |     ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 6dc96ace4d0d31cafe9470196047fdf0f54c9893..c5b4fd1934b2883ff4927f5cdaca39bcc2001ca1 100644 (file)
@@ -4,17 +4,16 @@ warning: not reporting region error due to nll
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
    |                              ^^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:18:9
    |
 LL |     fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
-   |                -----                 -------
-   |                |
-   |                this parameter and the return type are declared with different lifetimes...
+   |            --  - let's call the lifetime of this reference `'1`
+   |            |
+   |            lifetime `'a` defined here
 LL | 
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `self` is returned here
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 4b4fdde940f7e26f1d226a7380407dd3fe1635a2..614034794bd6094873e682f5c4b83ad617efdb15 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2b-push-no-existing-names.rs:16:5
    |
 LL | fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
-   |                    --------      -------- these two types are declared with different lifetimes...
+   |                    --------      -------- lifetime `'1` appears in this type
+   |                    |
+   |                    lifetime `'2` appears in this type
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index f55fd291249c6aa9921ee4e390b7676ce16a7b22..c34278b4d9fa1ac90d6c12f49fdf79b2169fb976 100644 (file)
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     let z = Ref { data: y.data };
    |             ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2c-push-inference-variable.rs:17:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
+   |            --  -- lifetime `'c` defined here
+   |            |
+   |            lifetime `'b` defined here
 LL |     let z = Ref { data: y.data };
 LL |     x.push(z); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'c` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 85b5f3e890008554a9d802d335c61cf478ba8d44..3097d18e86c67feb855df2007a6b58f6aea1d7d8 100644 (file)
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     let b = Ref { data: y.data };
    |             ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2d-push-inference-variable-2.rs:18:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
+   |            --  -- lifetime `'c` defined here
+   |            |
+   |            lifetime `'b` defined here
 ...
 LL |     a.push(b);
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'c` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 7e5182a5d30c940b2f2363d950dafec273167d92..ce0e9be300698ea2e52a0616256cb42e2516587c 100644 (file)
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     let b = Ref { data: y.data };
    |             ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2e-push-inference-variable-3.rs:18:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
+   |            --  -- lifetime `'c` defined here
+   |            |
+   |            lifetime `'b` defined here
 ...
 LL |     Vec::push(a, b);
-   |     ^^^^^^^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^^^^^^^ argument requires that `'c` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 36317c4570b982fe73a104fc6fcfb02d2d1f15bd..c7f1a0ede3c1cf26b8c413a8ac0690430f62c9e0 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     *v = x; //~ ERROR lifetime mismatch
    |          ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-2.rs:12:5
    |
 LL | fn foo(&mut (ref mut v, w): &mut (&u8, &u8), x: &u8) {
-   |                                   ---           --- these two types are declared with different lifetimes...
+   |                                   -             - let's call the lifetime of this reference `'1`
+   |                                   |
+   |                                   let's call the lifetime of this reference `'2`
 LL |     *v = x; //~ ERROR lifetime mismatch
-   |     ^^^^^^ ...but data from `x` flows here
+   |     ^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index c43c4ce3a0c21fa5080eab79a0596133b418754c..09980e44c52d63b3ada0f2a6c59c004acbdff611 100644 (file)
@@ -10,22 +10,25 @@ warning: not reporting region error due to nll
 LL |     z.push((x,y)); //~ ERROR lifetime mismatch
    |               ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-3.rs:12:5
    |
 LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
-   |                     ---                 --- these two types are declared with different lifetimes...
+   |                     -                   - let's call the lifetime of this reference `'1`
+   |                     |
+   |                     let's call the lifetime of this reference `'2`
 LL |     z.push((x,y)); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^^^^^ ...but data flows into `z` here
+   |     ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-3.rs:12:5
    |
 LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
-   |                         ---                  --- these two types are declared with different lifetimes...
+   |                         -                    - let's call the lifetime of this reference `'1`
+   |                         |
+   |                         let's call the lifetime of this reference `'2`
 LL |     z.push((x,y)); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^^^^^ ...but data flows into `z` here
+   |     ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0623`.
index 191389b7706e1e8f93e18533d6157472af6249e1..2829fbcd32a1bbc13801a80c7af3cdcd53d3fee9 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.b = y.b; //~ ERROR lifetime mismatch
    |           ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:16:5
    |
 LL | fn foo(mut x: Ref, y: Ref) {
-   |               ---     --- these two types are declared with different lifetimes...
+   |               ---     --- lifetime `'1` appears in this type
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     x.b = y.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 159367cc9d2a6f98cceebb48c97c3ab4ccf5c59c..8171ee758b066fc2590b1f1c428959a6c8232d08 100644 (file)
@@ -4,16 +4,16 @@ warning: not reporting region error due to nll
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
    |           ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:16:5
    |
 LL | fn foo(mut x: Ref) {
    |               ---
    |               |
-   |               this type is declared with multiple lifetimes...
+   |               lifetime `'1` appears in this type
+   |               lifetime `'2` appears in this type
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data with one lifetime flows into the other here
+   |     ^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 3bbcbdd6681fd7aa1a5b09a9f5ada3b00f17ce77..99b64605baec1e1641c6a526a350baeee0857ac7 100644 (file)
@@ -4,16 +4,16 @@ warning: not reporting region error due to nll
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
    |           ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-4.rs:16:5
    |
 LL | fn foo(mut x: Ref) {
    |               ---
    |               |
-   |               this type is declared with multiple lifetimes...
+   |               lifetime `'1` appears in this type
+   |               lifetime `'2` appears in this type
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data with one lifetime flows into the other here
+   |     ^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 2a5729952e33d3e691dd50017c730bb4bb3a9997..aed0dcc1a67ea14ae48268c447dc09c80533c8f7 100644 (file)
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:18:5
    |
 LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>)
-   |                           -------      ------- these two types are declared with different lifetimes...
+   |        --  -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 ...
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'b` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 6efc8d3da06776ad6cd66b96c24d1e98b6d1e066..7790d37d1c40dafc2cd76843919e6bc89e0c7d8d 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:15:5
    |
 LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>) {
-   |                           -------      ------- these two types are declared with different lifetimes...
+   |        --  -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'b` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 0f555020822cb42f4559e21eedc3de6336237aee..c9542d31069799f69fb1b283af44ba246673be68 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs.rs:15:5
    |
 LL | fn foo(mut x: Vec<Ref>, y: Ref) {
-   |                   ---      --- these two types are declared with different lifetimes...
+   |                   ---      --- lifetime `'1` appears in this type
+   |                   |
+   |                   lifetime `'2` appears in this type
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 4400644e7fb65299d62adba5139f1cbb574021ad..459a93813a8cae1a53288821be9557d27640a539 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-latebound-regions.rs:12:5
    |
 LL | fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) {
-   |                           ------      ------ these two types are declared with different lifetimes...
+   |        -- -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'b` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 93f2837c0fc11ce2b838da0757d829d87805cd54..459796760e1b490cc3f076080a69d5fbeb0c9b03 100644 (file)
@@ -4,15 +4,15 @@ warning: not reporting region error due to nll
 LL |     y = x.b; //~ ERROR lifetime mismatch
    |         ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:5
    |
 LL | fn foo(mut x: Ref, y: &u32) {
-   |               ---     ----
+   |               ---     - let's call the lifetime of this reference `'2`
    |               |
-   |               these two types are declared with different lifetimes...
+   |               lifetime `'1` appears in this type
 LL |     y = x.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `x` flows into `y` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error[E0384]: cannot assign to immutable argument `y`
   --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:5
@@ -24,5 +24,4 @@ LL |     y = x.b; //~ ERROR lifetime mismatch
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0384, E0623.
-For more information about an error, try `rustc --explain E0384`.
+For more information about this error, try `rustc --explain E0384`.
index e7fb67f117f88c5138563673e3700b83caf208b8..5fc1755ed390ac083a09157882e436d57ca04bfe 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     y.b = x; //~ ERROR lifetime mismatch
    |           ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:14:5
    |
 LL | fn foo(mut y: Ref, x: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
+   |               ---     - let's call the lifetime of this reference `'1`
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     y.b = x; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `x` flows into `y` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index af9e3a42664cf6e35e0b476969534bfdc797e3c0..835f95880a744b43d92e0ab8a36b93d612061169 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     y.b = x; //~ ERROR lifetime mismatch
    |           ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:14:5
    |
 LL | fn foo(mut y: Ref, x: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
+   |               ---     - let's call the lifetime of this reference `'1`
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     y.b = x; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `x` flows into `y` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 5437beaab65117683f4f117089ce16ea00e6f491..7aed5fe626f060d04f19e241e08e6a7dc9b24124 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.b = y; //~ ERROR lifetime mismatch
    |           ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct.rs:17:5
    |
 LL | fn foo(mut x: Ref, y: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
+   |               ---     - let's call the lifetime of this reference `'1`
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     x.b = y; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 42e1d42a32ccd32fe78817243a9610943aebe750..22581d9b0751f1be945cc322cece57ebb5561b40 100644 (file)
@@ -4,16 +4,15 @@ warning: not reporting region error due to nll
 LL |     x //~ ERROR lifetime mismatch
    |     ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:17:5
    |
 LL |   fn foo<'a>(&self, x: &i32) -> &i32 {
-   |                        ----     ----
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
+   |              -         - let's call the lifetime of this reference `'1`
+   |              |
+   |              let's call the lifetime of this reference `'2`
 LL |     x //~ ERROR lifetime mismatch
-   |     ^ ...but data from `x` is returned here
+   |     ^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 26b0488cfdc61cf054b369c4baa21fe8e199b0fc..908526d439e8b389e6d43600fe9c3d5812c5cdfe 100644 (file)
@@ -4,16 +4,15 @@ warning: not reporting region error due to nll
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
    |                   ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-self-is-anon.rs:17:9
    |
 LL |     fn foo<'a>(&self, x: &Foo) -> &Foo {
-   |                          ----     ----
-   |                          |
-   |                          this parameter and the return type are declared with different lifetimes...
+   |                -         - let's call the lifetime of this reference `'1`
+   |                |
+   |                let's call the lifetime of this reference `'2`
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `x` is returned here
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index a0aa1e28d9bc03183b388e96df22287287417686..2829ec35000439fbdffb276fdcbb610b57bbd618 100644 (file)
@@ -4,23 +4,24 @@ warning: not reporting region error due to nll
 LL |   y.push(z); //~ ERROR lifetime mismatch
    |          ^
 
-error[E0623]: lifetime mismatch
+error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
   --> $DIR/ex3-both-anon-regions-using-fn-items.rs:11:3
    |
 LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
-   |                               ---      --- these two types are declared with different lifetimes...
+   |                        - help: consider changing this to be mutable: `mut y`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^^^^^^^^^ ...but data from `z` flows into `y` here
+   |   ^ cannot borrow as mutable
 
-error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-using-fn-items.rs:11:3
    |
 LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
-   |                        - help: consider changing this to be mutable: `mut y`
+   |                               -        - let's call the lifetime of this reference `'1`
+   |                               |
+   |                               let's call the lifetime of this reference `'2`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^ cannot borrow as mutable
+   |   ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0596, E0623.
-For more information about an error, try `rustc --explain E0596`.
+For more information about this error, try `rustc --explain E0596`.
index 5d4492701beb33209beab494a81da78dd657c043..44d68df4b5590ad2e0f916abb16727ece809ed27 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |         x.push(y); //~ ERROR lifetime mismatch
    |                ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-using-impl-items.rs:15:9
    |
 LL |     fn foo(x: &mut Vec<&u8>, y: &u8) {
-   |                        ---      --- these two types are declared with different lifetimes...
+   |                        -        - let's call the lifetime of this reference `'1`
+   |                        |
+   |                        let's call the lifetime of this reference `'2`
 LL |         x.push(y); //~ ERROR lifetime mismatch
-   |         ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |         ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 37b79cee72f75bec1baf25a23ad67c05cb4542c1..5d3c6f38ad808cb433765b56ca18de0cd4e10203 100644 (file)
@@ -4,23 +4,24 @@ warning: not reporting region error due to nll
 LL |   y.push(z); //~ ERROR lifetime mismatch
    |          ^
 
-error[E0623]: lifetime mismatch
+error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
   --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
    |
 LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
-   |                 ---  --- these two types are declared with different lifetimes...
+   |                              - help: consider changing this to be mutable: `mut y`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^^^^^^^^^ ...but data from `z` flows into `y` here
+   |   ^ cannot borrow as mutable
 
-error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
    |
 LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
-   |                              - help: consider changing this to be mutable: `mut y`
+   |                                     -        - let's call the lifetime of this reference `'1`
+   |                                     |
+   |                                     let's call the lifetime of this reference `'2`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^ cannot borrow as mutable
+   |   ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0596, E0623.
-For more information about an error, try `rustc --explain E0596`.
+For more information about this error, try `rustc --explain E0596`.
index c11d81a4c13daf9336e2cd9e861c7b4b9bc52eed..6460e5d687ff0f752ad514c258cc0c09e9483104 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions.rs:12:5
    |
 LL | fn foo(x: &mut Vec<&u8>, y: &u8) {
-   |                    ---      --- these two types are declared with different lifetimes...
+   |                    -        - let's call the lifetime of this reference `'1`
+   |                    |
+   |                    let's call the lifetime of this reference `'2`
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index da8ce55162f37e706ce35dbfb4cf9f4386449389..d79be8b83c61fa6156980341eaeae4f106d41f4a 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 lifetime mismatch
+        //~^ ERROR unsatisfied lifetime constraints
 
         // Only works if 'x: 'y:
         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
index 2704a325314664e89ac45e2b6356458fb546b3fc..fe67ca0293e06bed86d4dd0d5931afba43c0e948 100644 (file)
@@ -9,7 +9,7 @@ note: External requirements
    |
 LL |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
    |  _______________________________________________^
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 LL | |         // Only works if 'x: 'y:
 LL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
@@ -23,27 +23,12 @@ LL | |     });
    = note: number of external vids: 5
    = note: where '_#1r: '_#2r
 
-error[E0623]: lifetime mismatch
-  --> $DIR/propagate-approximated-ref.rs:53:5
-   |
-LL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-   |                                  -------                -------
-   |                                  |
-   |                                  these two types are declared with different lifetimes...
-LL | /     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
-LL | |
-LL | |         // Only works if 'x: 'y:
-LL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
-LL | |     });
-   | |______^ ...but data from `cell_a` flows into `cell_b` here
-
 note: No external requirements
   --> $DIR/propagate-approximated-ref.rs:52:1
    |
 LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 LL | |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 ...  |
 LL | |     });
@@ -52,6 +37,20 @@ LL | | }
    |
    = note: defining type: DefId(0/0:6 ~ propagate_approximated_ref[317d]::supply[0]) with substs []
 
+error: unsatisfied lifetime constraints
+  --> $DIR/propagate-approximated-ref.rs:53:5
+   |
+LL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+   |             --  -- lifetime `'b` defined here
+   |             |
+   |             lifetime `'a` defined here
+LL | /     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
+LL | |         //~^ ERROR unsatisfied lifetime constraints
+LL | |
+LL | |         // Only works if 'x: 'y:
+LL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
+LL | |     });
+   | |______^ argument requires that `'a` must outlive `'b`
+
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 0449dc1d1a75c2846134f95c52c21993c79f43c1..bf24557398d161d3e696c945249e45503f094f8c 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 lifetime mismatch
+        //~^ ERROR unsatisfied lifetime constraints
 
         // Only works if 'x: 'y:
         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
index 3cd9e9dd5b008f19322475a1ed6ddc342dc6ea10..ed1fc6e1a712fe5bcef02c58e7d5657be2c098a3 100644 (file)
@@ -9,7 +9,7 @@ note: External requirements
    |
 LL |       establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
    |  _____________________________________________^
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 LL | |         // Only works if 'x: 'y:
 LL | |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
@@ -23,27 +23,12 @@ LL | |     });
    = note: number of external vids: 5
    = note: where '_#1r: '_#2r
 
-error[E0623]: lifetime mismatch
-  --> $DIR/propagate-approximated-val.rs:46:5
-   |
-LL |   fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-   |                                -------                -------
-   |                                |
-   |                                these two types are declared with different lifetimes...
-LL | /     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
-LL | |
-LL | |         // Only works if 'x: 'y:
-LL | |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
-LL | |     });
-   | |______^ ...but data from `cell_a` flows into `cell_b` here
-
 note: No external requirements
   --> $DIR/propagate-approximated-val.rs:45:1
    |
 LL | / fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 LL | |     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 ...  |
 LL | |     });
@@ -52,6 +37,20 @@ LL | | }
    |
    = note: defining type: DefId(0/0:6 ~ propagate_approximated_val[317d]::test[0]) with substs []
 
+error: unsatisfied lifetime constraints
+  --> $DIR/propagate-approximated-val.rs:46:5
+   |
+LL |   fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+   |           --  -- lifetime `'b` defined here
+   |           |
+   |           lifetime `'a` defined here
+LL | /     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
+LL | |         //~^ ERROR unsatisfied lifetime constraints
+LL | |
+LL | |         // Only works if 'x: 'y:
+LL | |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
+LL | |     });
+   | |______^ argument requires that `'a` must outlive `'b`
+
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 8598668bef50ea59002d5466e6d895976a97d7bc..a883e7b1994737ce4a97dacfd16506ebfd2df73c 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 nll
-        //~| ERROR lifetime mismatch
+        //~| ERROR unsatisfied lifetime constraints
 }
 
 fn main() { }
index 415aefdeee947a97b91f71c667aa57cc82a78f64..cf3f4df19ae52581d465bd2cab9f7e69d95b8967 100644 (file)
@@ -4,16 +4,15 @@ warning: not reporting region error due to nll
 LL |     &*x
    |     ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/region-lbr1-does-not-outlive-ebr2.rs:19:5
    |
 LL | fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
-   |                   -------                 -------
-   |                   |
-   |                   this parameter and the return type are declared with different lifetimes...
+   |        --  -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 LL |     &*x
-   |     ^^^ ...but data from `x` is returned here
+   |     ^^^ requires that `'a` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 1c509c5d224618584db790d1705eef70904731b9..e484c249d84a59446baf51615ba2e2bcfd408b17 100644 (file)
@@ -40,7 +40,7 @@ fn produce3<'a, 'b: 'a>(data: &'a mut Vec<&'a u32>, value: &'b u32) -> impl Bazi
 }
 
 fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
-    let x = move || { //~ ERROR lifetime mismatch
+    let x = move || { //~ ERROR unsatisfied lifetime constraints
         let value: &'a u32 = value;
         data.push(value);
     };
index 4a7c10c3f1af860af15f34e791d1da6d60da8f2e..b21539361e66f8a2dbd021c46a471c0bbf85ec41 100644 (file)
@@ -1,11 +1,12 @@
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/issue-52113.rs:43:9
    |
 LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
-   |                                  --------------------         ------- these two types are declared with different lifetimes...
-LL |     let x = move || { //~ ERROR lifetime mismatch
-   |         ^ ...but data from `value` flows into `data` here
+   |                --  -- lifetime `'b` defined here
+   |                |
+   |                lifetime `'a` defined here
+LL |     let x = move || { //~ ERROR unsatisfied lifetime constraints
+   |         ^ requires that `'a` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.