1 error[E0307]: invalid `self` type: isize
2 --> $DIR/ufcs-explicit-self-bad.rs:18:18
4 LL | fn foo(self: isize, x: isize) -> isize {
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>`
10 error[E0307]: invalid `self` type: Bar<isize>
11 --> $DIR/ufcs-explicit-self-bad.rs:29:18
13 LL | fn foo(self: Bar<isize>, x: isize) -> isize {
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>`
19 error[E0307]: invalid `self` type: &Bar<usize>
20 --> $DIR/ufcs-explicit-self-bad.rs:33:18
22 LL | fn bar(self: &Bar<usize>, x: isize) -> isize {
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>`
28 error[E0308]: mismatched method receiver
29 --> $DIR/ufcs-explicit-self-bad.rs:47:21
31 LL | fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver
32 | ^^^^^^^ lifetime mismatch
34 = note: expected type `&'a 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
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
44 LL | impl<'a, T> SomeTrait for &'a Bar<T> {
47 error[E0308]: mismatched method receiver
48 --> $DIR/ufcs-explicit-self-bad.rs:47:21
50 LL | fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver
51 | ^^^^^^^ lifetime mismatch
53 = note: expected type `&'a Bar<T>`
55 note: the lifetime 'a as defined on the impl at 45:6...
56 --> $DIR/ufcs-explicit-self-bad.rs:45:6
58 LL | impl<'a, T> SomeTrait for &'a Bar<T> {
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
63 LL | fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver
64 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 error[E0308]: mismatched method receiver
67 --> $DIR/ufcs-explicit-self-bad.rs:49:21
69 LL | fn dummy3(self: &&Bar<T>) {}
70 | ^^^^^^^^ lifetime mismatch
72 = note: expected type `&'a 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
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
82 LL | impl<'a, T> SomeTrait for &'a Bar<T> {
85 error[E0308]: mismatched method receiver
86 --> $DIR/ufcs-explicit-self-bad.rs:49:21
88 LL | fn dummy3(self: &&Bar<T>) {}
89 | ^^^^^^^^ lifetime mismatch
91 = note: expected type `&'a Bar<T>`
93 note: the lifetime 'a as defined on the impl at 45:6...
94 --> $DIR/ufcs-explicit-self-bad.rs:45:6
96 LL | impl<'a, T> SomeTrait for &'a Bar<T> {
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
101 LL | fn dummy3(self: &&Bar<T>) {}
102 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104 error: aborting due to 7 previous errors
106 Some errors occurred: E0307, E0308.
107 For more information about an error, try `rustc --explain E0307`.