-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.