Skip to content
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

Take method invocation semantics out of chapter on deref coercion. #28203

Merged
merged 1 commit into from Sep 4, 2015

Conversation

benschulz
Copy link
Contributor

I have two issues with the section "Deref and method calls" of the book's chapter "Deref coercions".

  • (Minor) It says "In other words, these are the same two things in Rust:", followed by a code block in which no two things seem similar, much less the same. Presumably this sentence made more sense in a previous revision.
  • The next paragraph conflates two concepts which, imho, should kept separate. They are
    • deref coercion, i.e. inserting as many * as necessary and
    • implicitly referencing the receiver, i.e. inserting a single & to satisfy the method's self parameter type.

I appreciate that with the proposed changes the example becomes very contrived, even for a foo-bar-baz one. However, the current exmplanation is just wrong.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@brson
Copy link
Contributor

brson commented Sep 3, 2015

@bors r+ rollup

Thanks!

@bors
Copy link
Contributor

bors commented Sep 3, 2015

📌 Commit 986f523 has been approved by brson

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Sep 4, 2015
I have two issues with the section "Deref and method calls" of the book's chapter "Deref coercions".

 - (Minor) It says "In other words, these are the same two things in Rust:", followed by a code block in which no two things seem similar, much less the same. Presumably this sentence made more sense in a previous revision.

 - The next paragraph conflates two concepts which, imho, should kept separate. They are
    - deref coercion, i.e. inserting as many `*` as necessary and
    - implicitly referencing the receiver, i.e. inserting a single `&` to satisfy the method's `self` parameter type.

I appreciate that with the proposed changes the example becomes very contrived, even for a foo-bar-baz one. However, the current exmplanation is just wrong.
bors added a commit that referenced this pull request Sep 4, 2015
@bors bors merged commit 986f523 into rust-lang:master Sep 4, 2015
@benschulz benschulz deleted the book-deref-coercion branch November 20, 2016 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants