summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issues/issue-78722-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/issues/issue-78722-2.rs')
-rw-r--r--tests/ui/impl-trait/issues/issue-78722-2.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/issues/issue-78722-2.rs b/tests/ui/impl-trait/issues/issue-78722-2.rs
new file mode 100644
index 000000000..cf5361e1e
--- /dev/null
+++ b/tests/ui/impl-trait/issues/issue-78722-2.rs
@@ -0,0 +1,22 @@
+//! test that we cannot register hidden types for opaque types
+//! declared outside an anonymous constant.
+// edition:2018
+
+#![feature(type_alias_impl_trait)]
+
+type F = impl core::future::Future<Output = u8>;
+
+struct Bug {
+ V1: [(); {
+ fn concrete_use() -> F {
+ //~^ ERROR future that resolves to `u8`, but it resolves to `()`
+ async {}
+ }
+ let f: F = async { 1 };
+ //~^ ERROR item constrains opaque type that is not in its signature
+ //~| ERROR `async` blocks are not allowed in constants
+ 1
+ }],
+}
+
+fn main() {}