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