summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/normalize-opaque-with-bound-vars.rs
blob: 1025c2c7e8ad7e8a13100babeafbbec2d3973a40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// build-pass
// edition:2021
// compile-flags: -Cdebuginfo=2

// We were not normalizing opaques with escaping bound vars during codegen,
// leading to later linker errors because of differences in mangled symbol name.

fn func<T>() -> impl Sized {}

trait Trait<'a> {
    type Assoc;

    fn call() {
        let _ = async {
            let _value = func::<Self::Assoc>();
            std::future::ready(()).await
        };
    }
}

impl Trait<'static> for () {
    type Assoc = ();
}

fn main() {
    <()>::call();
}