2019-09-03 01:21:58 +00:00
error[E0307]: invalid `self` parameter type: isize
2018-12-25 15:56:47 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:8:18
2018-08-08 12:28:26 +00:00
|
LL | fn foo(self: isize, x: isize) -> isize {
| ^^^^^
|
2019-09-03 01:21:58 +00:00
= note: type of `self` must be `Self` or a type that dereferences to it
2019-07-16 04:30:48 +00:00
= 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`)
2018-08-08 12:28:26 +00:00
2019-09-03 01:21:58 +00:00
error[E0307]: invalid `self` parameter type: Bar<isize>
2018-12-25 15:56:47 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:19:18
2018-08-08 12:28:26 +00:00
|
LL | fn foo(self: Bar<isize>, x: isize) -> isize {
| ^^^^^^^^^^
|
2019-09-03 01:21:58 +00:00
= note: type of `self` must be `Self` or a type that dereferences to it
2019-07-16 04:30:48 +00:00
= 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`)
2018-08-08 12:28:26 +00:00
2019-09-03 01:21:58 +00:00
error[E0307]: invalid `self` parameter type: &Bar<usize>
2018-12-25 15:56:47 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:23:18
2018-08-08 12:28:26 +00:00
|
LL | fn bar(self: &Bar<usize>, x: isize) -> isize {
| ^^^^^^^^^^^
|
2019-09-03 01:21:58 +00:00
= note: type of `self` must be `Self` or a type that dereferences to it
2019-07-16 04:30:48 +00:00
= 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`)
2018-08-08 12:28:26 +00:00
2019-09-03 01:21:58 +00:00
error[E0308]: mismatched `self` parameter type
2018-12-25 15:56:47 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:37:21
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | fn dummy2(self: &Bar<T>) {}
2018-08-08 12:28:26 +00:00
| ^^^^^^^ lifetime mismatch
|
2019-11-13 22:16:56 +00:00
= note: expected reference `&'a Bar<T>`
found reference `&Bar<T>`
2021-10-05 12:11:51 +00:00
note: the anonymous lifetime defined here...
2021-02-22 14:39:06 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:37:21
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | fn dummy2(self: &Bar<T>) {}
2021-02-22 14:39:06 +00:00
| ^^^^^^^
2021-10-05 12:11:51 +00:00
note: ...does not necessarily outlive the lifetime `'a` as defined here
2018-12-25 15:56:47 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:35:6
2018-08-08 12:28:26 +00:00
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
| ^^
2019-09-03 01:21:58 +00:00
error[E0308]: mismatched `self` parameter type
2018-12-25 15:56:47 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:37:21
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | fn dummy2(self: &Bar<T>) {}
2018-08-08 12:28:26 +00:00
| ^^^^^^^ lifetime mismatch
|
2019-11-13 22:16:56 +00:00
= note: expected reference `&'a Bar<T>`
found reference `&Bar<T>`
2021-10-05 12:11:51 +00:00
note: the lifetime `'a` as defined here...
2018-12-25 15:56:47 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:35:6
2018-08-08 12:28:26 +00:00
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
| ^^
2021-10-05 12:11:51 +00:00
note: ...does not necessarily outlive the anonymous lifetime defined here
2021-02-22 14:39:06 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:37:21
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | fn dummy2(self: &Bar<T>) {}
2021-02-22 14:39:06 +00:00
| ^^^^^^^
2018-08-08 12:28:26 +00:00
2019-09-03 01:21:58 +00:00
error[E0308]: mismatched `self` parameter type
2023-10-25 10:49:24 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:40:21
2018-08-08 12:28:26 +00:00
|
LL | fn dummy3(self: &&Bar<T>) {}
| ^^^^^^^^ lifetime mismatch
|
2019-11-13 22:16:56 +00:00
= note: expected reference `&'a Bar<T>`
found reference `&Bar<T>`
2021-10-05 12:11:51 +00:00
note: the anonymous lifetime defined here...
2023-10-25 10:49:24 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:40:22
2018-08-08 12:28:26 +00:00
|
LL | fn dummy3(self: &&Bar<T>) {}
2021-02-22 14:39:06 +00:00
| ^^^^^^^
2021-10-05 12:11:51 +00:00
note: ...does not necessarily outlive the lifetime `'a` as defined here
2018-12-25 15:56:47 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:35:6
2018-08-08 12:28:26 +00:00
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
| ^^
2019-09-03 01:21:58 +00:00
error[E0308]: mismatched `self` parameter type
2023-10-25 10:49:24 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:40:21
2018-08-08 12:28:26 +00:00
|
LL | fn dummy3(self: &&Bar<T>) {}
| ^^^^^^^^ lifetime mismatch
|
2019-11-13 22:16:56 +00:00
= note: expected reference `&'a Bar<T>`
found reference `&Bar<T>`
2021-10-05 12:11:51 +00:00
note: the lifetime `'a` as defined here...
2018-12-25 15:56:47 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:35:6
2018-08-08 12:28:26 +00:00
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
| ^^
2021-10-05 12:11:51 +00:00
note: ...does not necessarily outlive the anonymous lifetime defined here
2023-10-25 10:49:24 +00:00
--> $DIR/ufcs-explicit-self-bad.rs:40:22
2018-08-08 12:28:26 +00:00
|
LL | fn dummy3(self: &&Bar<T>) {}
2021-02-22 14:39:06 +00:00
| ^^^^^^^
2018-08-08 12:28:26 +00:00
2023-10-25 10:49:24 +00:00
error[E0053]: method `dummy2` has an incompatible type for trait
--> $DIR/ufcs-explicit-self-bad.rs:37:21
|
LL | fn dummy2(self: &Bar<T>) {}
| ------^^^^^^^
| | |
| | expected `&'a Bar<T>`, found `Bar<T>`
| help: change the self-receiver type to match the trait: `&self`
|
note: type in trait
--> $DIR/ufcs-explicit-self-bad.rs:31:15
|
LL | fn dummy2(&self);
| ^^^^^
= note: expected signature `fn(&&'a Bar<T>)`
found signature `fn(&Bar<T>)`
error: aborting due to 8 previous errors
2018-08-08 12:28:26 +00:00
2023-10-25 10:49:24 +00:00
Some errors have detailed explanations: E0053, E0307, E0308.
For more information about an error, try `rustc --explain E0053`.