about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/type-alias-impl-trait/nested_in_closure.rs10
-rw-r--r--tests/ui/type-alias-impl-trait/nested_in_closure.stderr15
2 files changed, 9 insertions, 16 deletions
diff --git a/tests/ui/type-alias-impl-trait/nested_in_closure.rs b/tests/ui/type-alias-impl-trait/nested_in_closure.rs
index 3c15b0708a3..362f3d53e88 100644
--- a/tests/ui/type-alias-impl-trait/nested_in_closure.rs
+++ b/tests/ui/type-alias-impl-trait/nested_in_closure.rs
@@ -1,9 +1,17 @@
 #![feature(type_alias_impl_trait)]
+// check-pass
 
 fn main() {
     let x = || {
         type Tait = impl Sized;
         let y: Tait = ();
-        //~^ ERROR: item constrains opaque type that is not in its signature
     };
+
+    let y = || {
+        type Tait = impl std::fmt::Debug;
+        let y: Tait = ();
+        y
+    };
+    let mut z = y();
+    z = ();
 }
diff --git a/tests/ui/type-alias-impl-trait/nested_in_closure.stderr b/tests/ui/type-alias-impl-trait/nested_in_closure.stderr
deleted file mode 100644
index beb670db171..00000000000
--- a/tests/ui/type-alias-impl-trait/nested_in_closure.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: item constrains opaque type that is not in its signature
-  --> $DIR/nested_in_closure.rs:6:23
-   |
-LL |         let y: Tait = ();
-   |                       ^^
-   |
-   = note: this item must have the opaque type in its signature in order to be able to register hidden types
-note: this item must have the opaque type in its signature in order to be able to register hidden types
-  --> $DIR/nested_in_closure.rs:3:4
-   |
-LL | fn main() {
-   |    ^^^^
-
-error: aborting due to previous error
-