Skip to content
This repository was archived by the owner on Nov 12, 2022. It is now read-only.

Conversation

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Jan 21, 2018

This will allow removing the NonNullJSObjectPtr hack in Servo, but raises the minimum Rust version to 1.25 (currently Nigthly)


This change is Reviewable

@SimonSapin
Copy link
Member Author

SimonSapin commented Jan 21, 2018

@fitzgen @jdm @nox How do you feel about this repository requiring Rust 1.15 1.25? According to https://wiki.mozilla.org/Rust_Update_Policy_for_Firefox Gecko can use that version from April 12, but as far as I understand it doesn’t use this repo anyway.

@nox
Copy link
Contributor

nox commented Jan 21, 2018

I assume you meant 1.25? I don't mind.

@SimonSapin
Copy link
Member Author

Oops, yes. I mostly ask in case it interferes with plans to unify this repo with js/ in mozilla-central.

@SimonSapin
Copy link
Member Author

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.

impl ToJSValConvertible for ptr::NonNull<JSObject> {
#[inline]
unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) {
rval.set(ObjectOrNullValue(self.get()));
Copy link
Member

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.

Copy link
Member Author

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)
@SimonSapin
Copy link
Member Author

I take it "approved" means:

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

📌 Commit 5a68234 has been approved by jdm

@bors-servo
Copy link
Contributor

⌛ Testing commit 5a68234 with merge 8f5cf86...

bors-servo pushed a commit that referenced this pull request Jan 22, 2018
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 -->
@bors-servo
Copy link
Contributor

💥 Test timed out

@KiChjang
Copy link
Contributor

@bors-servo retry

@bors-servo
Copy link
Contributor

⌛ Testing commit 5a68234 with merge d5aabe3...

bors-servo pushed a commit that referenced this pull request Jan 22, 2018
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 -->
@SimonSapin
Copy link
Member Author

Eh, OS X job on Travis-CI still not scheduled after 13 hours…

@bors-servo
Copy link
Contributor

☀️ Test successful - status-appveyor, status-travis
Approved by: jdm
Pushing d5aabe3 to master...

@bors-servo bors-servo merged commit 5a68234 into master Jan 23, 2018
@SimonSapin SimonSapin deleted the nonnull branch January 23, 2018 09:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants