about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authortoidiu <apoorv@toidiu.com>2018-08-28 00:46:08 -0400
committertoidiu <apoorv@toidiu.com>2018-09-11 11:40:04 -0400
commit731f4efae5ee18082202f31e8699fe07eb0a5d19 (patch)
tree4227227517d44cc0dceb2ceac4be848b11846b41 /src/test
parent7ee72070bdb789f58f272fab50d49bd48dd9c11f (diff)
downloadrust-731f4efae5ee18082202f31e8699fe07eb0a5d19.tar.gz
rust-731f4efae5ee18082202f31e8699fe07eb0a5d19.zip
stabalize infer outlives requirements (RFC 2093).
Co-authored-by: nikomatsakis
Diffstat (limited to 'src/test')
-rw-r--r--src/test/incremental/issue-51409.rs2
-rw-r--r--src/test/ui/dep-graph/dep-graph-struct-signature.rs1
-rw-r--r--src/test/ui/dep-graph/dep-graph-struct-signature.stderr12
-rw-r--r--src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.rs18
-rw-r--r--src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.stderr17
-rw-r--r--src/test/ui/issue-53419.rs2
-rw-r--r--src/test/ui/issues/issue-37323.rs3
-rw-r--r--src/test/ui/issues/issue-37323.stderr20
-rw-r--r--src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.rs2
-rw-r--r--src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr16
-rw-r--r--src/test/ui/lint/lint-ctypes.rs2
-rw-r--r--src/test/ui/lint/lint-ctypes.stderr46
-rw-r--r--src/test/ui/no_owned_box_lang_item.rs4
-rw-r--r--src/test/ui/regions/regions-enum-not-wf.rs24
-rw-r--r--src/test/ui/regions/regions-enum-not-wf.stderr77
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.rs5
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.stderr20
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-enum-region.rs5
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-enum-region.stderr20
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.rs7
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.stderr20
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-enum-type.rs5
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-enum-type.stderr20
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.rs5
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.stderr20
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-struct-region.rs3
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-struct-region.stderr20
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.rs3
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.stderr20
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-struct-type.rs3
-rw-r--r--src/test/ui/regions/regions-outlives-nominal-type-struct-type.stderr20
-rw-r--r--src/test/ui/regions/regions-struct-not-wf.lexical.stderr49
-rw-r--r--src/test/ui/regions/regions-struct-not-wf.nll.stderr49
-rw-r--r--src/test/ui/regions/regions-struct-not-wf.rs28
-rw-r--r--src/test/ui/regions/regions-struct-not-wf.stderr49
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/cross-crate.rs3
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr8
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/enum.rs18
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/enum.stderr47
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/explicit-dyn.rs3
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/explicit-enum.rs3
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/explicit-projection.rs1
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr2
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/explicit-struct.rs3
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/explicit-union.rs4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/infer-static.rs3
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/infer-static.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/nested-enum.rs4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/nested-regions.rs3
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/nested-structs.rs3
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/nested-union.rs4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/nested-union.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/privacy.rs20
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/projection.rs1
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/projection.stderr2
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/reference.rs1
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/reference.stderr2
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs50
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr67
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs32
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr20
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs32
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr20
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs32
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr20
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs32
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr20
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs38
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr49
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/self-dyn.rs3
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/self-structs.rs3
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/self-structs.stderr4
-rw-r--r--src/test/ui/typeck/typeck_type_placeholder_item.stderr36
-rw-r--r--src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs21
-rw-r--r--src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr34
85 files changed, 733 insertions, 580 deletions
diff --git a/src/test/incremental/issue-51409.rs b/src/test/incremental/issue-51409.rs
index d7aff5afe40..8aa75e6315d 100644
--- a/src/test/incremental/issue-51409.rs
+++ b/src/test/incremental/issue-51409.rs
@@ -13,8 +13,6 @@
 // Regression test that `infer_outlives_predicates` can be
 // used with incremental without an ICE.
 
-#![feature(infer_outlives_requirements)]
-
 struct Foo<'a, T> {
   x: &'a T
 }
diff --git a/src/test/ui/dep-graph/dep-graph-struct-signature.rs b/src/test/ui/dep-graph/dep-graph-struct-signature.rs
index 647605ae438..6343dc201c5 100644
--- a/src/test/ui/dep-graph/dep-graph-struct-signature.rs
+++ b/src/test/ui/dep-graph/dep-graph-struct-signature.rs
@@ -88,7 +88,6 @@ mod invalid_signatures {
     }
 
     #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path
-    #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path
     fn b(x: WontChange) { }
 
     #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path from `WillChange`
diff --git a/src/test/ui/dep-graph/dep-graph-struct-signature.stderr b/src/test/ui/dep-graph/dep-graph-struct-signature.stderr
index cbb695d0cf2..0d75bf5a9ad 100644
--- a/src/test/ui/dep-graph/dep-graph-struct-signature.stderr
+++ b/src/test/ui/dep-graph/dep-graph-struct-signature.stderr
@@ -82,20 +82,14 @@ error: no path from `WillChange` to `FnSignature`
 LL |     #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: no path from `WillChange` to `TypeckTables`
-  --> $DIR/dep-graph-struct-signature.rs:91:5
-   |
-LL |     #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error: no path from `WillChange` to `FnSignature`
-  --> $DIR/dep-graph-struct-signature.rs:94:5
+  --> $DIR/dep-graph-struct-signature.rs:93:5
    |
 LL |     #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path from `WillChange`
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: no path from `WillChange` to `TypeckTables`
-  --> $DIR/dep-graph-struct-signature.rs:95:5
+  --> $DIR/dep-graph-struct-signature.rs:94:5
    |
 LL |     #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path from `WillChange`
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -136,5 +130,5 @@ error: OK
 LL |         #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 23 previous errors
+error: aborting due to 22 previous errors
 
diff --git a/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.rs b/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.rs
deleted file mode 100644
index 01ccc50a130..00000000000
--- a/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2015 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.
-
-// Needs an explicit where clause stating outlives condition. (RFC 2093)
-
-// Type T needs to outlive lifetime 'a.
-struct Foo<'a, T> {
-    bar: &'a [T] //~ ERROR the parameter type `T` may not live long enough [E0309]
-}
-
-fn main() { }
diff --git a/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.stderr b/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.stderr
deleted file mode 100644
index 560e494b582..00000000000
--- a/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/feature-gate-infer_outlives_requirements.rs:15:5
-   |
-LL | struct Foo<'a, T> {
-   |                - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     bar: &'a [T] //~ ERROR the parameter type `T` may not live long enough [E0309]
-   |     ^^^^^^^^^^^^
-   |
-note: ...so that the reference type `&'a [T]` does not outlive the data it points at
-  --> $DIR/feature-gate-infer_outlives_requirements.rs:15:5
-   |
-LL |     bar: &'a [T] //~ ERROR the parameter type `T` may not live long enough [E0309]
-   |     ^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/issue-53419.rs b/src/test/ui/issue-53419.rs
index e4ade1b6323..0dd5a851285 100644
--- a/src/test/ui/issue-53419.rs
+++ b/src/test/ui/issue-53419.rs
@@ -10,8 +10,6 @@
 
 //compile-pass
 
-#![feature(infer_outlives_requirements)]
-
 struct Foo {
     bar: for<'r> Fn(usize, &'r FnMut())
 }
diff --git a/src/test/ui/issues/issue-37323.rs b/src/test/ui/issues/issue-37323.rs
index 98806cdd1b9..24ed7ce92bf 100644
--- a/src/test/ui/issues/issue-37323.rs
+++ b/src/test/ui/issues/issue-37323.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// compile-pass
+
 #![feature(rustc_attrs)]
 #![allow(warnings)]
 
