Merged
Conversation
Centril
reviewed
Oct 17, 2019
Contributor
Centril
left a comment
There was a problem hiding this comment.
Looks like a great improvement!
Contributor
We do agree. :) |
Member
Author
|
I did a few more edits on And then I did all the same things with |
RalfJung
commented
Oct 19, 2019
| /// cost to pay off more easily. It's also more likely to have two `Rc` clones, that point to | ||
| /// the same value, than two `&T`s. | ||
| /// | ||
| /// We can only do this when `T: Eq` as a `PartialEq` might be deliberately irreflexive. |
Member
Author
There was a problem hiding this comment.
This is what I concluded after some thinking. It is also in line with this comment by @alexcrichton:
According to Eq's own documentation it signifies the reflexive property (a == a) which I believe means that this is a semantically correct implementation.
So, seems like just a missing comment to me.
Contributor
|
Thanks! @bors r+ rollup |
Collaborator
|
📌 Commit 1b38463 has been approved by |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Oct 19, 2019
Rc: value -> allocation See rust-lang#64484. This does not yet edit `Arc` as I first wanted to be sure we agree on the terminology the way it actually ends up. "value" as a term appears a lot in this file, and sometimes it refers to the value stored inside the `RcBox` while sometimes it refers to the `RcBox` itself. I tried to properly tease these apart but may have made some mistakes. The former should now always be called "inner value" and the latter "allocation". One area where I was very unsure of which terminology is dropping: the `value` field of the `RcBox` will get dropped *earlier* than the `RcBox` itself if there are weak references. I decided that "dropping the value stored in the allocation" refers to dropping the value field, while "destroying the allocation" refers to actually freeing its backing memory. r? @Centril
Centril
added a commit
to Centril/rust
that referenced
this pull request
Oct 19, 2019
Rc: value -> allocation See rust-lang#64484. This does not yet edit `Arc` as I first wanted to be sure we agree on the terminology the way it actually ends up. "value" as a term appears a lot in this file, and sometimes it refers to the value stored inside the `RcBox` while sometimes it refers to the `RcBox` itself. I tried to properly tease these apart but may have made some mistakes. The former should now always be called "inner value" and the latter "allocation". One area where I was very unsure of which terminology is dropping: the `value` field of the `RcBox` will get dropped *earlier* than the `RcBox` itself if there are weak references. I decided that "dropping the value stored in the allocation" refers to dropping the value field, while "destroying the allocation" refers to actually freeing its backing memory. r? @Centril
bors
added a commit
that referenced
this pull request
Oct 19, 2019
Rollup of 5 pull requests Successful merges: - #64007 (Add check for overlapping ranges to unreachable patterns lint) - #65192 (Use structured suggestion for restricting bounds) - #65226 (BTreeSet symmetric_difference & union optimized) - #65448 (rustc_codegen_ssa: remove some unnecessary Box special-casing.) - #65505 (Rc: value -> allocation) Failed merges: r? @ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #64484. This does not yet edit
Arcas I first wanted to be sure we agree on the terminology the way it actually ends up. "value" as a term appears a lot in this file, and sometimes it refers to the value stored inside theRcBoxwhile sometimes it refers to theRcBoxitself. I tried to properly tease these apart but may have made some mistakes. The former should now always be called "inner value" and the latter "allocation".One area where I was very unsure of which terminology is dropping: the
valuefield of theRcBoxwill get dropped earlier than theRcBoxitself if there are weak references. I decided that "dropping the value stored in the allocation" refers to dropping the value field, while "destroying the allocation" refers to actually freeing its backing memory.r? @Centril