summaryrefslogtreecommitdiffstats
path: root/src/test/ui/impl-trait/issue-100075.rs
blob: ea30abb4855f319114ad8e4588a3d9412c362572 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
trait Marker {}
impl<T> Marker for T {}

fn maybe<T>(
    _t: T,
) -> Option<
    //removing the line below makes it compile
    &'static T,
> {
    None
}

fn _g<T>(t: &'static T) -> &'static impl Marker {
    //~^ ERROR cannot resolve opaque type
    if let Some(t) = maybe(t) {
        return _g(t);
    }
    todo!()
}

fn main() {}