Repository navigation
Make FlowRef a newtype - #14053
Make FlowRef a newtype#14053
FlowRef a newtype#14053Conversation
|
Heads up! This PR modifies the following files:
|
|
@bors-servo try |
Make `FlowRef` a newtype This creates a sharp distinction between `Arc<Flow>`s, which may be owned by anyone, and `FlowRef`s, which may only be owned by the traversal code. By checking the reference count, we ensure that a `Flow` cannot be pointed to by `Arc`s and `FlowRef`s simultaneously. This is not a complete fix for #6503, though it is a necessary start (enforcing the no-aliasing rule of `FlowRef::deref_mut` will require far more work). --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #14014 (github issue number if applicable). - [X] These changes do not require tests because the existing tests, plus the added assertions, should be sufficient <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14053) <!-- Reviewable:end -->
|
@bors-servo try I committed a logfile. |
Make `FlowRef` a newtype This creates a sharp distinction between `Arc<Flow>`s, which may be owned by anyone, and `FlowRef`s, which may only be owned by the traversal code. By checking the reference count, we ensure that a `Flow` cannot be pointed to by `Arc`s and `FlowRef`s simultaneously. This is not a complete fix for #6503, though it is a necessary start (enforcing the no-aliasing rule of `FlowRef::deref_mut` will require far more work). --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #14014 (github issue number if applicable). - [X] These changes do not require tests because the existing tests, plus the added assertions, should be sufficient <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14053) <!-- Reviewable:end -->
|
💥 Test timed out |
|
@bors-servo: retry |
|
@bors-servo clean try |
Make `FlowRef` a newtype This creates a sharp distinction between `Arc<Flow>`s, which may be owned by anyone, and `FlowRef`s, which may only be owned by the traversal code. By checking the reference count, we ensure that a `Flow` cannot be pointed to by `Arc`s and `FlowRef`s simultaneously. This is not a complete fix for #6503, though it is a necessary start (enforcing the no-aliasing rule of `FlowRef::deref_mut` will require far more work). --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #14014 (github issue number if applicable). - [X] These changes do not require tests because the existing tests, plus the added assertions, should be sufficient <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14053) <!-- Reviewable:end -->
|
💔 Test failed - linux-rel-wpt |
|
linux-rel-wpt: linux-rel-css passed |
|
So the idea here is that If so, I hadn't considered this solution; very clever :) |
|
@pcwalton Exactly. And thank you. 😄 |
|
By the way, all the tests passed. r? |
| } | ||
|
|
||
| impl FlowRef { | ||
| /// `FlowRef`s can only be made availabe to the traversal code. |
|
r=me, squash away |
This creates a sharp distinction between `Arc<Flow>`s, which may be owned by anyone, and `FlowRef`s, which may only be owned by the traversal code. By checking the reference count, we ensure that a `Flow` cannot be pointed to by `Arc`s and `FlowRef`s simultaneously. This is not a complete fix for #6503, though it is a necessary start (enforcing the no-aliasing rule of `FlowRef::deref_mut` will require far more work). Fixes #14014
|
@bors-servo r=pcwalton |
|
📌 Commit 5f320bd has been approved by |
|
⌛ Testing commit 5f320bd with merge 2b4a7b0... |
Make `FlowRef` a newtype This creates a sharp distinction between `Arc<Flow>`s, which may be owned by anyone, and `FlowRef`s, which may only be owned by the traversal code. By checking the reference count, we ensure that a `Flow` cannot be pointed to by `Arc`s and `FlowRef`s simultaneously. This is not a complete fix for #6503, though it is a necessary start (enforcing the no-aliasing rule of `FlowRef::deref_mut` will require far more work). --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #14014 (github issue number if applicable). - [X] These changes do not require tests because the existing tests, plus the added assertions, should be sufficient <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14053) <!-- Reviewable:end -->
|
☀️ Test successful - arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-dev |
This creates a sharp distinction between
Arc<Flow>s, which may beowned by anyone, and
FlowRefs, which may only be owned by thetraversal code. By checking the reference count, we ensure that a
Flowcannot be pointed to by
Arcs andFlowRefs simultaneously.This is not a complete fix for #6503, though it is a necessary start
(enforcing the no-aliasing rule of
FlowRef::deref_mutwill require farmore work).
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is