@@ -13,27 +13,19 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th
13
13
20 | | x
14
14
21 | | }
15
15
| |_____^
16
- note: ...so that method type is compatible with trait (expected fn(&i32, &'a u32, &u32) -> &'a u32, found fn(&i32, &u32, &u32) -> &u32)
17
- --> $DIR/mismatched_trait_impl.rs:19:5
18
- |
19
- 19 | / fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { //~ ERROR cannot infer
20
- 20 | | x
21
- 21 | | }
22
- | |_____^
16
+ = note: ...so that the method type is compatible with trait:
17
+ expected fn(&i32, &'a u32, &u32) -> &'a u32
18
+ found fn(&i32, &u32, &u32) -> &u32
23
19
note: but, the lifetime must be valid for the lifetime 'a as defined on the method body at 19:5...
24
20
--> $DIR/mismatched_trait_impl.rs:19:5
25
21
|
26
22
19 | / fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { //~ ERROR cannot infer
27
23
20 | | x
28
24
21 | | }
29
25
| |_____^
30
- note: ...so that method type is compatible with trait (expected fn(&i32, &'a u32, &u32) -> &'a u32, found fn(&i32, &u32, &u32) -> &u32)
31
- --> $DIR/mismatched_trait_impl.rs:19:5
32
- |
33
- 19 | / fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { //~ ERROR cannot infer
34
- 20 | | x
35
- 21 | | }
36
- | |_____^
26
+ = note: ...so that the method type is compatible with trait:
27
+ expected fn(&i32, &'a u32, &u32) -> &'a u32
28
+ found fn(&i32, &u32, &u32) -> &u32
37
29
38
30
error: aborting due to previous error
39
31
0 commit comments