fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
4.1 KiB107 linesraw
1error[E0307]: invalid `self` parameter type: isize
2  --> $DIR/ufcs-explicit-self-bad.rs:8:18
3   |
4LL |     fn foo(self: isize, x: isize) -> isize {
5   |                  ^^^^^
6   |
7   = note: type of `self` must be `Self` or a type that dereferences to it
8   = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
9
10error[E0307]: invalid `self` parameter type: Bar<isize>
11  --> $DIR/ufcs-explicit-self-bad.rs:19:18
12   |
13LL |     fn foo(self: Bar<isize>, x: isize) -> isize {
14   |                  ^^^^^^^^^^
15   |
16   = note: type of `self` must be `Self` or a type that dereferences to it
17   = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
18
19error[E0307]: invalid `self` parameter type: &Bar<usize>
20  --> $DIR/ufcs-explicit-self-bad.rs:23:18
21   |
22LL |     fn bar(self: &Bar<usize>, x: isize) -> isize {
23   |                  ^^^^^^^^^^^
24   |
25   = note: type of `self` must be `Self` or a type that dereferences to it
26   = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
27
28error[E0308]: mismatched `self` parameter type
29  --> $DIR/ufcs-explicit-self-bad.rs:37:21
30   |
31LL |     fn dummy2(self: &Bar<T>) {}
32   |                     ^^^^^^^ lifetime mismatch
33   |
34   = note: expected reference `&'a Bar<T>`
35              found reference `&Bar<T>`
36note: the anonymous lifetime #1 defined on the method body at 37:5...
37  --> $DIR/ufcs-explicit-self-bad.rs:37:5
38   |
39LL |     fn dummy2(self: &Bar<T>) {}
40   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
41note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 35:6
42  --> $DIR/ufcs-explicit-self-bad.rs:35:6
43   |
44LL | impl<'a, T> SomeTrait for &'a Bar<T> {
45   |      ^^
46
47error[E0308]: mismatched `self` parameter type
48  --> $DIR/ufcs-explicit-self-bad.rs:37:21
49   |
50LL |     fn dummy2(self: &Bar<T>) {}
51   |                     ^^^^^^^ lifetime mismatch
52   |
53   = note: expected reference `&'a Bar<T>`
54              found reference `&Bar<T>`
55note: the lifetime `'a` as defined on the impl at 35:6...
56  --> $DIR/ufcs-explicit-self-bad.rs:35:6
57   |
58LL | impl<'a, T> SomeTrait for &'a Bar<T> {
59   |      ^^
60note: ...does not necessarily outlive the anonymous lifetime #1 defined on the method body at 37:5
61  --> $DIR/ufcs-explicit-self-bad.rs:37:5
62   |
63LL |     fn dummy2(self: &Bar<T>) {}
64   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
65
66error[E0308]: mismatched `self` parameter type
67  --> $DIR/ufcs-explicit-self-bad.rs:39:21
68   |
69LL |     fn dummy3(self: &&Bar<T>) {}
70   |                     ^^^^^^^^ lifetime mismatch
71   |
72   = note: expected reference `&'a Bar<T>`
73              found reference `&Bar<T>`
74note: the anonymous lifetime #2 defined on the method body at 39:5...
75  --> $DIR/ufcs-explicit-self-bad.rs:39:5
76   |
77LL |     fn dummy3(self: &&Bar<T>) {}
78   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 35:6
80  --> $DIR/ufcs-explicit-self-bad.rs:35:6
81   |
82LL | impl<'a, T> SomeTrait for &'a Bar<T> {
83   |      ^^
84
85error[E0308]: mismatched `self` parameter type
86  --> $DIR/ufcs-explicit-self-bad.rs:39:21
87   |
88LL |     fn dummy3(self: &&Bar<T>) {}
89   |                     ^^^^^^^^ lifetime mismatch
90   |
91   = note: expected reference `&'a Bar<T>`
92              found reference `&Bar<T>`
93note: the lifetime `'a` as defined on the impl at 35:6...
94  --> $DIR/ufcs-explicit-self-bad.rs:35:6
95   |
96LL | impl<'a, T> SomeTrait for &'a Bar<T> {
97   |      ^^
98note: ...does not necessarily outlive the anonymous lifetime #2 defined on the method body at 39:5
99  --> $DIR/ufcs-explicit-self-bad.rs:39:5
100   |
101LL |     fn dummy3(self: &&Bar<T>) {}
102   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103
104error: aborting due to 7 previous errors
105
106Some errors have detailed explanations: E0307, E0308.
107For more information about an error, try `rustc --explain E0307`.