fork/rust

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

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

master
384 B25 linesraw
1// run-rustfix
2
3pub trait Trait {}
4
5pub struct Foo;
6
7impl Trait for Foo {}
8
9fn foo<'x, P>(
10    _post: P,
11    x: &'x Foo,
12) -> &'x impl Trait {
13    x
14}
15
16pub fn bar<'t, 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
25fn main() {}