@@ -17,7 +19,6 @@ struct Point {
 
 struct NestedA<'a, 'b> {
     x: &'a NestedB<'b>
-    //~^ ERROR E0491
 }
 
 struct NestedB<'a> {
diff --git a/src/test/ui/issues/issue-37323.stderr b/src/test/ui/issues/issue-37323.stderr
deleted file mode 100644
index a83923a5910..00000000000
--- a/src/test/ui/issues/issue-37323.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a NestedB<'b>`, reference has a longer lifetime than the data it references
-  --> $DIR/issue-37323.rs:19:5
-   |
-LL |     x: &'a NestedB<'b>
-   |     ^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the struct at 18:16
-  --> $DIR/issue-37323.rs:18:16
-   |
-LL | struct NestedA<'a, 'b> {
-   |                ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 18:20
-  --> $DIR/issue-37323.rs:18:20
-   |
-LL | struct NestedA<'a, 'b> {
-   |                    ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.rs b/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.rs
index 0099a8bc10f..7bc83fd7507 100644
--- a/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.rs
+++ b/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.rs
@@ -14,9 +14,9 @@ trait ListItem<'a> {
 
 trait Collection { fn len(&self) -> usize; }
 
+// is now well formed. RFC 2093
 struct List<'a, T: ListItem<'a>> {
     slice: &'a [T]
-    //~^ ERROR may not live long enough
 }
 
 impl<'a, T: ListItem<'a>> Collection for List<'a, T> {
diff --git a/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr b/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
index ea79990bbb1..db8d57bb19d 100644
--- a/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
+++ b/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
@@ -1,17 +1,3 @@
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:18:5
-   |
-LL | struct List<'a, T: ListItem<'a>> {
-   |                 -- help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     slice: &'a [T]
-   |     ^^^^^^^^^^^^^^
-   |
-note: ...so that the reference type `&'a [T]` does not outlive the data it points at
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:18:5
-   |
-LL |     slice: &'a [T]
-   |     ^^^^^^^^^^^^^^
-
 error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/lifetime-doesnt-live-long-enough.rs:29:5
    |
@@ -109,7 +95,7 @@ LL | |         //~^ ERROR may not live long enough
 LL | |     }
    | |_____^
 
-error: aborting due to 7 previous errors
+error: aborting due to 6 previous errors
 
 Some errors occurred: E0309, E0310.
 For more information about an error, try `rustc --explain E0309`.
diff --git a/src/test/ui/lint/lint-ctypes.rs b/src/test/ui/lint/lint-ctypes.rs
index b8b1a675c5f..e09aabaf692 100644
--- a/src/test/ui/lint/lint-ctypes.rs
+++ b/src/test/ui/lint/lint-ctypes.rs
@@ -11,6 +11,8 @@
 #![deny(improper_ctypes)]
 #![feature(libc)]
 
+#![allow(private_in_public)]
+
 extern crate libc;
 
 use std::marker::PhantomData;
diff --git a/src/test/ui/lint/lint-ctypes.stderr b/src/test/ui/lint/lint-ctypes.stderr
index b97e4662660..b243c49316f 100644
--- a/src/test/ui/lint/lint-ctypes.stderr
+++ b/src/test/ui/lint/lint-ctypes.stderr
@@ -1,5 +1,5 @@
 error: `extern` block uses type `Foo` which is not FFI-safe: this struct has unspecified layout
-  --> $DIR/lint-ctypes.rs:54:28
+  --> $DIR/lint-ctypes.rs:56:28
    |
 LL |     pub fn ptr_type1(size: *const Foo); //~ ERROR: uses type `Foo`
    |                            ^^^^^^^^^^
@@ -11,26 +11,26 @@ LL | #![deny(improper_ctypes)]
    |         ^^^^^^^^^^^^^^^
    = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
 note: type defined here
-  --> $DIR/lint-ctypes.rs:32:1
+  --> $DIR/lint-ctypes.rs:34:1
    |
 LL | pub struct Foo;
    | ^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `Foo` which is not FFI-safe: this struct has unspecified layout
-  --> $DIR/lint-ctypes.rs:55:28
+  --> $DIR/lint-ctypes.rs:57:28
    |
 LL |     pub fn ptr_type2(size: *const Foo); //~ ERROR: uses type `Foo`
    |                            ^^^^^^^^^^
    |
    = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
 note: type defined here
-  --> $DIR/lint-ctypes.rs:32:1
+  --> $DIR/lint-ctypes.rs:34:1
    |
 LL | pub struct Foo;
    | ^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `[u32]` which is not FFI-safe: slices have no C equivalent
-  --> $DIR/lint-ctypes.rs:56:26
+  --> $DIR/lint-ctypes.rs:58:26
    |
 LL |     pub fn slice_type(p: &[u32]); //~ ERROR: uses type `[u32]`
    |                          ^^^^^^
@@ -38,7 +38,7 @@ LL |     pub fn slice_type(p: &[u32]); //~ ERROR: uses type `[u32]`
    = help: consider using a raw pointer instead
 
 error: `extern` block uses type `str` which is not FFI-safe: string slices have no C equivalent
-  --> $DIR/lint-ctypes.rs:57:24
+  --> $DIR/lint-ctypes.rs:59:24
    |
 LL |     pub fn str_type(p: &str); //~ ERROR: uses type `str`
    |                        ^^^^
@@ -46,7 +46,7 @@ LL |     pub fn str_type(p: &str); //~ ERROR: uses type `str`
    = help: consider using `*const u8` and a length instead
 
 error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout
-  --> $DIR/lint-ctypes.rs:58:24
+  --> $DIR/lint-ctypes.rs:60:24
    |
 LL |     pub fn box_type(p: Box<u32>); //~ ERROR uses type `std::boxed::Box<u32>`
    |                        ^^^^^^^^
@@ -54,7 +54,7 @@ LL |     pub fn box_type(p: Box<u32>); //~ ERROR uses type `std::boxed::Box<u32>
    = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
 
 error: `extern` block uses type `char` which is not FFI-safe: the `char` type has no C equivalent
-  --> $DIR/lint-ctypes.rs:59:25
+  --> $DIR/lint-ctypes.rs:61:25
    |
 LL |     pub fn char_type(p: char); //~ ERROR uses type `char`
    |                         ^^^^
@@ -62,25 +62,25 @@ LL |     pub fn char_type(p: char); //~ ERROR uses type `char`
    = help: consider using `u32` or `libc::wchar_t` instead
 
 error: `extern` block uses type `i128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI
-  --> $DIR/lint-ctypes.rs:60:25
+  --> $DIR/lint-ctypes.rs:62:25
    |
 LL |     pub fn i128_type(p: i128); //~ ERROR uses type `i128`
    |                         ^^^^
 
 error: `extern` block uses type `u128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI
-  --> $DIR/lint-ctypes.rs:61:25
+  --> $DIR/lint-ctypes.rs:63:25
    |
 LL |     pub fn u128_type(p: u128); //~ ERROR uses type `u128`
    |                         ^^^^
 
 error: `extern` block uses type `dyn std::clone::Clone` which is not FFI-safe: trait objects have no C equivalent
-  --> $DIR/lint-ctypes.rs:62:26
+  --> $DIR/lint-ctypes.rs:64:26
    |
 LL |     pub fn trait_type(p: &Clone); //~ ERROR uses type `dyn std::clone::Clone`
    |                          ^^^^^^
 
 error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout
-  --> $DIR/lint-ctypes.rs:63:26
+  --> $DIR/lint-ctypes.rs:65:26
    |
 LL |     pub fn tuple_type(p: (i32, i32)); //~ ERROR uses type `(i32, i32)`
    |                          ^^^^^^^^^^
@@ -88,7 +88,7 @@ LL |     pub fn tuple_type(p: (i32, i32)); //~ ERROR uses type `(i32, i32)`
    = help: consider using a struct instead
 
 error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout
-  --> $DIR/lint-ctypes.rs:64:27
+  --> $DIR/lint-ctypes.rs:66:27
    |
 LL |     pub fn tuple_type2(p: I32Pair); //~ ERROR uses type `(i32, i32)`
    |                           ^^^^^^^
@@ -96,32 +96,32 @@ LL |     pub fn tuple_type2(p: I32Pair); //~ ERROR uses type `(i32, i32)`
    = help: consider using a struct instead
 
 error: `extern` block uses type `ZeroSize` which is not FFI-safe: this struct has no fields
-  --> $DIR/lint-ctypes.rs:65:25
+  --> $DIR/lint-ctypes.rs:67:25
    |
 LL |     pub fn zero_size(p: ZeroSize); //~ ERROR struct has no fields
    |                         ^^^^^^^^
    |
    = help: consider adding a member to this struct
 note: type defined here
-  --> $DIR/lint-ctypes.rs:28:1
+  --> $DIR/lint-ctypes.rs:30:1
    |
 LL | pub struct ZeroSize;
    | ^^^^^^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `ZeroSizeWithPhantomData` which is not FFI-safe: composed only of PhantomData
-  --> $DIR/lint-ctypes.rs:66:33
+  --> $DIR/lint-ctypes.rs:68:33
    |
 LL |     pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); //~ ERROR composed only of PhantomData
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `std::marker::PhantomData<bool>` which is not FFI-safe: composed only of PhantomData
-  --> $DIR/lint-ctypes.rs:68:12
+  --> $DIR/lint-ctypes.rs:70:12
    |
 LL |         -> ::std::marker::PhantomData<bool>; //~ ERROR: composed only of PhantomData
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention
-  --> $DIR/lint-ctypes.rs:69:23
+  --> $DIR/lint-ctypes.rs:71:23
    |
 LL |     pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific
    |                       ^^^^^^
@@ -129,7 +129,7 @@ LL |     pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific
    = help: consider using an `extern fn(...) -> ...` function pointer instead
 
 error: `extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention
-  --> $DIR/lint-ctypes.rs:70:24
+  --> $DIR/lint-ctypes.rs:72:24
    |
 LL |     pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific
    |                        ^^^^
@@ -137,7 +137,7 @@ LL |     pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific
    = help: consider using an `extern fn(...) -> ...` function pointer instead
 
 error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout
-  --> $DIR/lint-ctypes.rs:71:28
+  --> $DIR/lint-ctypes.rs:73:28
    |
 LL |     pub fn fn_contained(p: RustBadRet); //~ ERROR: uses type `std::boxed::Box<u32>`
    |                            ^^^^^^^^^^
@@ -145,13 +145,13 @@ LL |     pub fn fn_contained(p: RustBadRet); //~ ERROR: uses type `std::boxed::B
    = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
 
 error: `extern` block uses type `i128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI
-  --> $DIR/lint-ctypes.rs:72:32
+  --> $DIR/lint-ctypes.rs:74:32
    |
 LL |     pub fn transparent_i128(p: TransparentI128); //~ ERROR: uses type `i128`
    |                                ^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `str` which is not FFI-safe: string slices have no C equivalent
-  --> $DIR/lint-ctypes.rs:73:31
+  --> $DIR/lint-ctypes.rs:75:31
    |
 LL |     pub fn transparent_str(p: TransparentStr); //~ ERROR: uses type `str`
    |                               ^^^^^^^^^^^^^^
@@ -159,7 +159,7 @@ LL |     pub fn transparent_str(p: TransparentStr); //~ ERROR: uses type `str`
    = help: consider using `*const u8` and a length instead
 
 error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout
-  --> $DIR/lint-ctypes.rs:74:30
+  --> $DIR/lint-ctypes.rs:76:30
    |
 LL |     pub fn transparent_fn(p: TransparentBadFn); //~ ERROR: uses type `std::boxed::Box<u32>`
    |                              ^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/no_owned_box_lang_item.rs b/src/test/ui/no_owned_box_lang_item.rs
index 1c2bf1573dc..34d1075f9b7 100644
--- a/src/test/ui/no_owned_box_lang_item.rs
+++ b/src/test/ui/no_owned_box_lang_item.rs
@@ -15,10 +15,12 @@
 #![feature(lang_items, box_syntax)]
 #![no_std]
 
+use core::panic::PanicInfo;
+
 fn main() {
     let x = box 1i32;
 }
 
 #[lang = "eh_personality"] extern fn eh_personality() {}
 #[lang = "eh_unwind_resume"] extern fn eh_unwind_resume() {}
-#[lang = "panic_impl"] fn panic_impl() -> ! { loop {} }
+#[lang = "panic_impl"] fn panic_impl(panic: &PanicInfo) -> ! { loop {} }
diff --git a/src/test/ui/regions/regions-enum-not-wf.rs b/src/test/ui/regions/regions-enum-not-wf.rs
index e21f92bc9b8..a2d3cf6779f 100644
--- a/src/test/ui/regions/regions-enum-not-wf.rs
+++ b/src/test/ui/regions/regions-enum-not-wf.rs
@@ -8,31 +8,43 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-tidy-linelength
+
 // Various examples of structs whose fields are not well-formed.
 
 #![allow(dead_code)]
 
+trait Dummy<'a> {
+  type Out;
+}
+impl<'a, T> Dummy<'a> for T
+where T: 'a
+{
+  type Out = ();
+}
+type RequireOutlives<'a, T> = <T as Dummy<'a>>::Out;
+
 enum Ref1<'a, T> {
-    Ref1Variant1(&'a T) //~ ERROR the parameter type `T` may not live long enough
+    Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
 }
 
 enum Ref2<'a, T> {
     Ref2Variant1,
-    Ref2Variant2(isize, &'a T), //~ ERROR the parameter type `T` may not live long enough
+    Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
 }
 
 enum RefOk<'a, T:'a> {
     RefOkVariant1(&'a T)
 }
 
+// This is now well formed. RFC 2093
 enum RefIndirect<'a, T> {
     RefIndirectVariant1(isize, RefOk<'a,T>)
-        //~^ ERROR the parameter type `T` may not live long enough
 }
 
-enum RefDouble<'a, 'b, T> {
-    RefDoubleVariant1(&'a &'b T)
-        //~^ ERROR reference has a longer lifetime than the data
+enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
+    RefDoubleVariant1(&'a RequireOutlives<'b, T>)
+        //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
 }
 
 fn main() { }
diff --git a/src/test/ui/regions/regions-enum-not-wf.stderr b/src/test/ui/regions/regions-enum-not-wf.stderr
index 381a8aada5a..923ea17622a 100644
--- a/src/test/ui/regions/regions-enum-not-wf.stderr
+++ b/src/test/ui/regions/regions-enum-not-wf.stderr
@@ -1,64 +1,67 @@
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-enum-not-wf.rs:16:18
+  --> $DIR/regions-enum-not-wf.rs:28:18
    |
 LL | enum Ref1<'a, T> {
    |               - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     Ref1Variant1(&'a T) //~ ERROR the parameter type `T` may not live long enough
-   |                  ^^^^^
+LL |     Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
+   |                  ^^^^^^^^^^^^^^^^^^^^^^
    |
-note: ...so that the reference type `&'a T` does not outlive the data it points at
-  --> $DIR/regions-enum-not-wf.rs:16:18
+note: ...so that the type `T` will meet its required lifetime bounds
+  --> $DIR/regions-enum-not-wf.rs:28:18
    |
-LL |     Ref1Variant1(&'a T) //~ ERROR the parameter type `T` may not live long enough
-   |                  ^^^^^
+LL |     Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
+   |                  ^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-enum-not-wf.rs:21:25
+  --> $DIR/regions-enum-not-wf.rs:33:25
    |
 LL | enum Ref2<'a, T> {
    |               - help: consider adding an explicit lifetime bound `T: 'a`...
 LL |     Ref2Variant1,
-LL |     Ref2Variant2(isize, &'a T), //~ ERROR the parameter type `T` may not live long enough
-   |                         ^^^^^
+LL |     Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
+   |                         ^^^^^^^^^^^^^^^^^^^^^^
    |
-note: ...so that the reference type `&'a T` does not outlive the data it points at
-  --> $DIR/regions-enum-not-wf.rs:21:25
+note: ...so that the type `T` will meet its required lifetime bounds
+  --> $DIR/regions-enum-not-wf.rs:33:25
    |
-LL |     Ref2Variant2(isize, &'a T), //~ ERROR the parameter type `T` may not live long enough
-   |                         ^^^^^
+LL |     Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
+   |                         ^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-enum-not-wf.rs:29:32
+  --> $DIR/regions-enum-not-wf.rs:45:1
    |
-LL | enum RefIndirect<'a, T> {
-   |                      - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     RefIndirectVariant1(isize, RefOk<'a,T>)
-   |                                ^^^^^^^^^^^
+LL |   enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
+   |   ^                      - help: consider adding an explicit lifetime bound `T: 'b`...
+   |  _|
+   | |
+LL | |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
+LL | |         //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
+LL | | }
+   | |_^
    |
 note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-enum-not-wf.rs:29:32
+  --> $DIR/regions-enum-not-wf.rs:45:1
    |
-LL |     RefIndirectVariant1(isize, RefOk<'a,T>)
-   |                                ^^^^^^^^^^^
+LL | / enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
+LL | |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
+LL | |         //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
+LL | | }
+   | |_^
 
-error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-enum-not-wf.rs:34:23
-   |
-LL |     RefDoubleVariant1(&'a &'b T)
-   |                       ^^^^^^^^^
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-enum-not-wf.rs:46:23
    |
-note: the pointer is valid for the lifetime 'a as defined on the enum at 33:16
-  --> $DIR/regions-enum-not-wf.rs:33:16
+LL | enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
+   |                        - help: consider adding an explicit lifetime bound `T: 'b`...
+LL |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-LL | enum RefDouble<'a, 'b, T> {
-   |                ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 33:20
-  --> $DIR/regions-enum-not-wf.rs:33:20
+note: ...so that the type `T` will meet its required lifetime bounds
+  --> $DIR/regions-enum-not-wf.rs:46:23
    |
-LL | enum RefDouble<'a, 'b, T> {
-   |                    ^^
+LL |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 4 previous errors
 
-Some errors occurred: E0309, E0491.
-For more information about an error, try `rustc --explain E0309`.
+For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.rs b/src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.rs
index db25a0698fe..7a2be8c0d95 100644
--- a/src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.rs
+++ b/src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.rs
@@ -13,6 +13,8 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
+// compile-pass
+
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -21,9 +23,8 @@ mod rev_variant_struct_region {
         x: fn(&'a i32),
     }
     enum Bar<'a,'b> {
-        V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime
+        V(&'a Foo<'b>)
     }
 }
 
-#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.stderr
deleted file mode 100644
index 5084097e30d..00000000000
--- a/src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a rev_variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-enum-region-rev.rs:24:11
-   |
-LL |         V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime
-   |           ^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14
-  --> $DIR/regions-outlives-nominal-type-enum-region-rev.rs:23:14
-   |
-LL |     enum Bar<'a,'b> {
-   |              ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17
-  --> $DIR/regions-outlives-nominal-type-enum-region-rev.rs:23:17
-   |
-LL |     enum Bar<'a,'b> {
-   |                 ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-region.rs b/src/test/ui/regions/regions-outlives-nominal-type-enum-region.rs
index 403757042d2..07127263bf8 100644
--- a/src/test/ui/regions/regions-outlives-nominal-type-enum-region.rs
+++ b/src/test/ui/regions/regions-outlives-nominal-type-enum-region.rs
@@ -13,6 +13,8 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
+// compile-pass
+
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -21,9 +23,8 @@ mod variant_struct_region {
         x: &'a i32,
     }
     enum Bar<'a,'b> {
-        V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime
+        V(&'a Foo<'b>)
     }
 }
 
-#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-region.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-region.stderr
deleted file mode 100644
index ce187eddfa9..00000000000
--- a/src/test/ui/regions/regions-outlives-nominal-type-enum-region.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-enum-region.rs:24:11
-   |
-LL |         V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime
-   |           ^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14
-  --> $DIR/regions-outlives-nominal-type-enum-region.rs:23:14
-   |
-LL |     enum Bar<'a,'b> {
-   |              ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17
-  --> $DIR/regions-outlives-nominal-type-enum-region.rs:23:17
-   |
-LL |     enum Bar<'a,'b> {
-   |                 ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.rs b/src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.rs
index cc294651db7..4941b568fc6 100644
--- a/src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.rs
+++ b/src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.rs
@@ -13,17 +13,18 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
+//compile-pass
+
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
-mod rev_variant_struct_type {
+mod variant_struct_type {
     struct Foo<T> {
         x: fn(T)
     }
     enum Bar<'a,'b> {
-        V(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime
+        V(&'a Foo<&'b i32>)
     }
 }
 
-#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.stderr
deleted file mode 100644
index 8636b89b71a..00000000000
--- a/src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a rev_variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-enum-type-rev.rs:24:11
-   |
-LL |         V(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime
-   |           ^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14
-  --> $DIR/regions-outlives-nominal-type-enum-type-rev.rs:23:14
-   |
-LL |     enum Bar<'a,'b> {
-   |              ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17
-  --> $DIR/regions-outlives-nominal-type-enum-type-rev.rs:23:17
-   |
-LL |     enum Bar<'a,'b> {
-   |                 ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-type.rs b/src/test/ui/regions/regions-outlives-nominal-type-enum-type.rs
index e269767cc16..38eb0c97a47 100644
--- a/src/test/ui/regions/regions-outlives-nominal-type-enum-type.rs
+++ b/src/test/ui/regions/regions-outlives-nominal-type-enum-type.rs
@@ -13,6 +13,8 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
+// compile-pass
+
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -21,9 +23,8 @@ mod variant_struct_type {
         x: T
     }
     enum Bar<'a,'b> {
-        F(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime
+        V(&'a Foo<&'b i32>)
     }
 }
 
-#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-type.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-type.stderr
deleted file mode 100644
index c209547e20c..00000000000
--- a/src/test/ui/regions/regions-outlives-nominal-type-enum-type.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-enum-type.rs:24:11
-   |
-LL |         F(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime
-   |           ^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14
-  --> $DIR/regions-outlives-nominal-type-enum-type.rs:23:14
-   |
-LL |     enum Bar<'a,'b> {
-   |              ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17
-  --> $DIR/regions-outlives-nominal-type-enum-type.rs:23:17
-   |
-LL |     enum Bar<'a,'b> {
-   |                 ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.rs b/src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.rs
index c7e6ace8b92..50febdd4579 100644
--- a/src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.rs
+++ b/src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.rs
@@ -13,6 +13,8 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
+// compile-pass
+
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -21,9 +23,8 @@ mod rev_variant_struct_region {
         x: fn(&'a i32),
     }
     struct Bar<'a,'b> {
-        f: &'a Foo<'b> //~ ERROR reference has a longer lifetime
+        f: &'a Foo<'b>
     }
 }
 
-#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.stderr
deleted file mode 100644
index 48980bdf832..00000000000
--- a/src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a rev_variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-struct-region-rev.rs:24:9
-   |
-LL |         f: &'a Foo<'b> //~ ERROR reference has a longer lifetime
-   |         ^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16
-  --> $DIR/regions-outlives-nominal-type-struct-region-rev.rs:23:16
-   |
-LL |     struct Bar<'a,'b> {
-   |                ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19
-  --> $DIR/regions-outlives-nominal-type-struct-region-rev.rs:23:19
-   |
-LL |     struct Bar<'a,'b> {
-   |                   ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-region.rs b/src/test/ui/regions/regions-outlives-nominal-type-struct-region.rs
index 2fe6444c33a..ea07fb4104b 100644
--- a/src/test/ui/regions/regions-outlives-nominal-type-struct-region.rs
+++ b/src/test/ui/regions/regions-outlives-nominal-type-struct-region.rs
@@ -13,6 +13,8 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
+// compile-pass
+
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -25,5 +27,4 @@ mod variant_struct_region {
     }
 }
 
-#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-region.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-region.stderr
deleted file mode 100644
index e2b328886b3..00000000000
--- a/src/test/ui/regions/regions-outlives-nominal-type-struct-region.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-struct-region.rs:24:9
-   |
-LL |         f: &'a Foo<'b> //~ ERROR reference has a longer lifetime
-   |         ^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16
-  --> $DIR/regions-outlives-nominal-type-struct-region.rs:23:16
-   |
-LL |     struct Bar<'a,'b> {
-   |                ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19
-  --> $DIR/regions-outlives-nominal-type-struct-region.rs:23:19
-   |
-LL |     struct Bar<'a,'b> {
-   |                   ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.rs b/src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.rs
index c4b631bce98..735037ac2f6 100644
--- a/src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.rs
+++ b/src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.rs
@@ -13,6 +13,8 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
+// compile-pass
+
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -25,5 +27,4 @@ mod rev_variant_struct_type {
     }
 }
 
-#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.stderr
deleted file mode 100644
index 2bf04ffa64a..00000000000
--- a/src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a rev_variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-struct-type-rev.rs:24:9
-   |
-LL |         f: &'a Foo<&'b i32> //~ ERROR reference has a longer lifetime
-   |         ^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16
-  --> $DIR/regions-outlives-nominal-type-struct-type-rev.rs:23:16
-   |
-LL |     struct Bar<'a,'b> {
-   |                ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19
-  --> $DIR/regions-outlives-nominal-type-struct-type-rev.rs:23:19
-   |
-LL |     struct Bar<'a,'b> {
-   |                   ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-type.rs b/src/test/ui/regions/regions-outlives-nominal-type-struct-type.rs
index 1c9489444a6..dfd3583ce6c 100644
--- a/src/test/ui/regions/regions-outlives-nominal-type-struct-type.rs
+++ b/src/test/ui/regions/regions-outlives-nominal-type-struct-type.rs
@@ -13,6 +13,8 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
+// compile-pass
+
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -25,5 +27,4 @@ mod variant_struct_type {
     }
 }
 
-#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-type.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-type.stderr
deleted file mode 100644
index af9f1d3722a..00000000000
--- a/src/test/ui/regions/regions-outlives-nominal-type-struct-type.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-struct-type.rs:24:9
-   |
-LL |         f: &'a Foo<&'b i32> //~ ERROR reference has a longer lifetime
-   |         ^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16
-  --> $DIR/regions-outlives-nominal-type-struct-type.rs:23:16
-   |
-LL |     struct Bar<'a,'b> {
-   |                ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19
-  --> $DIR/regions-outlives-nominal-type-struct-type.rs:23:19
-   |
-LL |     struct Bar<'a,'b> {
-   |                   ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-struct-not-wf.lexical.stderr b/src/test/ui/regions/regions-struct-not-wf.lexical.stderr
deleted file mode 100644
index 9433b8b1952..00000000000
--- a/src/test/ui/regions/regions-struct-not-wf.lexical.stderr
+++ /dev/null
@@ -1,49 +0,0 @@
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-struct-not-wf.rs:19:5
-   |
-LL | struct Ref<'a, T> {
-   |                - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     field: &'a T
-   |     ^^^^^^^^^^^^
-   |
-note: ...so that the reference type `&'a T` does not outlive the data it points at
-  --> $DIR/regions-struct-not-wf.rs:19:5
-   |
-LL |     field: &'a T
-   |     ^^^^^^^^^^^^
-
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-struct-not-wf.rs:29:5
-   |
-LL | struct RefIndirect<'a, T> {
-   |                        - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     field: RefOk<'a, T>
-   |     ^^^^^^^^^^^^^^^^^^^
-   |
-note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-struct-not-wf.rs:29:5
-   |
-LL |     field: RefOk<'a, T>
-   |     ^^^^^^^^^^^^^^^^^^^
-
-error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-struct-not-wf.rs:35:5
-   |
-LL |     field: &'a &'b T
-   |     ^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the struct at 34:18
-  --> $DIR/regions-struct-not-wf.rs:34:18
-   |
-LL | struct DoubleRef<'a, 'b, T> {
-   |                  ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 34:22
-  --> $DIR/regions-struct-not-wf.rs:34:22
-   |
-LL | struct DoubleRef<'a, 'b, T> {
-   |                      ^^
-
-error: aborting due to 3 previous errors
-
-Some errors occurred: E0309, E0491.
-For more information about an error, try `rustc --explain E0309`.
diff --git a/src/test/ui/regions/regions-struct-not-wf.nll.stderr b/src/test/ui/regions/regions-struct-not-wf.nll.stderr
deleted file mode 100644
index 9433b8b1952..00000000000
--- a/src/test/ui/regions/regions-struct-not-wf.nll.stderr
+++ /dev/null
@@ -1,49 +0,0 @@
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-struct-not-wf.rs:19:5
-   |
-LL | struct Ref<'a, T> {
-   |                - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     field: &'a T
-   |     ^^^^^^^^^^^^
-   |
-note: ...so that the reference type `&'a T` does not outlive the data it points at
-  --> $DIR/regions-struct-not-wf.rs:19:5
-   |
-LL |     field: &'a T
-   |     ^^^^^^^^^^^^
-
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-struct-not-wf.rs:29:5
-   |
-LL | struct RefIndirect<'a, T> {
-   |                        - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     field: RefOk<'a, T>
-   |     ^^^^^^^^^^^^^^^^^^^
-   |
-note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-struct-not-wf.rs:29:5
-   |
-LL |     field: RefOk<'a, T>
-   |     ^^^^^^^^^^^^^^^^^^^
-
-error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-struct-not-wf.rs:35:5
-   |
-LL |     field: &'a &'b T
-   |     ^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the struct at 34:18
-  --> $DIR/regions-struct-not-wf.rs:34:18
-   |
-LL | struct DoubleRef<'a, 'b, T> {
-   |                  ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 34:22
-  --> $DIR/regions-struct-not-wf.rs:34:22
-   |
-LL | struct DoubleRef<'a, 'b, T> {
-   |                      ^^
-
-error: aborting due to 3 previous errors
-
-Some errors occurred: E0309, E0491.
-For more information about an error, try `rustc --explain E0309`.
diff --git a/src/test/ui/regions/regions-struct-not-wf.rs b/src/test/ui/regions/regions-struct-not-wf.rs
index 9106f1f0ba6..bdd708197bc 100644
--- a/src/test/ui/regions/regions-struct-not-wf.rs
+++ b/src/test/ui/regions/regions-struct-not-wf.rs
@@ -10,31 +10,29 @@
 
 // Various examples of structs whose fields are not well-formed.
 
-// revisions:lexical nll
-
 #![allow(dead_code)]
-#![cfg_attr(nll, feature(nll))]
 
-struct Ref<'a, T> {
-    field: &'a T
-        //[lexical]~^ ERROR the parameter type `T` may not live long enough
-        //[nll]~^^ ERROR the parameter type `T` may not live long enough
+trait Trait<'a, T> {
+    type Out;
+}
+trait Trait1<'a, 'b, T> {
+    type Out;
+}
+
+impl<'a, T> Trait<'a, T> for usize {
+    type Out = &'a T;
 }
 
 struct RefOk<'a, T:'a> {
     field: &'a T
 }
 
-struct RefIndirect<'a, T> {
-    field: RefOk<'a, T>
-        //[lexical]~^ ERROR the parameter type `T` may not live long enough
-        //[nll]~^^ ERROR the parameter type `T` may not live long enough
+impl<'a, T> Trait<'a, T> for u32 {
+    type Out = RefOk<'a, T>;
 }
 
-struct DoubleRef<'a, 'b, T> {
-    field: &'a &'b T
-        //[lexical]~^ ERROR reference has a longer lifetime than the data it references
-        //[nll]~^^ ERROR reference has a longer lifetime than the data it references
+impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
+    type Out = &'a &'b T;
 }
 
 fn main() { }
diff --git a/src/test/ui/regions/regions-struct-not-wf.stderr b/src/test/ui/regions/regions-struct-not-wf.stderr
new file mode 100644
index 00000000000..d8c8b6c3ccc
--- /dev/null
+++ b/src/test/ui/regions/regions-struct-not-wf.stderr
@@ -0,0 +1,49 @@
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-struct-not-wf.rs:23:5
+   |
+LL | impl<'a, T> Trait<'a, T> for usize {
+   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     type Out = &'a T;
+   |     ^^^^^^^^^^^^^^^^^
+   |
+note: ...so that the reference type `&'a T` does not outlive the data it points at
+  --> $DIR/regions-struct-not-wf.rs:23:5
+   |
+LL |     type Out = &'a T;
+   |     ^^^^^^^^^^^^^^^^^
+
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-struct-not-wf.rs:31:5
+   |
+LL | impl<'a, T> Trait<'a, T> for u32 {
+   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     type Out = RefOk<'a, T>;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: ...so that the type `T` will meet its required lifetime bounds
+  --> $DIR/regions-struct-not-wf.rs:31:5
+   |
+LL |     type Out = RefOk<'a, T>;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-struct-not-wf.rs:35:5
+   |
+LL |     type Out = &'a &'b T;
+   |     ^^^^^^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the impl at 34:6
+  --> $DIR/regions-struct-not-wf.rs:34:6
+   |
+LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
+   |      ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 34:10
+  --> $DIR/regions-struct-not-wf.rs:34:10
+   |
+LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
+   |          ^^
+
+error: aborting due to 3 previous errors
+
+Some errors occurred: E0309, E0491.
+For more information about an error, try `rustc --explain E0309`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/cross-crate.rs b/src/test/ui/rfc-2093-infer-outlives/cross-crate.rs
index 01673997883..cc659cd14b1 100644
--- a/src/test/ui/rfc-2093-infer-outlives/cross-crate.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/cross-crate.rs
@@ -9,10 +9,9 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<'a, T> { //~ ERROR 15:1: 17:2: rustc_outlives
+struct Foo<'a, T> { //~ ERROR 14:1: 16:2: rustc_outlives
     bar: std::slice::IterMut<'a, T>
 }
 
diff --git a/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr b/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr
index a90643ae891..dd00c14ea16 100644
--- a/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/cross-crate.rs:15:1
+  --> $DIR/cross-crate.rs:14:1
    |
-LL | / struct Foo<'a, T> { //~ ERROR 15:1: 17:2: rustc_outlives
+LL | / struct Foo<'a, T> { //~ ERROR 14:1: 16:2: rustc_outlives
 LL | |     bar: std::slice::IterMut<'a, T>
 LL | | }
    | |_^
diff --git a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs
index 72d5127c294..47dc5dfdc96 100644
--- a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs
@@ -10,8 +10,6 @@
 
 // ignore-tidy-linelength
 
-#![feature(infer_outlives_requirements)]
-
 /*
  * We don't infer `T: 'static` outlives relationships by default.
  * Instead an additional feature gate `infer_static_outlives_requirements`
@@ -19,7 +17,7 @@
  */
 
 struct Foo<U> {
-    bar: Bar<U> //~ ERROR 22:5: 22:16: the parameter type `U` may not live long enough [E0310]
+    bar: Bar<U> //~ ERROR 20:5: 20:16: the parameter type `U` may not live long enough [E0310]
 }
 struct Bar<T: 'static> {
     x: T,
diff --git a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr
index 775ac215e19..5d8cf0aa324 100644
--- a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr
@@ -1,15 +1,15 @@
 error[E0310]: the parameter type `U` may not live long enough
-  --> $DIR/dont-infer-static.rs:22:5
+  --> $DIR/dont-infer-static.rs:20:5
    |
 LL | struct Foo<U> {
    |            - help: consider adding an explicit lifetime bound `U: 'static`...
-LL |     bar: Bar<U> //~ ERROR 22:5: 22:16: the parameter type `U` may not live long enough [E0310]
+LL |     bar: Bar<U> //~ ERROR 20:5: 20:16: the parameter type `U` may not live long enough [E0310]
    |     ^^^^^^^^^^^
    |
 note: ...so that the type `U` will meet its required lifetime bounds
-  --> $DIR/dont-infer-static.rs:22:5
+  --> $DIR/dont-infer-static.rs:20:5
    |
-LL |     bar: Bar<U> //~ ERROR 22:5: 22:16: the parameter type `U` may not live long enough [E0310]
+LL |     bar: Bar<U> //~ ERROR 20:5: 20:16: the parameter type `U` may not live long enough [E0310]
    |     ^^^^^^^^^^^
 
 error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/enum.rs b/src/test/ui/rfc-2093-infer-outlives/enum.rs
index 5071465b5f6..b2c18b274ce 100644
--- a/src/test/ui/rfc-2093-infer-outlives/enum.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/enum.rs
@@ -10,24 +10,26 @@
 
 // ignore-tidy-linelength
 
+#![feature(rustc_attrs)]
+
 // Needs an explicit where clause stating outlives condition. (RFC 2093)
 
 // Type T needs to outlive lifetime 'a.
-enum Foo<'a, T> {
-
+#[rustc_outlives]
+enum Foo<'a, T> { //~ ERROR rustc_outlives
     One(Bar<'a, T>)
 }
 
 // Type U needs to outlive lifetime 'b
-struct Bar<'b, U> {
-    field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
+#[rustc_outlives]
+struct Bar<'b, U> { //~ ERROR rustc_outlives
+    field2: &'b U
 }
 
-
-
 // Type K needs to outlive lifetime 'c.
-enum Ying<'c, K> {
-    One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
+#[rustc_outlives]
+enum Ying<'c, K> { //~ ERROR rustc_outlives
+    One(&'c Yang<K>)
 }
 
 struct Yang<V> {
diff --git a/src/test/ui/rfc-2093-infer-outlives/enum.stderr b/src/test/ui/rfc-2093-infer-outlives/enum.stderr
index 604dd0b43c0..e621c435eea 100644
--- a/src/test/ui/rfc-2093-infer-outlives/enum.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/enum.stderr
@@ -1,31 +1,32 @@
-error[E0309]: the parameter type `U` may not live long enough
-  --> $DIR/enum.rs:23:5
+error: rustc_outlives
+  --> $DIR/enum.rs:19:1
    |
-LL | struct Bar<'b, U> {
-   |                - help: consider adding an explicit lifetime bound `U: 'b`...
-LL |     field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
-   |     ^^^^^^^^^^^^^
+LL | / enum Foo<'a, T> { //~ ERROR rustc_outlives
+LL | |     One(Bar<'a, T>)
+LL | | }
+   | |_^
    |
-note: ...so that the reference type `&'b U` does not outlive the data it points at
-  --> $DIR/enum.rs:23:5
-   |
-LL |     field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
-   |     ^^^^^^^^^^^^^
+   = note: T : 'a
 
-error[E0309]: the parameter type `K` may not live long enough
-  --> $DIR/enum.rs:30:9
+error: rustc_outlives
+  --> $DIR/enum.rs:25:1
+   |
+LL | / struct Bar<'b, U> { //~ ERROR rustc_outlives
+LL | |     field2: &'b U
+LL | | }
+   | |_^
    |
-LL | enum Ying<'c, K> {
-   |               - help: consider adding an explicit lifetime bound `K: 'c`...
-LL |     One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
-   |         ^^^^^^^^^^^
+   = note: U : 'b
+
+error: rustc_outlives
+  --> $DIR/enum.rs:31:1
    |
-note: ...so that the reference type `&'c Yang<K>` does not outlive the data it points at
-  --> $DIR/enum.rs:30:9
+LL | / enum Ying<'c, K> { //~ ERROR rustc_outlives
+LL | |     One(&'c Yang<K>)
+LL | | }
+   | |_^
    |
-LL |     One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
-   |         ^^^^^^^^^^^
+   = note: K : 'c
 
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.rs b/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.rs
index 445c246a120..92642595209 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.rs
@@ -10,13 +10,12 @@
 
 #![feature(dyn_trait)]
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 
 trait Trait<'x, T> where T: 'x {
 }
 
 #[rustc_outlives]
-struct Foo<'a, A> //~ ERROR 19:1: 22:2: rustc_outlives
+struct Foo<'a, A> //~ ERROR 18:1: 21:2: rustc_outlives
 {
     foo: Box<dyn Trait<'a, A>>
 }
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr
index 4bb5d90e964..5d167493308 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/explicit-dyn.rs:19:1
+  --> $DIR/explicit-dyn.rs:18:1
    |
-LL | / struct Foo<'a, A> //~ ERROR 19:1: 22:2: rustc_outlives
+LL | / struct Foo<'a, A> //~ ERROR 18:1: 21:2: rustc_outlives
 LL | | {
 LL | |     foo: Box<dyn Trait<'a, A>>
 LL | | }
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.rs b/src/test/ui/rfc-2093-infer-outlives/explicit-enum.rs
index e85b49bb0bf..0ac75fc2556 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-enum.rs
@@ -9,10 +9,9 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-enum Foo<'a, U> { //~ ERROR 15:1: 17:2: rustc_outlives
+enum Foo<'a, U> { //~ ERROR 14:1: 16:2: rustc_outlives
     One(Bar<'a, U>)
 }
 
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr
index d7438758d77..33ef4b7e6a1 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/explicit-enum.rs:15:1
+  --> $DIR/explicit-enum.rs:14:1
    |
-LL | / enum Foo<'a, U> { //~ ERROR 15:1: 17:2: rustc_outlives
+LL | / enum Foo<'a, U> { //~ ERROR 14:1: 16:2: rustc_outlives
 LL | |     One(Bar<'a, U>)
 LL | | }
    | |_^
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.rs b/src/test/ui/rfc-2093-infer-outlives/explicit-projection.rs
index 2662043c36d..02c171627e6 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-projection.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 
 trait Trait<'x, T> where T: 'x {
     type Type;
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr
index 43ab02d01ed..5480130c2d3 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr
@@ -1,5 +1,5 @@
 error: rustc_outlives
-  --> $DIR/explicit-projection.rs:19:1
+  --> $DIR/explicit-projection.rs:18:1
    |
 LL | / struct Foo<'a, A, B> where A: Trait<'a, B> //~ ERROR rustc_outlives
 LL | | {
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.rs b/src/test/ui/rfc-2093-infer-outlives/explicit-struct.rs
index d42c9160e1e..4dc01a52210 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-struct.rs
@@ -9,10 +9,9 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<'b, U> { //~ ERROR 15:1: 17:2: rustc_outlives
+struct Foo<'b, U> { //~ ERROR 14:1: 16:2: rustc_outlives
     bar: Bar<'b, U>
 }
 
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr
index 0223f707e8d..7655dec5cb8 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/explicit-struct.rs:15:1
+  --> $DIR/explicit-struct.rs:14:1
    |
-LL | / struct Foo<'b, U> { //~ ERROR 15:1: 17:2: rustc_outlives
+LL | / struct Foo<'b, U> { //~ ERROR 14:1: 16:2: rustc_outlives
 LL | |     bar: Bar<'b, U>
 LL | | }
    | |_^
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-union.rs b/src/test/ui/rfc-2093-infer-outlives/explicit-union.rs
index e548b247193..ae4b9b15f68 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-union.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-union.rs
@@ -9,13 +9,11 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 #![feature(untagged_unions)]
 #![allow(unions_with_drop_fields)]
 
-
 #[rustc_outlives]
-union Foo<'b, U> { //~ ERROR 18:1: 20:2: rustc_outlives
+union Foo<'b, U> { //~ ERROR 16:1: 18:2: rustc_outlives
     bar: Bar<'b, U>
 }
 
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr
index 8622ae12aa1..c01c7532c86 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/explicit-union.rs:18:1
+  --> $DIR/explicit-union.rs:16:1
    |
-LL | / union Foo<'b, U> { //~ ERROR 18:1: 20:2: rustc_outlives
+LL | / union Foo<'b, U> { //~ ERROR 16:1: 18:2: rustc_outlives
 LL | |     bar: Bar<'b, U>
 LL | | }
    | |_^
diff --git a/src/test/ui/rfc-2093-infer-outlives/infer-static.rs b/src/test/ui/rfc-2093-infer-outlives/infer-static.rs
index aeca18c24b3..c4407b8b89f 100644
--- a/src/test/ui/rfc-2093-infer-outlives/infer-static.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/infer-static.rs
@@ -9,11 +9,10 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 #![feature(infer_static_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<U> { //~ ERROR 16:1: 18:2: rustc_outlives
+struct Foo<U> { //~ ERROR 15:1: 17:2: rustc_outlives
     bar: Bar<U>
 }
 struct Bar<T: 'static> {
diff --git a/src/test/ui/rfc-2093-infer-outlives/infer-static.stderr b/src/test/ui/rfc-2093-infer-outlives/infer-static.stderr
index f167e522df6..0cb4f3faa33 100644
--- a/src/test/ui/rfc-2093-infer-outlives/infer-static.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/infer-static.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/infer-static.rs:16:1
+  --> $DIR/infer-static.rs:15:1
    |
-LL | / struct Foo<U> { //~ ERROR 16:1: 18:2: rustc_outlives
+LL | / struct Foo<U> { //~ ERROR 15:1: 17:2: rustc_outlives
 LL | |     bar: Bar<U>
 LL | | }
    | |_^
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-enum.rs b/src/test/ui/rfc-2093-infer-outlives/nested-enum.rs
index 85f381ea515..5cb365b7a7b 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-enum.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-enum.rs
@@ -9,11 +9,9 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
-
 
 #[rustc_outlives]
-enum Foo<'a, T> { //~ ERROR 16:1: 19:2: rustc_outlives
+enum Foo<'a, T> { //~ ERROR 14:1: 17:2: rustc_outlives
 
     One(Bar<'a, T>)
 }
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr
index 54a886a92fd..f0a6905d14b 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/nested-enum.rs:16:1
+  --> $DIR/nested-enum.rs:14:1
    |
-LL | / enum Foo<'a, T> { //~ ERROR 16:1: 19:2: rustc_outlives
+LL | / enum Foo<'a, T> { //~ ERROR 14:1: 17:2: rustc_outlives
 LL | |
 LL | |     One(Bar<'a, T>)
 LL | | }
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-regions.rs b/src/test/ui/rfc-2093-infer-outlives/nested-regions.rs
index 792d2a02962..e56d7d7a053 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-regions.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-regions.rs
@@ -9,10 +9,9 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<'a, 'b, T> { //~ ERROR 15:1: 17:2: rustc_outlives
+struct Foo<'a, 'b, T> { //~ ERROR 14:1: 16:2: rustc_outlives
     x: &'a &'b T
 }
 
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr
index 04fe4814a04..978fe352bc7 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/nested-regions.rs:15:1
+  --> $DIR/nested-regions.rs:14:1
    |
-LL | / struct Foo<'a, 'b, T> { //~ ERROR 15:1: 17:2: rustc_outlives
+LL | / struct Foo<'a, 'b, T> { //~ ERROR 14:1: 16:2: rustc_outlives
 LL | |     x: &'a &'b T
 LL | | }
    | |_^
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-structs.rs b/src/test/ui/rfc-2093-infer-outlives/nested-structs.rs
index 71a36dfb344..84d1b881880 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-structs.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-structs.rs
@@ -9,10 +9,9 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<'a, T> { //~ ERROR 15:1: 17:2: rustc_outlives
+struct Foo<'a, T> { //~ ERROR 14:1: 16:2: rustc_outlives
     field1: Bar<'a, T>
 }
 
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr
index abea71f2d12..db02232b913 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/nested-structs.rs:15:1
+  --> $DIR/nested-structs.rs:14:1
    |
-LL | / struct Foo<'a, T> { //~ ERROR 15:1: 17:2: rustc_outlives
+LL | / struct Foo<'a, T> { //~ ERROR 14:1: 16:2: rustc_outlives
 LL | |     field1: Bar<'a, T>
 LL | | }
    | |_^
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-union.rs b/src/test/ui/rfc-2093-infer-outlives/nested-union.rs
index 0720e581e2c..974675f51c7 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-union.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-union.rs
@@ -9,13 +9,11 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 #![feature(untagged_unions)]
 #![allow(unions_with_drop_fields)]
 
-
 #[rustc_outlives]
-union Foo<'a, T> { //~ ERROR 18:1: 20:2: rustc_outlives
+union Foo<'a, T> { //~ ERROR 16:1: 18:2: rustc_outlives
     field1: Bar<'a, T>
 }
 
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr
index b7b50c15061..2704a1d2def 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/nested-union.rs:18:1
+  --> $DIR/nested-union.rs:16:1
    |
-LL | / union Foo<'a, T> { //~ ERROR 18:1: 20:2: rustc_outlives
+LL | / union Foo<'a, T> { //~ ERROR 16:1: 18:2: rustc_outlives
 LL | |     field1: Bar<'a, T>
 LL | | }
    | |_^
diff --git a/src/test/ui/rfc-2093-infer-outlives/privacy.rs b/src/test/ui/rfc-2093-infer-outlives/privacy.rs
new file mode 100644
index 00000000000..180f5ac6cdc
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/privacy.rs
@@ -0,0 +1,20 @@
+// Test that we do not get a privacy error here.  Initially, we did,
+// because we inferred an outlives predciate of `<Foo<'a> as
+// Private>::Out: 'a`, but the private trait is -- well -- private,
+// and hence it was not something that a pub trait could refer to.
+//
+// run-pass
+
+#![allow(dead_code)]
+
+pub struct Foo<'a> {
+    field: Option<&'a <Foo<'a> as Private>::Out>
+}
+
+trait Private {
+    type Out: ?Sized;
+}
+
+impl<T: ?Sized> Private for T { type Out = Self; }
+
+fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/projection.rs b/src/test/ui/rfc-2093-infer-outlives/projection.rs
index 3abce873b28..7693d0e9401 100644
--- a/src/test/ui/rfc-2093-infer-outlives/projection.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/projection.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
 struct Foo<'a, T: Iterator> { //~ ERROR rustc_outlives
diff --git a/src/test/ui/rfc-2093-infer-outlives/projection.stderr b/src/test/ui/rfc-2093-infer-outlives/projection.stderr
index dfaf7793a51..fb4835ae2d8 100644
--- a/src/test/ui/rfc-2093-infer-outlives/projection.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/projection.stderr
@@ -1,5 +1,5 @@
 error: rustc_outlives
-  --> $DIR/projection.rs:15:1
+  --> $DIR/projection.rs:14:1
    |
 LL | / struct Foo<'a, T: Iterator> { //~ ERROR rustc_outlives
 LL | |     bar: &'a T::Item
diff --git a/src/test/ui/rfc-2093-infer-outlives/reference.rs b/src/test/ui/rfc-2093-infer-outlives/reference.rs
index 56b1bc3c7d1..760d9889bbe 100644
--- a/src/test/ui/rfc-2093-infer-outlives/reference.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/reference.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
 struct Foo<'a, T> { //~ ERROR rustc_outlives
diff --git a/src/test/ui/rfc-2093-infer-outlives/reference.stderr b/src/test/ui/rfc-2093-infer-outlives/reference.stderr
index 785d76e8f22..fdd312f9b89 100644
--- a/src/test/ui/rfc-2093-infer-outlives/reference.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/reference.stderr
@@ -1,5 +1,5 @@
 error: rustc_outlives
-  --> $DIR/reference.rs:15:1
+  --> $DIR/reference.rs:14:1
    |
 LL | / struct Foo<'a, T> { //~ ERROR rustc_outlives
 LL | |     bar: &'a T,
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs
new file mode 100644
index 00000000000..a2d3cf6779f
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs
@@ -0,0 +1,50 @@
+// Copyright 2014 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.
+
+// ignore-tidy-linelength
+
+// Various examples of structs whose fields are not well-formed.
+
+#![allow(dead_code)]
+
+trait Dummy<'a> {
+  type Out;
+}
+impl<'a, T> Dummy<'a> for T
+where T: 'a
+{
+  type Out = ();
+}
+type RequireOutlives<'a, T> = <T as Dummy<'a>>::Out;
+
+enum Ref1<'a, T> {
+    Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
+}
+
+enum Ref2<'a, T> {
+    Ref2Variant1,
+    Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
+}
+
+enum RefOk<'a, T:'a> {
+    RefOkVariant1(&'a T)
+}
+
+// This is now well formed. RFC 2093
+enum RefIndirect<'a, T> {
+    RefIndirectVariant1(isize, RefOk<'a,T>)
+}
+
+enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
+    RefDoubleVariant1(&'a RequireOutlives<'b, T>)
+        //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
+}
+
+fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr
new file mode 100644
index 00000000000..923ea17622a
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr
@@ -0,0 +1,67 @@
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-enum-not-wf.rs:28:18
+   |
+LL | enum Ref1<'a, T> {
+   |               - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
+   |                  ^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: ...so that the type `T` will meet its required lifetime bounds
+  --> $DIR/regions-enum-not-wf.rs:28:18
+   |
+LL |     Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
+   |                  ^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-enum-not-wf.rs:33:25
+   |
+LL | enum Ref2<'a, T> {
+   |               - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     Ref2Variant1,
+LL |     Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
+   |                         ^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: ...so that the type `T` will meet its required lifetime bounds
+  --> $DIR/regions-enum-not-wf.rs:33:25
+   |
+LL |     Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
+   |                         ^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-enum-not-wf.rs:45:1
+   |
+LL |   enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
+   |   ^                      - help: consider adding an explicit lifetime bound `T: 'b`...
+   |  _|
+   | |
+LL | |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
+LL | |         //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
+LL | | }
+   | |_^
+   |
+note: ...so that the type `T` will meet its required lifetime bounds
+  --> $DIR/regions-enum-not-wf.rs:45:1
+   |
+LL | / enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
+LL | |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
+LL | |         //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
+LL | | }
+   | |_^
+
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-enum-not-wf.rs:46:23
+   |
+LL | enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
+   |                        - help: consider adding an explicit lifetime bound `T: 'b`...
+LL |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: ...so that the type `T` will meet its required lifetime bounds
+  --> $DIR/regions-enum-not-wf.rs:46:23
+   |
+LL |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs
new file mode 100644
index 00000000000..44af621ef24
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs
@@ -0,0 +1,32 @@
+// Copyright 2014 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 a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod rev_variant_struct_region {
+    struct Foo<'a> {
+        x: fn(&'a i32),
+    }
+    trait Trait<'a, 'b> {
+        type Out;
+    }
+    impl<'a, 'b> Trait<'a, 'b> for usize {
+        type Out = &'a Foo<'b>; //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr
new file mode 100644
index 00000000000..bd4682f0acf
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a rev_variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-region-rev.rs:27:9
+   |
+LL |         type Out = &'a Foo<'b>; //~ ERROR reference has a longer lifetime
+   |         ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the impl at 26:10
+  --> $DIR/regions-outlives-nominal-type-region-rev.rs:26:10
+   |
+LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
+   |          ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 26:14
+  --> $DIR/regions-outlives-nominal-type-region-rev.rs:26:14
+   |
+LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
+   |              ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs
new file mode 100644
index 00000000000..93f16350a7b
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs
@@ -0,0 +1,32 @@
+// Copyright 2014 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 a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod variant_struct_region {
+    struct Foo<'a> {
+        x: &'a i32,
+    }
+    trait Trait<'a, 'b> {
+        type Out;
+    }
+    impl<'a, 'b> Trait<'a, 'b> for usize {
+        type Out = &'a Foo<'b>; //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr
new file mode 100644
index 00000000000..3fdfb673b37
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-region.rs:27:9
+   |
+LL |         type Out = &'a Foo<'b>; //~ ERROR reference has a longer lifetime
+   |         ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the impl at 26:10
+  --> $DIR/regions-outlives-nominal-type-region.rs:26:10
+   |
+LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
+   |          ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 26:14
+  --> $DIR/regions-outlives-nominal-type-region.rs:26:14
+   |
+LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
+   |              ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs
new file mode 100644
index 00000000000..e44e049a9e5
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs
@@ -0,0 +1,32 @@
+// Copyright 2014 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 a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod variant_struct_type {
+    struct Foo<T> {
+        x: fn(T)
+    }
+    trait Trait<'a, 'b> {
+        type Out;
+    }
+    impl<'a, 'b> Trait<'a, 'b> for usize {
+        type Out = &'a Foo<&'b i32>; //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr
new file mode 100644
index 00000000000..166e95cdedd
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-type-rev.rs:27:9
+   |
+LL |         type Out = &'a Foo<&'b i32>; //~ ERROR reference has a longer lifetime
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the impl at 26:10
+  --> $DIR/regions-outlives-nominal-type-type-rev.rs:26:10
+   |
+LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
+   |          ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 26:14
+  --> $DIR/regions-outlives-nominal-type-type-rev.rs:26:14
+   |
+LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
+   |              ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs
new file mode 100644
index 00000000000..1293e6c234b
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs
@@ -0,0 +1,32 @@
+// Copyright 2014 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 a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod variant_struct_type {
+    struct Foo<T> {
+        x: T
+    }
+    trait Trait<'a, 'b> {
+        type Out;
+    }
+    impl<'a, 'b> Trait<'a, 'b> for usize {
+        type Out = &'a Foo<&'b i32>; //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr
new file mode 100644
index 00000000000..54952ec1676
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-type.rs:27:9
+   |
+LL |         type Out = &'a Foo<&'b i32>; //~ ERROR reference has a longer lifetime
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the impl at 26:10
+  --> $DIR/regions-outlives-nominal-type-type.rs:26:10
+   |
+LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
+   |          ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 26:14
+  --> $DIR/regions-outlives-nominal-type-type.rs:26:14
+   |
+LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
+   |              ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs
new file mode 100644
index 00000000000..bdd708197bc
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs
@@ -0,0 +1,38 @@
+// Copyright 2014 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.
+
+// Various examples of structs whose fields are not well-formed.
+
+#![allow(dead_code)]
+
+trait Trait<'a, T> {
+    type Out;
+}
+trait Trait1<'a, 'b, T> {
+    type Out;
+}
+
+impl<'a, T> Trait<'a, T> for usize {
+    type Out = &'a T;
+}
+
+struct RefOk<'a, T:'a> {
+    field: &'a T
+}
+
+impl<'a, T> Trait<'a, T> for u32 {
+    type Out = RefOk<'a, T>;
+}
+
+impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
+    type Out = &'a &'b T;
+}
+
+fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
new file mode 100644
index 00000000000..d8c8b6c3ccc
--- /dev/null
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
@@ -0,0 +1,49 @@
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-struct-not-wf.rs:23:5
+   |
+LL | impl<'a, T> Trait<'a, T> for usize {
+   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     type Out = &'a T;
+   |     ^^^^^^^^^^^^^^^^^
+   |
+note: ...so that the reference type `&'a T` does not outlive the data it points at
+  --> $DIR/regions-struct-not-wf.rs:23:5
+   |
+LL |     type Out = &'a T;
+   |     ^^^^^^^^^^^^^^^^^
+
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-struct-not-wf.rs:31:5
+   |
+LL | impl<'a, T> Trait<'a, T> for u32 {
+   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     type Out = RefOk<'a, T>;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: ...so that the type `T` will meet its required lifetime bounds
+  --> $DIR/regions-struct-not-wf.rs:31:5
+   |
+LL |     type Out = RefOk<'a, T>;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-struct-not-wf.rs:35:5
+   |
+LL |     type Out = &'a &'b T;
+   |     ^^^^^^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the impl at 34:6
+  --> $DIR/regions-struct-not-wf.rs:34:6
+   |
+LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
+   |      ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 34:10
+  --> $DIR/regions-struct-not-wf.rs:34:10
+   |
+LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
+   |          ^^
+
+error: aborting due to 3 previous errors
+
+Some errors occurred: E0309, E0491.
+For more information about an error, try `rustc --explain E0309`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/self-dyn.rs b/src/test/ui/rfc-2093-infer-outlives/self-dyn.rs
index a19bcf8afff..37c468f2f83 100644
--- a/src/test/ui/rfc-2093-infer-outlives/self-dyn.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/self-dyn.rs
@@ -10,14 +10,13 @@
 
 #![feature(dyn_trait)]
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 
 trait Trait<'x, 's, T> where T: 'x,
       's: {
 }
 
 #[rustc_outlives]
-struct Foo<'a, 'b, A> //~ ERROR 20:1: 23:2: rustc_outlives
+struct Foo<'a, 'b, A> //~ ERROR 19:1: 22:2: rustc_outlives
 {
     foo: Box<dyn Trait<'a, 'b, A>>
 }
diff --git a/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr b/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr
index 546ba9db644..8c69307ddfb 100644
--- a/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/self-dyn.rs:20:1
+  --> $DIR/self-dyn.rs:19:1
    |
-LL | / struct Foo<'a, 'b, A> //~ ERROR 20:1: 23:2: rustc_outlives
+LL | / struct Foo<'a, 'b, A> //~ ERROR 19:1: 22:2: rustc_outlives
 LL | | {
 LL | |     foo: Box<dyn Trait<'a, 'b, A>>
 LL | | }
diff --git a/src/test/ui/rfc-2093-infer-outlives/self-structs.rs b/src/test/ui/rfc-2093-infer-outlives/self-structs.rs
index c4f8f83bdce..82d13d9179a 100644
--- a/src/test/ui/rfc-2093-infer-outlives/self-structs.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/self-structs.rs
@@ -9,10 +9,9 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
-#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<'a, 'b, T> { //~ ERROR 15:1: 17:2: rustc_outlives
+struct Foo<'a, 'b, T> { //~ ERROR 14:1: 16:2: rustc_outlives
     field1: Bar<'a, 'b, T>
 }
 
diff --git a/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr b/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr
index 04284577a07..541e282f238 100644
--- a/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/self-structs.rs:15:1
+  --> $DIR/self-structs.rs:14:1
    |
-LL | / struct Foo<'a, 'b, T> { //~ ERROR 15:1: 17:2: rustc_outlives
+LL | / struct Foo<'a, 'b, T> { //~ ERROR 14:1: 16:2: rustc_outlives
 LL | |     field1: Bar<'a, 'b, T>
 LL | | }
    | |_^
diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.stderr b/src/test/ui/typeck/typeck_type_placeholder_item.stderr
index 3f814085955..598f18bf8d8 100644
--- a/src/test/ui/typeck/typeck_type_placeholder_item.stderr
+++ b/src/test/ui/typeck/typeck_type_placeholder_item.stderr
@@ -77,6 +77,24 @@ LL |     b: (_, _),
    |            ^ not allowed in type signatures
 
 error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/typeck_type_placeholder_item.rs:112:12
+   |
+LL |         a: _,
+   |            ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/typeck_type_placeholder_item.rs:114:13
+   |
+LL |         b: (_, _),
+   |             ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/typeck_type_placeholder_item.rs:114:16
+   |
+LL |         b: (_, _),
+   |                ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:67:21
    |
 LL |     fn fn_test() -> _ { 5 }
@@ -137,24 +155,6 @@ LL |     fn fn_test8(_f: fn() -> _) { }
    |                             ^ not allowed in type signatures
 
 error[E0121]: the type placeholder `_` is not allowed within types on item signatures
-  --> $DIR/typeck_type_placeholder_item.rs:112:12
-   |
-LL |         a: _,
-   |            ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures
-  --> $DIR/typeck_type_placeholder_item.rs:114:13
-   |
-LL |         b: (_, _),
-   |             ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures
-  --> $DIR/typeck_type_placeholder_item.rs:114:16
-   |
-LL |         b: (_, _),
-   |                ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:43:24
    |
 LL |     fn test9(&self) -> _ { () }
diff --git a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs b/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs
index c11b2e4c544..afdf59d1e5b 100644
--- a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs
+++ b/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs
@@ -8,25 +8,26 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// Test that an appearance of `T` in fn args or in a trait object must
-// still meet the outlives bounds. Since this is a new requirement,
-// this is currently only a warning, not a hard error.
-
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
-trait Trait<T> { }
+trait Trait<'a, T> {
+    type Out;
+}
+
+impl<'a, T> Trait<'a, T> for usize {
+    type Out = &'a fn(T);
+}
 
 struct Foo<'a,T> {
     f: &'a fn(T),
-    //~^ ERROR E0309
 }
 
-struct Bar<'a,T> {
-    f: &'a Trait<T>,
-    //~^ ERROR E0309
+trait Baz<T> { }
+
+impl<'a, T> Trait<'a, T> for u32 {
+    type Out = &'a Baz<T>;
 }
 
-#[rustc_error]
 fn main() { }
 
diff --git a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr b/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
index 9a8c63126f2..26a2138c9f8 100644
--- a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
+++ b/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
@@ -1,30 +1,30 @@
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:21:5
+  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:5
    |
-LL | struct Foo<'a,T> {
-   |               - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     f: &'a fn(T),
-   |     ^^^^^^^^^^^^
+LL | impl<'a, T> Trait<'a, T> for usize {
+   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     type Out = &'a fn(T);
+   |     ^^^^^^^^^^^^^^^^^^^^^
    |
 note: ...so that the reference type `&'a fn(T)` does not outlive the data it points at
-  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:21:5
+  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:5
    |
-LL |     f: &'a fn(T),
-   |     ^^^^^^^^^^^^
+LL |     type Out = &'a fn(T);
+   |     ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:26:5
+  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:29:5
    |
-LL | struct Bar<'a,T> {
-   |               - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     f: &'a Trait<T>,
-   |     ^^^^^^^^^^^^^^^
+LL | impl<'a, T> Trait<'a, T> for u32 {
+   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     type Out = &'a Baz<T>;
+   |     ^^^^^^^^^^^^^^^^^^^^^^
    |
-note: ...so that the reference type `&'a (dyn Trait<T> + 'a)` does not outlive the data it points at
-  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:26:5
+note: ...so that the reference type `&'a (dyn Baz<T> + 'a)` does not outlive the data it points at
+  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:29:5
    |
-LL |     f: &'a Trait<T>,
-   |     ^^^^^^^^^^^^^^^
+LL |     type Out = &'a Baz<T>;
+   |     ^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors