-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update error message for self
#62609
Comments
But it is better if Rust supports |
It's not yet possible. See the compiler output:
See the unstable book for that feature flag. So you have to use a nightly compiler and opt into that feature to use it. There's nothing werong here. The reference is referencing the nightly compiler and not the stable one. |
At least |
Upsidaisy. you're right, my bad. Would you think you could do a PR and improve that? Should be fairly easy. Ask here if you need some guidance. |
I do a quick search and found at least 3 instances of const HELP_FOR_SELF_TYPE: &str = "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`)"; then use Anything else do I need to pay attention? Hope it goes well, because I don't think I will try to compile Rust on my tiny machine! |
I create a PR #62712 |
Update the help message on error for self type Fix rust-lang#62609
I did some search and find no similar issue, so here is my report:
Compile the following code:
Give the error:
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:
The text was updated successfully, but these errors were encountered: