fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.3 KiB41 linesraw
1error[E0308]: method not compatible with trait
2  --> $DIR/trait-matching-lifetimes.rs:14:5
3   |
4LL |     fn foo(x: Foo<'b,'a>) {
5   |     ^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
6   |
7   = note: expected fn pointer `fn(Foo<'a, 'b>)`
8              found fn pointer `fn(Foo<'b, 'a>)`
9note: the lifetime `'b` as defined on the impl at 13:9...
10  --> $DIR/trait-matching-lifetimes.rs:13:9
11   |
12LL | impl<'a,'b> Tr for Foo<'a,'b> {
13   |         ^^
14note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 13:6
15  --> $DIR/trait-matching-lifetimes.rs:13:6
16   |
17LL | impl<'a,'b> Tr for Foo<'a,'b> {
18   |      ^^
19
20error[E0308]: method not compatible with trait
21  --> $DIR/trait-matching-lifetimes.rs:14:5
22   |
23LL |     fn foo(x: Foo<'b,'a>) {
24   |     ^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
25   |
26   = note: expected fn pointer `fn(Foo<'a, 'b>)`
27              found fn pointer `fn(Foo<'b, 'a>)`
28note: the lifetime `'a` as defined on the impl at 13:6...
29  --> $DIR/trait-matching-lifetimes.rs:13:6
30   |
31LL | impl<'a,'b> Tr for Foo<'a,'b> {
32   |      ^^
33note: ...does not necessarily outlive the lifetime `'b` as defined on the impl at 13:9
34  --> $DIR/trait-matching-lifetimes.rs:13:9
35   |
36LL | impl<'a,'b> Tr for Foo<'a,'b> {
37   |         ^^
38
39error: aborting due to 2 previous errors
40
41For more information about this error, try `rustc --explain E0308`.