about summary refs log tree commit diff
path: root/tests/ui/impl-trait/upvar_captures.rs
blob: 61e3cda66f57f586a9146508caeb1f1e0e288a71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! This test used to ICE: rust-lang/rust#123255
//! Because the errors on `C` were ignored when trying
//! to compute the MIR of the closure, which thus ended
//! up with broken upvars.
//@ edition:2021
#![crate_type = "lib"]

pub fn a() {}

mod handlers {
    pub struct C(&()); //~ ERROR missing lifetime specifier
    pub fn c() -> impl Fn() -> C {
        let a1 = ();
        || C((crate::a(), a1).into())
    }
}