aboutsummaryrefslogtreecommitdiffstats
path: root/tests/compile-fail/array.rs
blob: c5492e88c1f5418c501dd292316ee602c859fac0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
extern crate clint;

use clint::cs::Locker;
use clint::HandlerArray;

fn main() {
    let mut hs = HandlerArray::new();
    hs.with_overrides(|new_hs| nested(new_hs));
}

fn nested(hs: &HandlerArray) {
    let mut c = || println!("Short-lived closure.");
    hs.register(0, &mut c) //~ ERROR `c` does not live long enough
}