fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
445 B29 linesraw
1// Regression test for #81650
2// run-rustfix
3
4#![allow(warnings)]
5
6struct Foo<'a> {
7    x: &'a mut &'a i32,
8}
9
10impl<'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
18trait Test {
19    fn test(&self);
20}
21
22fn func<'a, T: Test + 'a>(foo: &'a Foo<'a>, t: T) {
23    foo.bar(move |_| {
24    //~^ ERROR the parameter type `T` may not live long enough
25        t.test();
26    });
27}
28
29fn main() {}