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.0 KiB25 linesraw
1error: `impl` item signature doesn't match `trait` item signature
2  --> $DIR/mismatched_trait_impl.rs:9:5
3   |
4LL |     fn foo(&self, x: &'a u32, y: &u32) -> &'a u32;
5   |     ---------------------------------------------- expected fn(&i32, &'a u32, &u32) -> &'a u32
6...
7LL |     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
8   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found fn(&i32, &u32, &u32) -> &u32
9   |
10   = note: expected `fn(&i32, &'a u32, &u32) -> &'a u32`
11              found `fn(&i32, &u32, &u32) -> &u32`
12
13error[E0623]: lifetime mismatch
14  --> $DIR/mismatched_trait_impl.rs:10:9
15   |
16LL |     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
17   |                      ----                 -------
18   |                      |
19   |                      this parameter and the return type are declared with different lifetimes...
20LL |         x
21   |         ^ ...but data from `x` is returned here
22
23error: aborting due to 2 previous errors
24
25For more information about this error, try `rustc --explain E0623`.