about summary refs log tree commit diff
path: root/tests/ui/impl-trait/issues/issue-78722-2.rs
blob: ef4d26b6975592be00849f2f886757275a3df121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! 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: [(); {
        #[define_opaque(F)]
        fn concrete_use() -> F {
            //~^ ERROR future that resolves to `u8`, but it resolves to `()`
            async {}
        }
        // FIXME(type_alias_impl_trait): inform the user about why `F` is not available here.
        let f: F = async { 1 };
        //~^ ERROR mismatched types
        1
    }],
}

fn main() {}