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.4 KiB49 linesraw
1error[E0308]: mismatched `self` parameter type
2  --> $DIR/issue-17905-2.rs:8:18
3   |
4LL |     fn say(self: &Pair<&str, isize>) {
5   |                  ^^^^^^^^^^^^^^^^^^ lifetime mismatch
6   |
7   = note: expected struct `Pair<&str, _>`
8              found struct `Pair<&str, _>`
9note: the anonymous lifetime #2 defined on the method body at 8:5...
10  --> $DIR/issue-17905-2.rs:8:5
11   |
12LL | /     fn say(self: &Pair<&str, isize>) {
13LL | |
14LL | |
15LL | |         println!("{:?}", self);
16LL | |     }
17   | |_____^
18note: ...does not necessarily outlive the lifetime `'_` as defined on the impl at 5:5
19  --> $DIR/issue-17905-2.rs:5:5
20   |
21LL |     &str,
22   |     ^
23
24error[E0308]: mismatched `self` parameter type
25  --> $DIR/issue-17905-2.rs:8:18
26   |
27LL |     fn say(self: &Pair<&str, isize>) {
28   |                  ^^^^^^^^^^^^^^^^^^ lifetime mismatch
29   |
30   = note: expected struct `Pair<&str, _>`
31              found struct `Pair<&str, _>`
32note: the lifetime `'_` as defined on the impl at 5:5...
33  --> $DIR/issue-17905-2.rs:5:5
34   |
35LL |     &str,
36   |     ^
37note: ...does not necessarily outlive the anonymous lifetime #2 defined on the method body at 8:5
38  --> $DIR/issue-17905-2.rs:8:5
39   |
40LL | /     fn say(self: &Pair<&str, isize>) {
41LL | |
42LL | |
43LL | |         println!("{:?}", self);
44LL | |     }
45   | |_____^
46
47error: aborting due to 2 previous errors
48
49For more information about this error, try `rustc --explain E0308`.