rust/src/test/ui/ufcs/ufcs-explicit-self-bad.stderr

108 lines
3.8 KiB
Plaintext
Raw Normal View History

error[E0307]: invalid method receiver type: isize
2018-08-08 07:28:26 -05:00
--> $DIR/ufcs-explicit-self-bad.rs:18:18
|
LL | fn foo(self: isize, x: isize) -> isize {
| ^^^^^
|
= note: type must be `Self` or a type that dereferences to it
2018-08-08 07:28:26 -05:00
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
error[E0307]: invalid method receiver type: Bar<isize>
2018-08-08 07:28:26 -05:00
--> $DIR/ufcs-explicit-self-bad.rs:29:18
|
LL | fn foo(self: Bar<isize>, x: isize) -> isize {
| ^^^^^^^^^^
|
= note: type must be `Self` or a type that dereferences to it
2018-08-08 07:28:26 -05:00
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
error[E0307]: invalid method receiver type: &Bar<usize>
2018-08-08 07:28:26 -05:00
--> $DIR/ufcs-explicit-self-bad.rs:33:18
|
LL | fn bar(self: &Bar<usize>, x: isize) -> isize {
| ^^^^^^^^^^^
|
= note: type must be `Self` or a type that dereferences to it
2018-08-08 07:28:26 -05:00
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
error[E0308]: mismatched method receiver
--> $DIR/ufcs-explicit-self-bad.rs:47:21
|
LL | fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver
| ^^^^^^^ lifetime mismatch
|
= note: expected type `&'a Bar<T>`
found type `&Bar<T>`
note: the anonymous lifetime #1 defined on the method body at 47:5...
--> $DIR/ufcs-explicit-self-bad.rs:47:5
|
LL | fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 45:6
--> $DIR/ufcs-explicit-self-bad.rs:45:6
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
| ^^
error[E0308]: mismatched method receiver
--> $DIR/ufcs-explicit-self-bad.rs:47:21
|
LL | fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver
| ^^^^^^^ lifetime mismatch
|
= note: expected type `&'a Bar<T>`
found type `&Bar<T>`
note: the lifetime 'a as defined on the impl at 45:6...
--> $DIR/ufcs-explicit-self-bad.rs:45:6
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
| ^^
note: ...does not necessarily outlive the anonymous lifetime #1 defined on the method body at 47:5
--> $DIR/ufcs-explicit-self-bad.rs:47:5
|
LL | fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched method receiver
--> $DIR/ufcs-explicit-self-bad.rs:49:21
|
LL | fn dummy3(self: &&Bar<T>) {}
| ^^^^^^^^ lifetime mismatch
|
= note: expected type `&'a Bar<T>`
found type `&Bar<T>`
note: the anonymous lifetime #2 defined on the method body at 49:5...
--> $DIR/ufcs-explicit-self-bad.rs:49:5
|
LL | fn dummy3(self: &&Bar<T>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 45:6
--> $DIR/ufcs-explicit-self-bad.rs:45:6
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
| ^^
error[E0308]: mismatched method receiver
--> $DIR/ufcs-explicit-self-bad.rs:49:21
|
LL | fn dummy3(self: &&Bar<T>) {}
| ^^^^^^^^ lifetime mismatch
|
= note: expected type `&'a Bar<T>`
found type `&Bar<T>`
note: the lifetime 'a as defined on the impl at 45:6...
--> $DIR/ufcs-explicit-self-bad.rs:45:6
|
LL | impl<'a, T> SomeTrait for &'a Bar<T> {
| ^^
note: ...does not necessarily outlive the anonymous lifetime #2 defined on the method body at 49:5
--> $DIR/ufcs-explicit-self-bad.rs:49:5
|
LL | fn dummy3(self: &&Bar<T>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 7 previous errors
Some errors occurred: E0307, E0308.
For more information about an error, try `rustc --explain E0307`.