summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/alias-liveness/escaping-bounds-2.rs
blob: 05884f6741c1e80cc62b5e23cc6106163f74f3b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
trait Trait {
    type Gat<'a: 'b, 'b: 'c, 'c>: 'c;
}

fn get_func<'a, T: Trait>(_: &'a str) -> fn(T::Gat<'a, '_, 'static>) {
    loop {}
}

fn test<T: Trait>() {
    let func = get_func::<T>(&String::new()); //~ ERROR temporary value dropped
    drop(func);
}

fn main() {}