-
Notifications
You must be signed in to change notification settings - Fork 116
Add a conversion from the newly-#[stable] ptr::NonNull type
#390
Conversation
|
@fitzgen @jdm @nox How do you feel about this repository requiring Rust |
|
I assume you meant 1.25? I don't mind. |
|
Oops, yes. I mostly ask in case it interferes with plans to unify this repo with |
|
In particular: this is only clean-up, so if it requires adding a Cargo feature somewhere it’s not worth it and we can just wait. |
src/conversions.rs
Outdated
| impl ToJSValConvertible for ptr::NonNull<JSObject> { | ||
| #[inline] | ||
| unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) { | ||
| rval.set(ObjectOrNullValue(self.get())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can probably use ObjectValue and maybe_wrap_object_value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Indeed, that’s what the equivalent impl in Servo does.
This will allow removing the `NonNullJSObjectPtr` hack in Servo, but raises the minimum Rust version to 1.25 (currently Nigthly)
|
I take it "approved" means: @bors-servo r=jdm |
|
📌 Commit 5a68234 has been approved by |
Add a conversion from the newly-#[stable] `ptr::NonNull` type This will allow removing the `NonNullJSObjectPtr` hack in Servo, but raises the minimum Rust version to 1.25 (currently Nigthly) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/390) <!-- Reviewable:end -->
|
💥 Test timed out |
|
@bors-servo retry |
Add a conversion from the newly-#[stable] `ptr::NonNull` type This will allow removing the `NonNullJSObjectPtr` hack in Servo, but raises the minimum Rust version to 1.25 (currently Nigthly) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/390) <!-- Reviewable:end -->
|
Eh, OS X job on Travis-CI still not scheduled after 13 hours… |
|
☀️ Test successful - status-appveyor, status-travis |
This will allow removing the
NonNullJSObjectPtrhack in Servo, but raises the minimum Rust version to 1.25 (currently Nigthly)This change is