about summary refs log tree commit diff
path: root/tests/ui/closures/eager-mono-with-normalizable-upvars.rs
blob: 4d934f7a7a9ad467fb766a693e7e79559d0fd0b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ compile-flags: -Clink-dead-code -Csymbol-mangling-version=v0
//@ build-pass

// Ensure that when eagerly collecting `test::{closure#0}`, we don't try
// collecting an unnormalized version of the closure (specifically its
// upvars), since the closure captures the RPIT `opaque::{opaque#0}`.

fn opaque() -> impl Sized {}

fn test() -> impl FnOnce() {
    let opaque = opaque();
    move || {
        let opaque = opaque;
    }
}

fn main() {
    test()();
}