about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/cycle-trait-supertrait-indirect.rs2
-rw-r--r--src/test/ui/cycle-trait-supertrait-indirect.stderr2
-rw-r--r--src/test/ui/error-codes/E0657.rs6
-rw-r--r--src/test/ui/error-codes/E0657.stderr12
-rw-r--r--src/test/ui/impl-trait/auto-trait-leak.rs2
-rw-r--r--src/test/ui/impl-trait/auto-trait-leak.stderr2
-rw-r--r--src/test/ui/impl_trait_projections.rs50
-rw-r--r--src/test/ui/impl_trait_projections.stderr34
-rw-r--r--src/test/ui/issue-12511.rs2
-rw-r--r--src/test/ui/issue-12511.stderr2
-rw-r--r--src/test/ui/issue-23302-1.rs (renamed from src/test/ui/issue-23302.rs)13
-rw-r--r--src/test/ui/issue-23302-1.stderr15
-rw-r--r--src/test/ui/issue-23302-2.rs18
-rw-r--r--src/test/ui/issue-23302-2.stderr15
-rw-r--r--src/test/ui/issue-23302-3.rs15
-rw-r--r--src/test/ui/issue-23302-3.stderr20
-rw-r--r--src/test/ui/issue-23302.stderr26
-rw-r--r--src/test/ui/issue-36163.rs10
-rw-r--r--src/test/ui/issue-36163.stderr30
-rw-r--r--src/test/ui/issue-47706.rs15
-rw-r--r--src/test/ui/issue-47706.stderr21
-rw-r--r--src/test/ui/nested_impl_trait.rs41
-rw-r--r--src/test/ui/nested_impl_trait.stderr50
-rw-r--r--src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr94
-rw-r--r--src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr102
-rw-r--r--src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr126
-rw-r--r--src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr108
-rw-r--r--src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr228
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr28
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr126
-rw-r--r--src/test/ui/resolve/issue-23305.rs2
-rw-r--r--src/test/ui/resolve/issue-23305.stderr2
-rw-r--r--src/test/ui/unsafe-block-without-braces.rs16
-rw-r--r--src/test/ui/unsafe-block-without-braces.stderr10
34 files changed, 759 insertions, 486 deletions
diff --git a/src/test/ui/cycle-trait-supertrait-indirect.rs b/src/test/ui/cycle-trait-supertrait-indirect.rs
index c3b0276bcf9..447505e886f 100644
--- a/src/test/ui/cycle-trait-supertrait-indirect.rs
+++ b/src/test/ui/cycle-trait-supertrait-indirect.rs
@@ -18,7 +18,7 @@ trait B: C {
 }
 
 trait C: B { }
-    //~^ ERROR unsupported cyclic reference
+    //~^ ERROR cyclic dependency detected
     //~| cyclic reference
 
 fn main() { }
diff --git a/src/test/ui/cycle-trait-supertrait-indirect.stderr b/src/test/ui/cycle-trait-supertrait-indirect.stderr
index 107644037a9..a0156554646 100644
--- a/src/test/ui/cycle-trait-supertrait-indirect.stderr
+++ b/src/test/ui/cycle-trait-supertrait-indirect.stderr
@@ -1,4 +1,4 @@
-error[E0391]: unsupported cyclic reference between types/traits detected
+error[E0391]: cyclic dependency detected
   --> $DIR/cycle-trait-supertrait-indirect.rs:20:1
    |
 20 | trait C: B { }
diff --git a/src/test/ui/error-codes/E0657.rs b/src/test/ui/error-codes/E0657.rs
index 4595e413081..31b3acd86ef 100644
--- a/src/test/ui/error-codes/E0657.rs
+++ b/src/test/ui/error-codes/E0657.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 #![allow(warnings)]
-#![feature(conservative_impl_trait, nested_impl_trait)]
+#![feature(conservative_impl_trait)]
 
 trait Id<T> {}
 trait Lt<'a> {}
@@ -17,7 +17,7 @@ impl<'a> Lt<'a> for () {}
 impl<T> Id<T> for T {}
 
 fn free_fn_capture_hrtb_in_impl_trait()
