summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-28279.rs
blob: bab5df122c87f0ffdd5dfb19a1ba4d3d5e31a4b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// check-pass
#![allow(dead_code)]
use std::rc::Rc;

fn test1() -> Rc<dyn for<'a> Fn(&'a usize) + 'static> {
    if let Some(_) = Some(1) {
        loop{}
    } else {
        loop{}
    }
}

fn test2() -> *mut (dyn for<'a> Fn(&'a usize) + 'static) {
    if let Some(_) = Some(1) {
        loop{}
    } else {
        loop{}
    }
}

fn main() {}