Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the need for rust-mozjs to use unstable Rust features #18875

Merged
merged 12 commits into from Oct 16, 2017
Merged

Conversation

@SimonSapin
Copy link
Member

SimonSapin commented Oct 14, 2017

This change is Reviewable

@highfive
Copy link

highfive commented Oct 14, 2017

Heads up! This PR modifies the following files:

  • @aneeshusa: etc/ci/buildbot_steps.yml
  • @KiChjang: components/script/dom/bindings/codegen/CodegenRust.py, components/script/dom/bindings/nonnull.rs, components/script/dom/textencoder.rs, components/script/dom/vrdisplay.rs, components/script/dom/crypto.rs and 24 more
  • @paulrouget: components/compositing/compositor.rs
  • @fitzgen: components/script/dom/bindings/codegen/CodegenRust.py, components/script/dom/bindings/nonnull.rs, components/script/dom/textencoder.rs, components/script/dom/vrdisplay.rs, components/script/dom/crypto.rs and 24 more
  • @emilio: components/script/dom/webgl_extensions/extensions.rs, components/script/dom/webgl_extensions/ext/webglvertexarrayobjectoes.rs, components/script/dom/webglrenderingcontext.rs, components/script/dom/webgl_extensions/wrapper.rs
@highfive
Copy link

highfive commented Oct 14, 2017

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
${isTypedMethod},
${slotIndex} as u16,
)
((JSJitInfo_OpType::${opType} as u8 as u32) << 0) |

This comment has been minimized.

@SimonSapin

SimonSapin Oct 14, 2017

Author Member

Next I’ll move this bit-shifting into a macro in rust-mozjs

@nox
Copy link
Member

nox commented Oct 14, 2017

I'm not really ok with the removal of NonZero without any proof that it could break in the future. We can just make a NonZeroPtr<T> that stores a &'static T or something. I'll defer to @jdm for the reviewal.

The rest looks fine to me, but it sounds like you want to remove all const functions from script, which I don't think is a good idea either, given that would require quite a bit of changes that will make the code way more uglier.

@SimonSapin
Copy link
Member Author

SimonSapin commented Oct 14, 2017

The default is still to use core::nonzero::NonZero with its memory layout optimization. This only changes memory layout when compiling with --no-default-features --features default-except-unstable. And I don’t expect anyone to actually use a build compiled with this mode. It only exists to enable more parts of Servo to be included in Rust’s upstream regression testing and performance testing.

I’m not planning to touch const fn’s in script. The JSJitInfo::new_bitfield_1 change is comparatively easy, and allows limiting the required unstable features to the servo/servo repo.

@SimonSapin
Copy link
Member Author

SimonSapin commented Oct 14, 2017

Pushed a few more commits. The last one updates rust-mozjs to a commit that hasn’t been merged yet: servo/rust-mozjs#373 so this PR should not land until that one has been reviewed.

@SimonSapin SimonSapin force-pushed the stable-js branch from 7e13e94 to 7c5fd99 Oct 14, 2017
bors-servo added a commit to servo/rust-mozjs that referenced this pull request Oct 16, 2017
Remove the use of unstable Rust features.

This modifies generated files, but http://searchfox.org/mozilla-central/source/js/rust/ already has similar changes through `rust_target(bindgen::RustTarget::Stable_1_19)`

This depends on servo/servo#18875.

<!-- 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/373)
<!-- Reviewable:end -->
@jdm
Copy link
Member

jdm commented Oct 16, 2017

This looks fine to me.

@SimonSapin
Copy link
Member Author

SimonSapin commented Oct 16, 2017

@bors-servo r=nox,jdm

@bors-servo
Copy link
Contributor

bors-servo commented Oct 16, 2017

📌 Commit 7c5fd99 has been approved by nox,jdm

@bors-servo
Copy link
Contributor

bors-servo commented Oct 16, 2017

🔒 Merge conflict

@bors-servo
Copy link
Contributor

bors-servo commented Oct 16, 2017

The latest upstream changes (presumably #18900) made this pull request unmergeable. Please resolve the merge conflicts.

@SimonSapin
Copy link
Member Author

SimonSapin commented Oct 16, 2017

@bors-servo r=nox,jdm

@bors-servo
Copy link
Contributor

bors-servo commented Oct 16, 2017

📌 Commit 49e4540 has been approved by nox,jdm

@bors-servo
Copy link
Contributor

bors-servo commented Oct 16, 2017

Testing commit 49e4540 with merge e8a6f28...

bors-servo added a commit that referenced this pull request Oct 16, 2017
Remove the need for rust-mozjs to use unstable Rust features

<!-- 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/18875)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 16, 2017

@bors-servo bors-servo merged commit 49e4540 into master Oct 16, 2017
3 of 4 checks passed
3 of 4 checks passed
dependency-ci Failed dependency checks
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@SimonSapin SimonSapin deleted the stable-js branch Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.