Update the help message on error for self type

This commit is contained in:
Limira 2019-07-16 11:30:48 +07:00
parent 4b65a86eba
commit b7cbd4ec47
6 changed files with 18 additions and 14 deletions

View file

@ -6,7 +6,7 @@ LL | fn foo(self: Ptr<Self>);
|
= note: for more information, see https://github.com/rust-lang/rust/issues/44874
= help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
= 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[E0658]: `Ptr<Bar>` cannot be used as the type of `self` without the `arbitrary_self_types` feature
--> $DIR/feature-gate-arbitrary-self-types.rs:22:18
@ -16,7 +16,7 @@ LL | fn foo(self: Ptr<Self>) {}
|
= note: for more information, see https://github.com/rust-lang/rust/issues/44874
= help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
= 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[E0658]: `std::boxed::Box<Ptr<Bar>>` cannot be used as the type of `self` without the `arbitrary_self_types` feature
--> $DIR/feature-gate-arbitrary-self-types.rs:26:18
@ -26,7 +26,7 @@ LL | fn bar(self: Box<Ptr<Self>>) {}
|
= note: for more information, see https://github.com/rust-lang/rust/issues/44874
= help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
= 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: aborting due to 3 previous errors

View file

@ -6,7 +6,7 @@ LL | fn bar(self: *const Self);
|
= note: for more information, see https://github.com/rust-lang/rust/issues/44874
= help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
= 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[E0658]: `*const Foo` cannot be used as the type of `self` without the `arbitrary_self_types` feature
--> $DIR/feature-gate-arbitrary_self_types-raw-pointer.rs:4:18
@ -16,7 +16,7 @@ LL | fn foo(self: *const Self) {}
|
= note: for more information, see https://github.com/rust-lang/rust/issues/44874
= help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
= 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[E0658]: `*const ()` cannot be used as the type of `self` without the `arbitrary_self_types` feature
--> $DIR/feature-gate-arbitrary_self_types-raw-pointer.rs:14:18
@ -26,7 +26,7 @@ LL | fn bar(self: *const Self) {}
|
= note: for more information, see https://github.com/rust-lang/rust/issues/44874
= help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
= 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: aborting due to 3 previous errors

View file

@ -5,7 +5,7 @@ LL | fn dyn_instead_of_self(self: Box<dyn Trait>);
| ^^^^^^^^^^^^^^
|
= note: type must be `Self` or a type that dereferences to it
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
= 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: aborting due to previous error

View file

@ -5,7 +5,7 @@ LL | fn handler(self: &SomeType);
| ^^^^^^^^^
|
= note: type must be `Self` or a type that dereferences to it
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
= 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: aborting due to previous error

View file

@ -5,7 +5,7 @@ LL | fn foo(self: isize, x: isize) -> isize {
| ^^^^^
|
= note: type must be `Self` or a type that dereferences to it
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
= 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 method receiver type: Bar<isize>
--> $DIR/ufcs-explicit-self-bad.rs:19:18
@ -14,7 +14,7 @@ LL | fn foo(self: Bar<isize>, x: isize) -> isize {
| ^^^^^^^^^^
|
= note: type must be `Self` or a type that dereferences to it
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
= 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 method receiver type: &Bar<usize>
--> $DIR/ufcs-explicit-self-bad.rs:23:18
@ -23,7 +23,7 @@ LL | fn bar(self: &Bar<usize>, x: isize) -> isize {
| ^^^^^^^^^^^
|
= note: type must be `Self` or a type that dereferences to it
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
= 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 method receiver
--> $DIR/ufcs-explicit-self-bad.rs:37:21