-    -> impl for<'a> Id<impl Lt<'a>>
+    -> Box<for<'a> Id<impl Lt<'a>>>
         //~^ ERROR `impl Trait` can only capture lifetimes bound at the fn or impl level [E0657]
 {
     ()
@@ -26,7 +26,7 @@ fn free_fn_capture_hrtb_in_impl_trait()
 struct Foo;
 impl Foo {
     fn impl_fn_capture_hrtb_in_impl_trait()
-        -> impl for<'a> Id<impl Lt<'a>>
+        -> Box<for<'a> Id<impl Lt<'a>>>
             //~^ ERROR `impl Trait` can only capture lifetimes bound at the fn or impl level
     {
         ()
diff --git a/src/test/ui/error-codes/E0657.stderr b/src/test/ui/error-codes/E0657.stderr
index d3b53d37a30..e039d645fa6 100644
--- a/src/test/ui/error-codes/E0657.stderr
+++ b/src/test/ui/error-codes/E0657.stderr
@@ -1,14 +1,14 @@
 error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl level
-  --> $DIR/E0657.rs:20:32
+  --> $DIR/E0657.rs:20:31
    |
-20 |     -> impl for<'a> Id<impl Lt<'a>>
-   |                                ^^
+20 |     -> Box<for<'a> Id<impl Lt<'a>>>
+   |                               ^^
 
 error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl level
-  --> $DIR/E0657.rs:29:36
+  --> $DIR/E0657.rs:29:35
    |
-29 |         -> impl for<'a> Id<impl Lt<'a>>
-   |                                    ^^
+29 |         -> Box<for<'a> Id<impl Lt<'a>>>
+   |                                   ^^
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/impl-trait/auto-trait-leak.rs b/src/test/ui/impl-trait/auto-trait-leak.rs
index 705390e3b96..5a6aac43ec7 100644
--- a/src/test/ui/impl-trait/auto-trait-leak.rs
+++ b/src/test/ui/impl-trait/auto-trait-leak.rs
@@ -42,7 +42,7 @@ fn after() -> impl Fn(i32) {
 // independently resolved and only require the concrete
 // return type, which can't depend on the obligation.
 fn cycle1() -> impl Clone {
-    //~^ ERROR unsupported cyclic reference between types/traits detected
+    //~^ ERROR cyclic dependency detected
     //~| cyclic reference
     send(cycle2().clone());
 
diff --git a/src/test/ui/impl-trait/auto-trait-leak.stderr b/src/test/ui/impl-trait/auto-trait-leak.stderr
index 838a3002e3a..d6e31ba1e1f 100644
--- a/src/test/ui/impl-trait/auto-trait-leak.stderr
+++ b/src/test/ui/impl-trait/auto-trait-leak.stderr
@@ -28,7 +28,7 @@ note: required by `send`
 24 | fn send<T: Send>(_: T) {}
    | ^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0391]: unsupported cyclic reference between types/traits detected
+error[E0391]: cyclic dependency detected
   --> $DIR/auto-trait-leak.rs:44:1
    |
 44 | fn cycle1() -> impl Clone {
diff --git a/src/test/ui/impl_trait_projections.rs b/src/test/ui/impl_trait_projections.rs
new file mode 100644
index 00000000000..f69a78b1450
--- /dev/null
+++ b/src/test/ui/impl_trait_projections.rs
@@ -0,0 +1,50 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+#![feature(dyn_trait, conservative_impl_trait, universal_impl_trait)]
+
+use std::fmt::Debug;
+use std::option;
+
+fn parametrized_type_is_allowed() -> Option<impl Debug> {
+    Some(5i32)
+}
+
+fn path_parametrized_type_is_allowed() -> option::Option<impl Debug> {
+    Some(5i32)
+}
+
+fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
+//~^ ERROR `impl Trait` is not allowed in path parameters
+//~^^ ERROR ambiguous associated type
+    x.next().unwrap()
+}
+
+fn projection_with_named_trait_is_disallowed(x: impl Iterator)
+    -> <impl Iterator as Iterator>::Item
+//~^ ERROR `impl Trait` is not allowed in path parameters
+{
+    x.next().unwrap()
+}
+
+fn projection_with_named_trait_inside_path_is_disallowed()
+    -> <::std::ops::Range<impl Debug> as Iterator>::Item
+//~^ ERROR `impl Trait` is not allowed in path parameters
+{
+    (1i32..100).next().unwrap()
+}
+
+fn projection_from_impl_trait_inside_dyn_trait_is_disallowed()
+    -> <dyn Iterator<Item = impl Debug> as Iterator>::Item
+//~^ ERROR `impl Trait` is not allowed in path parameters
+{
+    panic!()
+}
+
+fn main() {}
diff --git a/src/test/ui/impl_trait_projections.stderr b/src/test/ui/impl_trait_projections.stderr
new file mode 100644
index 00000000000..08de0eb99a3
--- /dev/null
+++ b/src/test/ui/impl_trait_projections.stderr
@@ -0,0 +1,34 @@
+error[E0667]: `impl Trait` is not allowed in path parameters
+  --> $DIR/impl_trait_projections.rs:23:51
+   |
+23 | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
+   |                                                   ^^^^^^^^^^^^^
+
+error[E0667]: `impl Trait` is not allowed in path parameters
+  --> $DIR/impl_trait_projections.rs:30:9
+   |
+30 |     -> <impl Iterator as Iterator>::Item
+   |         ^^^^^^^^^^^^^
+
+error[E0667]: `impl Trait` is not allowed in path parameters
+  --> $DIR/impl_trait_projections.rs:37:27
+   |
+37 |     -> <::std::ops::Range<impl Debug> as Iterator>::Item
+   |                           ^^^^^^^^^^
+
+error[E0667]: `impl Trait` is not allowed in path parameters
+  --> $DIR/impl_trait_projections.rs:44:29
+   |
+44 |     -> <dyn Iterator<Item = impl Debug> as Iterator>::Item
+   |                             ^^^^^^^^^^
+
+error[E0223]: ambiguous associated type
+  --> $DIR/impl_trait_projections.rs:23:50
+   |
+23 | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
+   |                                                  ^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type
+   |
+   = note: specify the type using the syntax `<impl std::iter::Iterator as Trait>::Item`
+
+error: aborting due to 5 previous errors
+
diff --git a/src/test/ui/issue-12511.rs b/src/test/ui/issue-12511.rs
index e1335c7d558..e4d60768687 100644
--- a/src/test/ui/issue-12511.rs
+++ b/src/test/ui/issue-12511.rs
@@ -12,7 +12,7 @@ trait t1 : t2 {
 }
 
 trait t2 : t1 {
-//~^ ERROR unsupported cyclic reference between types/traits detected
+//~^ ERROR cyclic dependency detected
 //~| cyclic reference
 }
 
diff --git a/src/test/ui/issue-12511.stderr b/src/test/ui/issue-12511.stderr
index cbf005a70b0..aec828a90d1 100644
--- a/src/test/ui/issue-12511.stderr
+++ b/src/test/ui/issue-12511.stderr
@@ -1,4 +1,4 @@
-error[E0391]: unsupported cyclic reference between types/traits detected
+error[E0391]: cyclic dependency detected
   --> $DIR/issue-12511.rs:14:1
    |
 14 | trait t2 : t1 {
diff --git a/src/test/ui/issue-23302.rs b/src/test/ui/issue-23302-1.rs
index 2d93ab0c30c..10a53830116 100644
--- a/src/test/ui/issue-23302.rs
+++ b/src/test/ui/issue-23302-1.rs
@@ -11,18 +11,7 @@
 // Check that an enum with recursion in the discriminant throws
 // the appropriate error (rather than, say, blowing the stack).
 enum X {
-    A = X::A as isize, //~ ERROR E0265
+    A = X::A as isize, //~ ERROR E0391
 }
 
-// Since `Y::B` here defaults to `Y::A+1`, this is also a
-// recursive definition.
-enum Y {
-    A = Y::B as isize, //~ ERROR E0265
-    B,
-}
-
-const A: i32 = B; //~ ERROR E0265
-
-const B: i32 = A; //~ ERROR E0265
-
 fn main() { }
diff --git a/src/test/ui/issue-23302-1.stderr b/src/test/ui/issue-23302-1.stderr
new file mode 100644
index 00000000000..0658c07fb1d
--- /dev/null
+++ b/src/test/ui/issue-23302-1.stderr
@@ -0,0 +1,15 @@
+error[E0391]: cyclic dependency detected
+  --> $DIR/issue-23302-1.rs:14:9
+   |
+14 |     A = X::A as isize, //~ ERROR E0391
+   |         ^^^^^^^^^^^^^ cyclic reference
+   |
+note: the cycle begins when const-evaluating `X::A::{{initializer}}`...
+  --> $DIR/issue-23302-1.rs:14:5
+   |
+14 |     A = X::A as isize, //~ ERROR E0391
+   |     ^^^^^^^^^^^^^^^^^
+   = note: ...which then again requires const-evaluating `X::A::{{initializer}}`, completing the cycle.
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/issue-23302-2.rs b/src/test/ui/issue-23302-2.rs
new file mode 100644
index 00000000000..d1af19eb579
--- /dev/null
+++ b/src/test/ui/issue-23302-2.rs
@@ -0,0 +1,18 @@
+// 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.
+
+// Since `Y::B` here defaults to `Y::A+1`, this is also a
+// recursive definition.
+enum Y {
+    A = Y::B as isize, //~ ERROR E0391
+    B,
+}
+
+fn main() { }
diff --git a/src/test/ui/issue-23302-2.stderr b/src/test/ui/issue-23302-2.stderr
new file mode 100644
index 00000000000..c4a1c4f80c8
--- /dev/null
+++ b/src/test/ui/issue-23302-2.stderr
@@ -0,0 +1,15 @@
+error[E0391]: cyclic dependency detected
+  --> $DIR/issue-23302-2.rs:14:9
+   |
+14 |     A = Y::B as isize, //~ ERROR E0391
+   |         ^^^^^^^^^^^^^ cyclic reference
+   |
+note: the cycle begins when const-evaluating `Y::A::{{initializer}}`...
+  --> $DIR/issue-23302-2.rs:14:5
+   |
+14 |     A = Y::B as isize, //~ ERROR E0391
+   |     ^^^^^^^^^^^^^^^^^
+   = note: ...which then again requires const-evaluating `Y::A::{{initializer}}`, completing the cycle.
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/issue-23302-3.rs b/src/test/ui/issue-23302-3.rs
new file mode 100644
index 00000000000..1d750b09025
--- /dev/null
+++ b/src/test/ui/issue-23302-3.rs
@@ -0,0 +1,15 @@
+// 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.
+
+const A: i32 = B; //~ ERROR E0391
+
+const B: i32 = A;
+
+fn main() { }
diff --git a/src/test/ui/issue-23302-3.stderr b/src/test/ui/issue-23302-3.stderr
new file mode 100644
index 00000000000..76f543cff79
--- /dev/null
+++ b/src/test/ui/issue-23302-3.stderr
@@ -0,0 +1,20 @@
+error[E0391]: cyclic dependency detected
+  --> $DIR/issue-23302-3.rs:11:16
+   |
+11 | const A: i32 = B; //~ ERROR E0391
+   |                ^ cyclic reference
+   |
+note: the cycle begins when processing `B`...
+  --> $DIR/issue-23302-3.rs:13:1
+   |
+13 | const B: i32 = A;
+   | ^^^^^^^^^^^^^^^^^
+note: ...which then requires processing `A`...
+  --> $DIR/issue-23302-3.rs:13:16
+   |
+13 | const B: i32 = A;
+   |                ^
+   = note: ...which then again requires processing `B`, completing the cycle.
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/issue-23302.stderr b/src/test/ui/issue-23302.stderr
deleted file mode 100644
index 4e93809fac3..00000000000
--- a/src/test/ui/issue-23302.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-error[E0265]: recursive constant
-  --> $DIR/issue-23302.rs:14:9
-   |
-14 |     A = X::A as isize, //~ ERROR E0265
-   |         ^^^^^^^^^^^^^ recursion not allowed in constant
-
-error[E0265]: recursive constant
-  --> $DIR/issue-23302.rs:20:9
-   |
-20 |     A = Y::B as isize, //~ ERROR E0265
-   |         ^^^^^^^^^^^^^ recursion not allowed in constant
-
-error[E0265]: recursive constant
-  --> $DIR/issue-23302.rs:24:1
-   |
-24 | const A: i32 = B; //~ ERROR E0265
-   | ^^^^^^^^^^^^^^^^^ recursion not allowed in constant
-
-error[E0265]: recursive constant
-  --> $DIR/issue-23302.rs:26:1
-   |
-26 | const B: i32 = A; //~ ERROR E0265
-   | ^^^^^^^^^^^^^^^^^ recursion not allowed in constant
-
-error: aborting due to 4 previous errors
-
diff --git a/src/test/ui/issue-36163.rs b/src/test/ui/issue-36163.rs
index 2337f82afa4..4c74d9d9173 100644
--- a/src/test/ui/issue-36163.rs
+++ b/src/test/ui/issue-36163.rs
@@ -8,16 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const A: i32 = Foo::B; //~ ERROR E0265
+const A: isize = Foo::B as isize;
 
 enum Foo {
-    B = A, //~ ERROR E0265
+    B = A, //~ ERROR E0391
 }
 
-enum Bar {
-    C = Bar::C, //~ ERROR E0265
-}
-
-const D: i32 = A;
-
 fn main() {}
diff --git a/src/test/ui/issue-36163.stderr b/src/test/ui/issue-36163.stderr
index 5a107d88f2e..d0337fc32b0 100644
--- a/src/test/ui/issue-36163.stderr
+++ b/src/test/ui/issue-36163.stderr
@@ -1,20 +1,20 @@
-error[E0265]: recursive constant
-  --> $DIR/issue-36163.rs:11:1
-   |
-11 | const A: i32 = Foo::B; //~ ERROR E0265
-   | ^^^^^^^^^^^^^^^^^^^^^^ recursion not allowed in constant
-
-error[E0265]: recursive constant
+error[E0391]: cyclic dependency detected
   --> $DIR/issue-36163.rs:14:9
    |
-14 |     B = A, //~ ERROR E0265
-   |         ^ recursion not allowed in constant
-
-error[E0265]: recursive constant
-  --> $DIR/issue-36163.rs:18:9
+14 |     B = A, //~ ERROR E0391
+   |         ^ cyclic reference
+   |
+note: the cycle begins when const-evaluating `Foo::B::{{initializer}}`...
+  --> $DIR/issue-36163.rs:14:5
+   |
+14 |     B = A, //~ ERROR E0391
+   |     ^^^^^
+note: ...which then requires const-evaluating `A`...
+  --> $DIR/issue-36163.rs:14:9
    |
-18 |     C = Bar::C, //~ ERROR E0265
-   |         ^^^^^^ recursion not allowed in constant
+14 |     B = A, //~ ERROR E0391
+   |         ^
+   = note: ...which then again requires const-evaluating `Foo::B::{{initializer}}`, completing the cycle.
 
-error: aborting due to 3 previous errors
+error: aborting due to previous error
 
diff --git a/src/test/ui/issue-47706.rs b/src/test/ui/issue-47706.rs
index 24a0f66f5b1..9c521dd6479 100644
--- a/src/test/ui/issue-47706.rs
+++ b/src/test/ui/issue-47706.rs
@@ -22,3 +22,18 @@ impl Foo {
     }
     //~^^ ERROR function is expected to take 1 argument, but it takes 2 arguments [E0593]
 }
+
+enum Qux {
+    Bar(i32),
+}
+
+fn foo<F>(f: F)
+where
+    F: Fn(),
+{
+}
+
+fn main() {
+    foo(Qux::Bar);
+}
+//~^^ ERROR function is expected to take 0 arguments, but it takes 1 argument [E0593]
diff --git a/src/test/ui/issue-47706.stderr b/src/test/ui/issue-47706.stderr
index 0916dc64292..e197c09062d 100644
--- a/src/test/ui/issue-47706.stderr
+++ b/src/test/ui/issue-47706.stderr
@@ -1,5 +1,3 @@
-error[E0601]: main function not found
-
 error[E0593]: function is expected to take 1 argument, but it takes 2 arguments
   --> $DIR/issue-47706.rs:21:18
    |
@@ -9,5 +7,24 @@ error[E0593]: function is expected to take 1 argument, but it takes 2 arguments
 21 |         self.foo.map(Foo::new)
    |                  ^^^ expected function that takes 1 argument
 
+error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
+  --> $DIR/issue-47706.rs:37:5
+   |
+27 |     Bar(i32),
+   |     -------- takes 1 argument
+...
+37 |     foo(Qux::Bar);
+   |     ^^^ expected function that takes 0 arguments
+   |
+note: required by `foo`
+  --> $DIR/issue-47706.rs:30:1
+   |
+30 | / fn foo<F>(f: F)
+31 | | where
+32 | |     F: Fn(),
+33 | | {
+34 | | }
+   | |_^
+
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/nested_impl_trait.rs b/src/test/ui/nested_impl_trait.rs
new file mode 100644
index 00000000000..f6302c0f3b3
--- /dev/null
+++ b/src/test/ui/nested_impl_trait.rs
@@ -0,0 +1,41 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+#![feature(conservative_impl_trait, universal_impl_trait)]
+
+use std::fmt::Debug;
+
+fn fine(x: impl Into<u32>) -> impl Into<u32> { x }
+
+fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
+//~^ ERROR nested `impl Trait` is not allowed
+
+fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
+//~^ ERROR nested `impl Trait` is not allowed
+//~^^ `impl Trait` not allowed
+
+fn bad_in_arg_position(_: impl Into<impl Debug>) { }
+//~^ ERROR nested `impl Trait` is not allowed
+
+struct X;
+impl X {
+    fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
+    //~^ ERROR nested `impl Trait` is not allowed
+}
+
+fn allowed_in_assoc_type() -> impl Iterator<Item=impl Fn()> {
+    vec![|| println!("woot")].into_iter()
+}
+
+fn allowed_in_ret_type() -> impl Fn() -> impl Into<u32> {
+//~^ `impl Trait` not allowed
+    || 5
+}
+
+fn main() {}
diff --git a/src/test/ui/nested_impl_trait.stderr b/src/test/ui/nested_impl_trait.stderr
new file mode 100644
index 00000000000..094926120cd
--- /dev/null
+++ b/src/test/ui/nested_impl_trait.stderr
@@ -0,0 +1,50 @@
+error[E0666]: nested `impl Trait` is not allowed
+  --> $DIR/nested_impl_trait.rs:16:56
+   |
+16 | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
+   |                                              ----------^^^^^^^^^^-
+   |                                              |         |
+   |                                              |         nested `impl Trait` here
+   |                                              outer `impl Trait`
+
+error[E0666]: nested `impl Trait` is not allowed
+  --> $DIR/nested_impl_trait.rs:19:42
+   |
+19 | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
+   |                                ----------^^^^^^^^^^-
+   |                                |         |
+   |                                |         nested `impl Trait` here
+   |                                outer `impl Trait`
+
+error[E0666]: nested `impl Trait` is not allowed
+  --> $DIR/nested_impl_trait.rs:23:37
+   |
+23 | fn bad_in_arg_position(_: impl Into<impl Debug>) { }
+   |                           ----------^^^^^^^^^^-
+   |                           |         |
+   |                           |         nested `impl Trait` here
+   |                           outer `impl Trait`
+
+error[E0666]: nested `impl Trait` is not allowed
+  --> $DIR/nested_impl_trait.rs:28:44
+   |
+28 |     fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
+   |                                  ----------^^^^^^^^^^-
+   |                                  |         |
+   |                                  |         nested `impl Trait` here
+   |                                  outer `impl Trait`
+
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/nested_impl_trait.rs:19:32
+   |
+19 | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
+   |                                ^^^^^^^^^^^^^^^^^^^^^
+
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/nested_impl_trait.rs:36:42
+   |
+36 | fn allowed_in_ret_type() -> impl Fn() -> impl Into<u32> {
+   |                                          ^^^^^^^^^^^^^^
+
+error: aborting due to 6 previous errors
+
diff --git a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr
index b2e98b7c2f6..30669dc4c2f 100644
--- a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr
@@ -25,53 +25,6 @@ note: External requirements
    = note: number of external vids: 3
    = note: where <T as std::iter::Iterator>::Item: '_#2r
 
-note: External requirements
-  --> $DIR/projection-no-regions-closure.rs:46:23
-   |
-46 |     with_signature(x, |mut y| Box::new(y.next()))
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:18 ~ projection_no_regions_closure[317d]::correct_region[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               T,
-               i32,
-               extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<Anything + '_#2r>
-           ]
-   = note: number of external vids: 3
-   = note: where <T as std::iter::Iterator>::Item: '_#2r
-
-note: External requirements
-  --> $DIR/projection-no-regions-closure.rs:54:23
-   |
-54 |     with_signature(x, |mut y| Box::new(y.next()))
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:22 ~ projection_no_regions_closure[317d]::wrong_region[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               T,
-               i32,
-               extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<Anything + '_#3r>
-           ]
-   = note: number of external vids: 4
-   = note: where <T as std::iter::Iterator>::Item: '_#3r
-
-note: External requirements
-  --> $DIR/projection-no-regions-closure.rs:65:23
-   |
-65 |     with_signature(x, |mut y| Box::new(y.next()))
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:26 ~ projection_no_regions_closure[317d]::outlives_region[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               T,
-               i32,
-               extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<Anything + '_#3r>
-           ]
-   = note: number of external vids: 4
-   = note: where <T as std::iter::Iterator>::Item: '_#3r
-
 error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
   --> $DIR/projection-no-regions-closure.rs:36:23
    |
@@ -97,6 +50,21 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/projection-no-regions-closure.rs:46:23
+   |
+46 |     with_signature(x, |mut y| Box::new(y.next()))
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:18 ~ projection_no_regions_closure[317d]::correct_region[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               T,
+               i32,
+               extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<Anything + '_#2r>
+           ]
+   = note: number of external vids: 3
+   = note: where <T as std::iter::Iterator>::Item: '_#2r
+
 note: No external requirements
   --> $DIR/projection-no-regions-closure.rs:42:1
    |
@@ -113,6 +81,22 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/projection-no-regions-closure.rs:54:23
+   |
+54 |     with_signature(x, |mut y| Box::new(y.next()))
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:22 ~ projection_no_regions_closure[317d]::wrong_region[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               T,
+               i32,
+               extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<Anything + '_#3r>
+           ]
+   = note: number of external vids: 4
+   = note: where <T as std::iter::Iterator>::Item: '_#3r
+
 error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
   --> $DIR/projection-no-regions-closure.rs:54:23
    |
@@ -139,6 +123,22 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/projection-no-regions-closure.rs:65:23
+   |
+65 |     with_signature(x, |mut y| Box::new(y.next()))
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:26 ~ projection_no_regions_closure[317d]::outlives_region[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               T,
+               i32,
+               extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<Anything + '_#3r>
+           ]
+   = note: number of external vids: 4
+   = note: where <T as std::iter::Iterator>::Item: '_#3r
+
 note: No external requirements
   --> $DIR/projection-no-regions-closure.rs:60:1
    |
diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr
index bfe408342a8..946c1a8f372 100644
--- a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr
@@ -32,57 +32,6 @@ note: External requirements
    = note: where T: '_#2r
    = note: where '_#1r: '_#2r
 
-note: External requirements
-  --> $DIR/projection-one-region-closure.rs:68:29
-   |
-68 |     with_signature(cell, t, |cell, t| require(cell, t));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:23 ~ projection_one_region_closure[317d]::no_relationships_early[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
-           ]
-   = note: number of external vids: 4
-   = note: where T: '_#3r
-   = note: where '_#2r: '_#3r
-
-note: External requirements
-  --> $DIR/projection-one-region-closure.rs:90:29
-   |
-90 |     with_signature(cell, t, |cell, t| require(cell, t));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:27 ~ projection_one_region_closure[317d]::projection_outlives[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
-           ]
-   = note: number of external vids: 4
-   = note: where T: '_#3r
-   = note: where '_#2r: '_#3r
-
-note: External requirements
-   --> $DIR/projection-one-region-closure.rs:103:29
-    |
-103 |     with_signature(cell, t, |cell, t| require(cell, t));
-    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-    |
-    = note: defining type: DefId(0/1:31 ~ projection_one_region_closure[317d]::elements_outlive[0]::{{closure}}[0]) with closure substs [
-                '_#1r,
-                '_#2r,
-                T,
-                i32,
-                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
-            ]
-    = note: number of external vids: 4
-    = note: where T: '_#3r
-    = note: where '_#2r: '_#3r
-
 error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/projection-one-region-closure.rs:56:29
    |
@@ -114,6 +63,23 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/projection-one-region-closure.rs:68:29
+   |
+68 |     with_signature(cell, t, |cell, t| require(cell, t));
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:23 ~ projection_one_region_closure[317d]::no_relationships_early[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
+           ]
+   = note: number of external vids: 4
+   = note: where T: '_#3r
+   = note: where '_#2r: '_#3r
+
 error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/projection-one-region-closure.rs:68:29
    |
@@ -146,6 +112,23 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/projection-one-region-closure.rs:90:29
+   |
+90 |     with_signature(cell, t, |cell, t| require(cell, t));
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:27 ~ projection_one_region_closure[317d]::projection_outlives[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
+           ]
+   = note: number of external vids: 4
+   = note: where T: '_#3r
+   = note: where '_#2r: '_#3r
+
 error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/projection-one-region-closure.rs:90:29
    |
@@ -178,6 +161,23 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+   --> $DIR/projection-one-region-closure.rs:103:29
+    |
+103 |     with_signature(cell, t, |cell, t| require(cell, t));
+    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = note: defining type: DefId(0/1:31 ~ projection_one_region_closure[317d]::elements_outlive[0]::{{closure}}[0]) with closure substs [
+                '_#1r,
+                '_#2r,
+                T,
+                i32,
+                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
+            ]
+    = note: number of external vids: 4
+    = note: where T: '_#3r
+    = note: where '_#2r: '_#3r
+
 note: No external requirements
    --> $DIR/projection-one-region-closure.rs:97:1
     |
diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
index 6cb54170d7a..b26fa96fe63 100644
--- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
@@ -31,69 +31,6 @@ note: External requirements
    = note: number of external vids: 3
    = note: where '_#1r: '_#2r
 
-note: External requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:59:29
-   |
-59 |     with_signature(cell, t, |cell, t| require(cell, t));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:23 ~ projection_one_region_trait_bound_closure[317d]::no_relationships_early[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
-           ]
-   = note: number of external vids: 4
-   = note: where '_#2r: '_#3r
-
-note: External requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:80:29
-   |
-80 |     with_signature(cell, t, |cell, t| require(cell, t));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:27 ~ projection_one_region_trait_bound_closure[317d]::projection_outlives[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
-           ]
-   = note: number of external vids: 4
-   = note: where '_#2r: '_#3r
-
-note: External requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:91:29
-   |
-91 |     with_signature(cell, t, |cell, t| require(cell, t));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:31 ~ projection_one_region_trait_bound_closure[317d]::elements_outlive[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
-           ]
-   = note: number of external vids: 4
-   = note: where '_#2r: '_#3r
-
-note: External requirements
-   --> $DIR/projection-one-region-trait-bound-closure.rs:103:29
-    |
-103 |     with_signature(cell, t, |cell, t| require(cell, t));
-    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-    |
-    = note: defining type: DefId(0/1:34 ~ projection_one_region_trait_bound_closure[317d]::one_region[0]::{{closure}}[0]) with closure substs [
-                '_#1r,
-                T,
-                i32,
-                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
-            ]
-    = note: number of external vids: 3
-    = note: where '_#1r: '_#2r
-
 error: free region `ReEarlyBound(0, 'b)` does not outlive free region `ReFree(DefId(0/0:8 ~ projection_one_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`
   --> $DIR/projection-one-region-trait-bound-closure.rs:48:20
    |
@@ -117,6 +54,22 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/projection-one-region-trait-bound-closure.rs:59:29
+   |
+59 |     with_signature(cell, t, |cell, t| require(cell, t));
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:23 ~ projection_one_region_trait_bound_closure[317d]::no_relationships_early[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
+           ]
+   = note: number of external vids: 4
+   = note: where '_#2r: '_#3r
+
 error: free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
   --> $DIR/projection-one-region-trait-bound-closure.rs:59:20
    |
@@ -141,6 +94,22 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/projection-one-region-trait-bound-closure.rs:80:29
+   |
+80 |     with_signature(cell, t, |cell, t| require(cell, t));
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:27 ~ projection_one_region_trait_bound_closure[317d]::projection_outlives[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
+           ]
+   = note: number of external vids: 4
+   = note: where '_#2r: '_#3r
+
 error: free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
   --> $DIR/projection-one-region-trait-bound-closure.rs:80:20
    |
@@ -165,6 +134,22 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/projection-one-region-trait-bound-closure.rs:91:29
+   |
+91 |     with_signature(cell, t, |cell, t| require(cell, t));
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:31 ~ projection_one_region_trait_bound_closure[317d]::elements_outlive[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
+           ]
+   = note: number of external vids: 4
+   = note: where '_#2r: '_#3r
+
 note: No external requirements
   --> $DIR/projection-one-region-trait-bound-closure.rs:86:1
    |
@@ -183,6 +168,21 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+   --> $DIR/projection-one-region-trait-bound-closure.rs:103:29
+    |
+103 |     with_signature(cell, t, |cell, t| require(cell, t));
+    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = note: defining type: DefId(0/1:34 ~ projection_one_region_trait_bound_closure[317d]::one_region[0]::{{closure}}[0]) with closure substs [
+                '_#1r,
+                T,
+                i32,
+                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
+            ]
+    = note: number of external vids: 3
+    = note: where '_#1r: '_#2r
+
 note: No external requirements
    --> $DIR/projection-one-region-trait-bound-closure.rs:95:1
     |
diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr
index 986676d28d9..98b033b6a06 100644
--- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr
@@ -12,40 +12,28 @@ note: No external requirements
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:56:29
-   |
-56 |     with_signature(cell, t, |cell, t| require(cell, t));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:23 ~ projection_one_region_trait_bound_static_closure[317d]::no_relationships_early[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
-           ]
-
-note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:75:29
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:43:1
    |
-75 |     with_signature(cell, t, |cell, t| require(cell, t));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+43 | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
+44 | | where
+45 | |     T: Anything<'b>,
+46 | | {
+47 | |     with_signature(cell, t, |cell, t| require(cell, t));
+48 | | }
+   | |_^
    |
-   = note: defining type: DefId(0/1:27 ~ projection_one_region_trait_bound_static_closure[317d]::projection_outlives[0]::{{closure}}[0]) with closure substs [
+   = note: defining type: DefId(0/0:8 ~ projection_one_region_trait_bound_static_closure[317d]::no_relationships_late[0]) with substs [
                '_#1r,
-               '_#2r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
+               T
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:84:29
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:56:29
    |
-84 |     with_signature(cell, t, |cell, t| require(cell, t));
+56 |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: defining type: DefId(0/1:31 ~ projection_one_region_trait_bound_static_closure[317d]::elements_outlive[0]::{{closure}}[0]) with closure substs [
+   = note: defining type: DefId(0/1:23 ~ projection_one_region_trait_bound_static_closure[317d]::no_relationships_early[0]::{{closure}}[0]) with closure substs [
                '_#1r,
                '_#2r,
                T,
@@ -54,35 +42,6 @@ note: No external requirements
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:96:29
-   |
-96 |     with_signature(cell, t, |cell, t| require(cell, t));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:34 ~ projection_one_region_trait_bound_static_closure[317d]::one_region[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
-           ]
-
-note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:43:1
-   |
-43 | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
-44 | | where
-45 | |     T: Anything<'b>,
-46 | | {
-47 | |     with_signature(cell, t, |cell, t| require(cell, t));
-48 | | }
-   | |_^
-   |
-   = note: defining type: DefId(0/0:8 ~ projection_one_region_trait_bound_static_closure[317d]::no_relationships_late[0]) with substs [
-               '_#1r,
-               T
-           ]
-
-note: No external requirements
   --> $DIR/projection-one-region-trait-bound-static-closure.rs:51:1
    |
 51 | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
@@ -101,6 +60,20 @@ note: No external requirements
            ]
 
 note: No external requirements
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:75:29
+   |
+75 |     with_signature(cell, t, |cell, t| require(cell, t));
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:27 ~ projection_one_region_trait_bound_static_closure[317d]::projection_outlives[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
+           ]
+
+note: No external requirements
   --> $DIR/projection-one-region-trait-bound-static-closure.rs:60:1
    |
 60 | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
@@ -119,6 +92,20 @@ note: No external requirements
            ]
 
 note: No external requirements
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:84:29
+   |
+84 |     with_signature(cell, t, |cell, t| require(cell, t));
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:31 ~ projection_one_region_trait_bound_static_closure[317d]::elements_outlive[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
+           ]
+
+note: No external requirements
   --> $DIR/projection-one-region-trait-bound-static-closure.rs:79:1
    |
 79 | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
@@ -137,6 +124,19 @@ note: No external requirements
            ]
 
 note: No external requirements
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:96:29
+   |
+96 |     with_signature(cell, t, |cell, t| require(cell, t));
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:34 ~ projection_one_region_trait_bound_static_closure[317d]::one_region[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
+           ]
+
+note: No external requirements
   --> $DIR/projection-one-region-trait-bound-static-closure.rs:88:1
    |
 88 | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)
diff --git a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr
index 21487899d3b..78775ce94ad 100644
--- a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr
@@ -38,120 +38,6 @@ note: External requirements
    = note: number of external vids: 4
    = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#2r)>>::AssocType: '_#3r
 
-note: External requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:60:29
-   |
-60 |     with_signature(cell, t, |cell, t| require(cell, t));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:27 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_early[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               '_#3r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
-           ]
-   = note: number of external vids: 5
-   = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
-
-note: External requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:81:29
-   |
-81 |     with_signature(cell, t, |cell, t| require(cell, t));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:32 ~ projection_two_region_trait_bound_closure[317d]::projection_outlives[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               '_#3r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
-           ]
-   = note: number of external vids: 5
-   = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
-
-note: External requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:92:29
-   |
-92 |     with_signature(cell, t, |cell, t| require(cell, t));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:37 ~ projection_two_region_trait_bound_closure[317d]::elements_outlive1[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               '_#3r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
-           ]
-   = note: number of external vids: 5
-   = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
-
-note: External requirements
-   --> $DIR/projection-two-region-trait-bound-closure.rs:101:29
-    |
-101 |     with_signature(cell, t, |cell, t| require(cell, t));
-    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-    |
-    = note: defining type: DefId(0/1:42 ~ projection_two_region_trait_bound_closure[317d]::elements_outlive2[0]::{{closure}}[0]) with closure substs [
-                '_#1r,
-                '_#2r,
-                '_#3r,
-                T,
-                i32,
-                extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
-            ]
-    = note: number of external vids: 5
-    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
-
-note: External requirements
-   --> $DIR/projection-two-region-trait-bound-closure.rs:109:29
-    |
-109 |     with_signature(cell, t, |cell, t| require(cell, t));
-    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-    |
-    = note: defining type: DefId(0/1:46 ~ projection_two_region_trait_bound_closure[317d]::two_regions[0]::{{closure}}[0]) with closure substs [
-                '_#1r,
-                T,
-                i32,
-                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
-            ]
-    = note: number of external vids: 3
-    = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
-
-note: External requirements
-   --> $DIR/projection-two-region-trait-bound-closure.rs:120:29
-    |
-120 |     with_signature(cell, t, |cell, t| require(cell, t));
-    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-    |
-    = note: defining type: DefId(0/1:50 ~ projection_two_region_trait_bound_closure[317d]::two_regions_outlive[0]::{{closure}}[0]) with closure substs [
-                '_#1r,
-                '_#2r,
-                T,
-                i32,
-                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
-            ]
-    = note: number of external vids: 4
-    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#2r)>>::AssocType: '_#3r
-
-note: External requirements
-   --> $DIR/projection-two-region-trait-bound-closure.rs:132:29
-    |
-132 |     with_signature(cell, t, |cell, t| require(cell, t));
-    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-    |
-    = note: defining type: DefId(0/1:53 ~ projection_two_region_trait_bound_closure[317d]::one_region[0]::{{closure}}[0]) with closure substs [
-                '_#1r,
-                T,
-                i32,
-                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
-            ]
-    = note: number of external vids: 3
-    = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
-
 error[E0309]: the associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
   --> $DIR/projection-two-region-trait-bound-closure.rs:49:29
    |
@@ -178,6 +64,23 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/projection-two-region-trait-bound-closure.rs:60:29
+   |
+60 |     with_signature(cell, t, |cell, t| require(cell, t));
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:27 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_early[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               '_#3r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
+           ]
+   = note: number of external vids: 5
+   = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
+
 error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
   --> $DIR/projection-two-region-trait-bound-closure.rs:60:29
    |
@@ -205,6 +108,23 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/projection-two-region-trait-bound-closure.rs:81:29
+   |
+81 |     with_signature(cell, t, |cell, t| require(cell, t));
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:32 ~ projection_two_region_trait_bound_closure[317d]::projection_outlives[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               '_#3r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
+           ]
+   = note: number of external vids: 5
+   = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
+
 error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
   --> $DIR/projection-two-region-trait-bound-closure.rs:81:29
    |
@@ -232,6 +152,23 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/projection-two-region-trait-bound-closure.rs:92:29
+   |
+92 |     with_signature(cell, t, |cell, t| require(cell, t));
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:37 ~ projection_two_region_trait_bound_closure[317d]::elements_outlive1[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               '_#3r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
+           ]
+   = note: number of external vids: 5
+   = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
+
 note: No external requirements
   --> $DIR/projection-two-region-trait-bound-closure.rs:87:1
    |
@@ -251,6 +188,23 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+   --> $DIR/projection-two-region-trait-bound-closure.rs:101:29
+    |
+101 |     with_signature(cell, t, |cell, t| require(cell, t));
+    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = note: defining type: DefId(0/1:42 ~ projection_two_region_trait_bound_closure[317d]::elements_outlive2[0]::{{closure}}[0]) with closure substs [
+                '_#1r,
+                '_#2r,
+                '_#3r,
+                T,
+                i32,
+                extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
+            ]
+    = note: number of external vids: 5
+    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
+
 note: No external requirements
    --> $DIR/projection-two-region-trait-bound-closure.rs:96:1
     |
@@ -270,6 +224,21 @@ note: No external requirements
                 T
             ]
 
+note: External requirements
+   --> $DIR/projection-two-region-trait-bound-closure.rs:109:29
+    |
+109 |     with_signature(cell, t, |cell, t| require(cell, t));
+    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = note: defining type: DefId(0/1:46 ~ projection_two_region_trait_bound_closure[317d]::two_regions[0]::{{closure}}[0]) with closure substs [
+                '_#1r,
+                T,
+                i32,
+                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
+            ]
+    = note: number of external vids: 3
+    = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
+
 error: free region `ReEarlyBound(0, 'b)` does not outlive free region `ReFree(DefId(0/0:13 ~ projection_two_region_trait_bound_closure[317d]::two_regions[0]), BrNamed(crate0:DefIndex(1:43), 'a))`
    --> $DIR/projection-two-region-trait-bound-closure.rs:109:20
     |
@@ -293,6 +262,22 @@ note: No external requirements
                 T
             ]
 
+note: External requirements
+   --> $DIR/projection-two-region-trait-bound-closure.rs:120:29
+    |
+120 |     with_signature(cell, t, |cell, t| require(cell, t));
+    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = note: defining type: DefId(0/1:50 ~ projection_two_region_trait_bound_closure[317d]::two_regions_outlive[0]::{{closure}}[0]) with closure substs [
+                '_#1r,
+                '_#2r,
+                T,
+                i32,
+                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
+            ]
+    = note: number of external vids: 4
+    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#2r)>>::AssocType: '_#3r
+
 note: No external requirements
    --> $DIR/projection-two-region-trait-bound-closure.rs:115:1
     |
@@ -311,6 +296,21 @@ note: No external requirements
                 T
             ]
 
+note: External requirements
+   --> $DIR/projection-two-region-trait-bound-closure.rs:132:29
+    |
+132 |     with_signature(cell, t, |cell, t| require(cell, t));
+    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = note: defining type: DefId(0/1:53 ~ projection_two_region_trait_bound_closure[317d]::one_region[0]::{{closure}}[0]) with closure substs [
+                '_#1r,
+                T,
+                i32,
+                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
+            ]
+    = note: number of external vids: 3
+    = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
+
 note: No external requirements
    --> $DIR/projection-two-region-trait-bound-closure.rs:124:1
     |
diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
index 023b58c927d..f68a76c3d0d 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
+++ b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
@@ -30,20 +30,6 @@ note: External requirements
    = note: number of external vids: 2
    = note: where T: '_#1r
 
-note: External requirements
-  --> $DIR/ty-param-closure-approximate-lower-bound.rs:43:24
-   |
-43 |     twice(cell, value, |a, b| invoke(a, b));
-   |                        ^^^^^^^^^^^^^^^^^^^
-   |
-   = note: defining type: DefId(0/1:17 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]::{{closure}}[0]) with closure substs [
-               T,
-               i16,
-               for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex { depth: 1 }, BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex { depth: 1 }, BrNamed(crate0:DefIndex(0:0), 's)) T))
-           ]
-   = note: number of external vids: 2
-   = note: where T: '_#1r
-
 note: No external requirements
   --> $DIR/ty-param-closure-approximate-lower-bound.rs:33:1
    |
@@ -60,6 +46,20 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/ty-param-closure-approximate-lower-bound.rs:43:24
+   |
+43 |     twice(cell, value, |a, b| invoke(a, b));
+   |                        ^^^^^^^^^^^^^^^^^^^
+   |
+   = note: defining type: DefId(0/1:17 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]::{{closure}}[0]) with closure substs [
+               T,
+               i16,
+               for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex { depth: 1 }, BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex { depth: 1 }, BrNamed(crate0:DefIndex(0:0), 's)) T))
+           ]
+   = note: number of external vids: 2
+   = note: where T: '_#1r
+
 error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/ty-param-closure-approximate-lower-bound.rs:43:24
    |
diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr
index 2dd13810ae4..ed4d4b1e68f 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr
+++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr
@@ -31,69 +31,6 @@ note: External requirements
    = note: number of external vids: 2
    = note: where T: '_#1r
 
-note: External requirements
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:55:26
-   |
-55 |       with_signature(a, b, |x, y| {
-   |  __________________________^
-56 | |         // Key point of this test:
-57 | |         //
-58 | |         // The *closure* is being type-checked with all of its free
-...  |
-67 | |         require(&x, &y)
-68 | |     })
-   | |_____^
-   |
-   = note: defining type: DefId(0/1:19 ~ ty_param_closure_outlives_from_where_clause[317d]::correct_region[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
-           ]
-   = note: number of external vids: 3
-   = note: where T: '_#2r
-
-note: External requirements
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:76:26
-   |
-76 |       with_signature(a, b, |x, y| {
-   |  __________________________^
-77 | |         //~^ ERROR the parameter type `T` may not live long enough
-78 | |         // See `correct_region`
-79 | |         require(&x, &y)
-80 | |         //~^ WARNING not reporting region error due to -Znll
-81 | |     })
-   | |_____^
-   |
-   = note: defining type: DefId(0/1:23 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
-           ]
-   = note: number of external vids: 3
-   = note: where T: '_#2r
-
-note: External requirements
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:90:26
-   |
-90 |       with_signature(a, b, |x, y| {
-   |  __________________________^
-91 | |         // See `correct_region`
-92 | |         require(&x, &y)
-93 | |     })
-   | |_____^
-   |
-   = note: defining type: DefId(0/1:27 ~ ty_param_closure_outlives_from_where_clause[317d]::outlives_region[0]::{{closure}}[0]) with closure substs [
-               '_#1r,
-               '_#2r,
-               T,
-               i32,
-               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
-           ]
-   = note: number of external vids: 4
-   = note: where T: '_#3r
-
 error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/ty-param-closure-outlives-from-where-clause.rs:38:26
    |
@@ -125,6 +62,28 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:55:26
+   |
+55 |       with_signature(a, b, |x, y| {
+   |  __________________________^
+56 | |         // Key point of this test:
+57 | |         //
+58 | |         // The *closure* is being type-checked with all of its free
+...  |
+67 | |         require(&x, &y)
+68 | |     })
+   | |_____^
+   |
+   = note: defining type: DefId(0/1:19 ~ ty_param_closure_outlives_from_where_clause[317d]::correct_region[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
+           ]
+   = note: number of external vids: 3
+   = note: where T: '_#2r
+
 note: No external requirements
   --> $DIR/ty-param-closure-outlives-from-where-clause.rs:51:1
    |
@@ -142,6 +101,27 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:76:26
+   |
+76 |       with_signature(a, b, |x, y| {
+   |  __________________________^
+77 | |         //~^ ERROR the parameter type `T` may not live long enough
+78 | |         // See `correct_region`
+79 | |         require(&x, &y)
+80 | |         //~^ WARNING not reporting region error due to -Znll
+81 | |     })
+   | |_____^
+   |
+   = note: defining type: DefId(0/1:23 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
+           ]
+   = note: number of external vids: 3
+   = note: where T: '_#2r
+
 error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/ty-param-closure-outlives-from-where-clause.rs:76:26
    |
@@ -173,6 +153,26 @@ note: No external requirements
                T
            ]
 
+note: External requirements
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:90:26
+   |
+90 |       with_signature(a, b, |x, y| {
+   |  __________________________^
+91 | |         // See `correct_region`
+92 | |         require(&x, &y)
+93 | |     })
+   | |_____^
+   |
+   = note: defining type: DefId(0/1:27 ~ ty_param_closure_outlives_from_where_clause[317d]::outlives_region[0]::{{closure}}[0]) with closure substs [
+               '_#1r,
+               '_#2r,
+               T,
+               i32,
+               extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
+           ]
+   = note: number of external vids: 4
+   = note: where T: '_#3r
+
 note: No external requirements
   --> $DIR/ty-param-closure-outlives-from-where-clause.rs:85:1
    |
diff --git a/src/test/ui/resolve/issue-23305.rs b/src/test/ui/resolve/issue-23305.rs
index f249e0e1127..34f8a0a4843 100644
--- a/src/test/ui/resolve/issue-23305.rs
+++ b/src/test/ui/resolve/issue-23305.rs
@@ -13,6 +13,6 @@ pub trait ToNbt<T> {
 }
 
 impl ToNbt<Self> {}
-//~^ ERROR unsupported cyclic reference
+//~^ ERROR cyclic dependency detected
 
 fn main() {}
diff --git a/src/test/ui/resolve/issue-23305.stderr b/src/test/ui/resolve/issue-23305.stderr
index 5bba9fc41e2..a0b4d424ec9 100644
--- a/src/test/ui/resolve/issue-23305.stderr
+++ b/src/test/ui/resolve/issue-23305.stderr
@@ -1,4 +1,4 @@
-error[E0391]: unsupported cyclic reference between types/traits detected
+error[E0391]: cyclic dependency detected
   --> $DIR/issue-23305.rs:15:12
    |
 15 | impl ToNbt<Self> {}
diff --git a/src/test/ui/unsafe-block-without-braces.rs b/src/test/ui/unsafe-block-without-braces.rs
new file mode 100644
index 00000000000..b6fb3ec5c44
--- /dev/null
+++ b/src/test/ui/unsafe-block-without-braces.rs
@@ -0,0 +1,16 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    unsafe //{
+        std::mem::transmute::<f32, u32>(1.0);
+    //}
+}
+//~^^^ ERROR expected one of `extern`, `fn`, or `{`, found `std`
diff --git a/src/test/ui/unsafe-block-without-braces.stderr b/src/test/ui/unsafe-block-without-braces.stderr
new file mode 100644
index 00000000000..fc6ddba3823
--- /dev/null
+++ b/src/test/ui/unsafe-block-without-braces.stderr
@@ -0,0 +1,10 @@
+error: expected one of `extern`, `fn`, or `{`, found `std`
+  --> $DIR/unsafe-block-without-braces.rs:13:9
+   |
+12 |     unsafe //{
+   |           - expected one of `extern`, `fn`, or `{` here
+13 |         std::mem::transmute::<f32, u32>(1.0);
+   |         ^^^ unexpected token
+
+error: aborting due to previous error
+