Uh oh!
There was an error while loading. Please reload this page.
Rc: value -> allocation - #65505
Conversation
Centril
left a comment
There was a problem hiding this comment.
Looks like a great improvement!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Centril
commented
Oct 17, 2019
We do agree. :) |
RalfJung
commented
Oct 19, 2019
I did a few more edits on And then I did all the same things with |
| /// 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. |
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.
Centril
commented
Oct 19, 2019
Thanks! @bors r+ rollup |
bors
commented
Oct 19, 2019
📌 Commit 1b38463 has been approved by |
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
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
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
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