Closed
Description
I did some search and find no similar issue, so here is my report:
Compile the following code:
struct Data;
impl Data {
fn rc(self: &std::rc::Rc<Self>) {
println!("&rc");
}
}
Give the error:
error[E0658]: `&std::rc::Rc<Data>` cannot be used as the type of `self` without the `arbitrary_self_types` feature
--> src/main.rs:3:17
|
3 | fn rc(self: &std::rc::Rc<Self>) {
| ^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/44874
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
Think the last line of the error message should be updated to match the current status: https://doc.rust-lang.org/reference/items/associated-items.html which states:
If the type of the self parameter is specified, it is limited to one of the following types:
Self
&Self
&mut Self
Box<Self>
Rc<Self>
Arc<Self>
Pin<P>
where P is one of the above types except Self.