fork/rust
git clone https://git.julia.blue/fork/rust
4560ea788cb
1.39.0
1error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 'a in generic type due to conflicting requirements 2 --> $DIR/mismatched_trait_impl.rs:9:5 3 | 4LL | fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { 5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | 7note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 9:5... 8 --> $DIR/mismatched_trait_impl.rs:9:5 9 | 10LL | / fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { 11LL | | x 12LL | | } 13 | |_____^ 14note: ...but the lifetime must also be valid for the lifetime 'a as defined on the method body at 9:32... 15 --> $DIR/mismatched_trait_impl.rs:9:32 16 | 17LL | fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { 18 | ^^ 19 = note: ...so that the method type is compatible with trait: 20 expected fn(&i32, &'a u32, &u32) -> &'a u32 21 found fn(&i32, &u32, &u32) -> &u32 22 23error[E0623]: lifetime mismatch 24 --> $DIR/mismatched_trait_impl.rs:10:9 25 | 26LL | fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { 27 | ---- ------- 28 | | 29 | this parameter and the return type are declared with different lifetimes... 30LL | x 31 | ^ ...but data from `x` is returned here 32 33error: aborting due to 2 previous errors 34