-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
"Associated function" is used incorrectly #2559
Comments
referenced section in the book The terminology used here is ambiguous:
The Rust reference clearly states:
Therefore, methods are a subset of associated functions, so the terminology used here is actually wrong. |
This seems wrong to me, or at least inconsistent with the implementation. https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.AssocItem.html#structfield.fn_has_self_parameter clearly allows associated items to have a |
To whom it may concern, I am happy to submit a PR for this fix. |
@AJTJ Please do. In the section 5.3 in The Book:
this is clearly wrong? Reading this gives an indication that associated functions are like static/class methods in other languages. |
This language in chapter 19 is confusing for a new rust user:
However, associated functions that are part of traits don’t have a self parameter.
I'm wondering if it would be better to declare something along the lines of
Associated functions that are not methods, do not have the self parameter
, in order to help with understanding.The text was updated successfully, but these errors were encountered: