summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/unactionable_diagnostic.fixed
blob: 6c2505177fef83b2bd96501dccd51a7f99c75d80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// run-rustfix

pub trait Trait {}

pub struct Foo;

impl Trait for Foo {}

fn foo<'x, P>(
    _post: P,
    x: &'x Foo,
) -> &'x impl Trait {
    x
}

pub fn bar<'t, T: 't>(
    //~^ HELP: consider adding an explicit lifetime bound...
    post: T,
    x: &'t Foo,
) -> &'t impl Trait {
    foo(post, x)
    //~^ ERROR: the parameter type `T` may not live long enough
}

fn main() {}