mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
108 lines
3.9 KiB
Plaintext
108 lines
3.9 KiB
Plaintext
error[E0307]: invalid `self` parameter type: isize
|
|
--> $DIR/ufcs-explicit-self-bad.rs:8:18
|
|
|
|
|
LL | fn foo(self: isize, x: isize) -> isize {
|
|
| ^^^^^
|
|
|
|
|
= note: type of `self` must be `Self` or a type that dereferences to it
|
|
= 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`)
|
|
|
|
error[E0307]: invalid `self` parameter type: Bar<isize>
|
|
--> $DIR/ufcs-explicit-self-bad.rs:19:18
|
|
|
|
|
LL | fn foo(self: Bar<isize>, x: isize) -> isize {
|
|
| ^^^^^^^^^^
|
|
|
|
|
= note: type of `self` must be `Self` or a type that dereferences to it
|
|
= 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`)
|
|
|
|
error[E0307]: invalid `self` parameter type: &Bar<usize>
|
|
--> $DIR/ufcs-explicit-self-bad.rs:23:18
|
|
|
|
|
LL | fn bar(self: &Bar<usize>, x: isize) -> isize {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= note: type of `self` must be `Self` or a type that dereferences to it
|
|
= 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`)
|
|
|
|
error[E0308]: mismatched `self` parameter type
|
|
--> $DIR/ufcs-explicit-self-bad.rs:37:21
|
|
|
|
|
LL | fn dummy2(self: &Bar<T>) {}
|
|
| ^^^^^^^ lifetime mismatch
|
|
|
|
|
= note: expected reference `&'a Bar<T>`
|
|
found reference `&Bar<T>`
|
|
note: the anonymous lifetime defined here...
|
|
--> $DIR/ufcs-explicit-self-bad.rs:37:21
|
|
|
|
|
LL | fn dummy2(self: &Bar<T>) {}
|
|
| ^^^^^^^
|
|
note: ...does not necessarily outlive the lifetime `'a` as defined here
|
|
--> $DIR/ufcs-explicit-self-bad.rs:35:6
|
|
|
|
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
|
|
| ^^
|
|
|
|
error[E0308]: mismatched `self` parameter type
|
|
--> $DIR/ufcs-explicit-self-bad.rs:37:21
|
|
|
|
|
LL | fn dummy2(self: &Bar<T>) {}
|
|
| ^^^^^^^ lifetime mismatch
|
|
|
|
|
= note: expected reference `&'a Bar<T>`
|
|
found reference `&Bar<T>`
|
|
note: the lifetime `'a` as defined here...
|
|
--> $DIR/ufcs-explicit-self-bad.rs:35:6
|
|
|
|
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
|
|
| ^^
|
|
note: ...does not necessarily outlive the anonymous lifetime defined here
|
|
--> $DIR/ufcs-explicit-self-bad.rs:37:21
|
|
|
|
|
LL | fn dummy2(self: &Bar<T>) {}
|
|
| ^^^^^^^
|
|
|
|
error[E0308]: mismatched `self` parameter type
|
|
--> $DIR/ufcs-explicit-self-bad.rs:39:21
|
|
|
|
|
LL | fn dummy3(self: &&Bar<T>) {}
|
|
| ^^^^^^^^ lifetime mismatch
|
|
|
|
|
= note: expected reference `&'a Bar<T>`
|
|
found reference `&Bar<T>`
|
|
note: the anonymous lifetime defined here...
|
|
--> $DIR/ufcs-explicit-self-bad.rs:39:22
|
|
|
|
|
LL | fn dummy3(self: &&Bar<T>) {}
|
|
| ^^^^^^^
|
|
note: ...does not necessarily outlive the lifetime `'a` as defined here
|
|
--> $DIR/ufcs-explicit-self-bad.rs:35:6
|
|
|
|
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
|
|
| ^^
|
|
|
|
error[E0308]: mismatched `self` parameter type
|
|
--> $DIR/ufcs-explicit-self-bad.rs:39:21
|
|
|
|
|
LL | fn dummy3(self: &&Bar<T>) {}
|
|
| ^^^^^^^^ lifetime mismatch
|
|
|
|
|
= note: expected reference `&'a Bar<T>`
|
|
found reference `&Bar<T>`
|
|
note: the lifetime `'a` as defined here...
|
|
--> $DIR/ufcs-explicit-self-bad.rs:35:6
|
|
|
|
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
|
|
| ^^
|
|
note: ...does not necessarily outlive the anonymous lifetime defined here
|
|
--> $DIR/ufcs-explicit-self-bad.rs:39:22
|
|
|
|
|
LL | fn dummy3(self: &&Bar<T>) {}
|
|
| ^^^^^^^
|
|
|
|
error: aborting due to 7 previous errors
|
|
|
|
Some errors have detailed explanations: E0307, E0308.
|
|
For more information about an error, try `rustc --explain E0307`.
|