]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/unactionable_diagnostic.rs
Rollup merge of #103159 - cuviper:check_pow-final-try_opt, r=Mark-Simulacrum
[rust.git] / src / test / ui / impl-trait / unactionable_diagnostic.rs
1 // run-rustfix
2
3 pub trait Trait {}
4
5 pub struct Foo;
6
7 impl Trait for Foo {}
8
9 fn foo<'x, P>(
10     _post: P,
11     x: &'x Foo,
12 ) -> &'x impl Trait {
13     x
14 }
15
16 pub fn bar<'t, T>(
17     //~^ HELP: consider adding an explicit lifetime bound...
18     post: T,
19     x: &'t Foo,
20 ) -> &'t impl Trait {
21     foo(post, x)
22     //~^ ERROR: the parameter type `T` may not live long enough
23 }
24
25 fn main() {}