]> git.proxmox.com Git - rustc.git/blob - src/test/ui/in-band-lifetimes/mismatched_trait_impl.stderr
Update (un)suspicious files
[rustc.git] / src / test / ui / in-band-lifetimes / mismatched_trait_impl.stderr
1 error: `impl` item signature doesn't match `trait` item signature
2 --> $DIR/mismatched_trait_impl.rs:9:5
3 |
4 LL | fn foo(&self, x: &'a u32, y: &u32) -> &'a u32;
5 | ---------------------------------------------- expected `fn(&'1 i32, &'a u32, &'2 u32) -> &'a u32`
6 ...
7 LL | fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
8 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 i32, &'2 u32, &'3 u32) -> &'3 u32`
9 |
10 = note: expected `fn(&'1 i32, &'a u32, &'2 u32) -> &'a u32`
11 found `fn(&'1 i32, &'2 u32, &'3 u32) -> &'3 u32`
12 = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
13 = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output
14
15 error[E0623]: lifetime mismatch
16 --> $DIR/mismatched_trait_impl.rs:10:9
17 |
18 LL | fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
19 | ---- -------
20 | |
21 | this parameter and the return type are declared with different lifetimes...
22 LL | x
23 | ^ ...but data from `x` is returned here
24
25 error: aborting due to 2 previous errors
26
27 For more information about this error, try `rustc --explain E0623`.