]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs
Make const/fn return params more suggestable
[rust.git] / tests / ui / suggestions / lifetimes / missing-lifetimes-in-signature-2.rs
1 // Regression test for #81650
2 // run-rustfix
3
4 #![allow(warnings)]
5
6 struct Foo<'a> {
7     x: &'a mut &'a i32,
8 }
9
10 impl<'a> Foo<'a> {
11     fn bar<F, T>(&self, f: F)
12     where
13         F: FnOnce(&Foo<'a>) -> T,
14         F: 'a,
15     {}
16 }
17
18 trait Test {
19     fn test(&self);
20 }
21
22 fn func<T: Test>(foo: &Foo, t: T) {
23     foo.bar(move |_| {
24     //~^ ERROR the parameter type `T` may not live long enough
25         t.test();
26     });
27 }
28
29 fn main() {}