summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs
blob: a1e801e3923058094afc6a80ddcf084c14a108d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
pub trait T {}

struct S<'a>(&'a ());

impl<'a> T for S<'a> {}

fn foo() -> impl T {
    let x = ();
    S(&x) //~ ERROR `x` does not live long enough
}

fn main() {}