]> git.lizzy.rs Git - rust.git/blob - tests/ui/ufcs/ufcs-explicit-self-bad.stderr
Rollup merge of #106854 - steffahn:drop_linear_arc_rebased, r=Mark-Simulacrum
[rust.git] / tests / ui / ufcs / ufcs-explicit-self-bad.stderr
1 error[E0307]: invalid `self` parameter type: isize
2   --> $DIR/ufcs-explicit-self-bad.rs:8:18
3    |
4 LL |     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
10 error[E0307]: invalid `self` parameter type: Bar<isize>
11   --> $DIR/ufcs-explicit-self-bad.rs:19:18
12    |
13 LL |     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
19 error[E0307]: invalid `self` parameter type: &Bar<usize>
20   --> $DIR/ufcs-explicit-self-bad.rs:23:18
21    |
22 LL |     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
28 error[E0308]: mismatched `self` parameter type
29   --> $DIR/ufcs-explicit-self-bad.rs:37:21
30    |
31 LL |     fn dummy2(self: &Bar<T>) {}
32    |                     ^^^^^^^ lifetime mismatch
33    |
34    = note: expected reference `&'a Bar<T>`
35               found reference `&Bar<T>`
36 note: the anonymous lifetime defined here...
37   --> $DIR/ufcs-explicit-self-bad.rs:37:21
38    |
39 LL |     fn dummy2(self: &Bar<T>) {}
40    |                     ^^^^^^^
41 note: ...does not necessarily outlive the lifetime `'a` as defined here
42   --> $DIR/ufcs-explicit-self-bad.rs:35:6
43    |
44 LL | impl<'a, T> SomeTrait for &'a Bar<T> {
45    |      ^^
46
47 error[E0308]: mismatched `self` parameter type
48   --> $DIR/ufcs-explicit-self-bad.rs:37:21
49    |
50 LL |     fn dummy2(self: &Bar<T>) {}
51    |                     ^^^^^^^ lifetime mismatch
52    |
53    = note: expected reference `&'a Bar<T>`
54               found reference `&Bar<T>`
55 note: the lifetime `'a` as defined here...
56   --> $DIR/ufcs-explicit-self-bad.rs:35:6
57    |
58 LL | impl<'a, T> SomeTrait for &'a Bar<T> {
59    |      ^^
60 note: ...does not necessarily outlive the anonymous lifetime defined here
61   --> $DIR/ufcs-explicit-self-bad.rs:37:21
62    |
63 LL |     fn dummy2(self: &Bar<T>) {}
64    |                     ^^^^^^^
65
66 error[E0308]: mismatched `self` parameter type
67   --> $DIR/ufcs-explicit-self-bad.rs:39:21
68    |
69 LL |     fn dummy3(self: &&Bar<T>) {}
70    |                     ^^^^^^^^ lifetime mismatch
71    |
72    = note: expected reference `&'a Bar<T>`
73               found reference `&Bar<T>`
74 note: the anonymous lifetime defined here...
75   --> $DIR/ufcs-explicit-self-bad.rs:39:22
76    |
77 LL |     fn dummy3(self: &&Bar<T>) {}
78    |                      ^^^^^^^
79 note: ...does not necessarily outlive the lifetime `'a` as defined here
80   --> $DIR/ufcs-explicit-self-bad.rs:35:6
81    |
82 LL | impl<'a, T> SomeTrait for &'a Bar<T> {
83    |      ^^
84
85 error[E0308]: mismatched `self` parameter type
86   --> $DIR/ufcs-explicit-self-bad.rs:39:21
87    |
88 LL |     fn dummy3(self: &&Bar<T>) {}
89    |                     ^^^^^^^^ lifetime mismatch
90    |
91    = note: expected reference `&'a Bar<T>`
92               found reference `&Bar<T>`
93 note: the lifetime `'a` as defined here...
94   --> $DIR/ufcs-explicit-self-bad.rs:35:6
95    |
96 LL | impl<'a, T> SomeTrait for &'a Bar<T> {
97    |      ^^
98 note: ...does not necessarily outlive the anonymous lifetime defined here
99   --> $DIR/ufcs-explicit-self-bad.rs:39:22
100    |
101 LL |     fn dummy3(self: &&Bar<T>) {}
102    |                      ^^^^^^^
103
104 error: aborting due to 7 previous errors
105
106 Some errors have detailed explanations: E0307, E0308.
107 For more information about an error, try `rustc --explain E0307`.