Auto merge of #18875 - servo:stable-js, r=nox,jdm

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 -->
This commit is contained in:
bors-servo 2017-10-16 17:07:50 -05:00 committed by GitHub
commit e8a6f2862c
44 changed files with 268 additions and 218 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use euclid::Size2D;
use nonzero::NonZeroU32;
use nonzero::NonZero;
use offscreen_gl_context::{GLContextAttributes, GLLimits};
use std::fmt;
use webrender_api::{DocumentId, ImageKey, PipelineId};
@ -253,13 +253,13 @@ pub enum WebGLCommand {
macro_rules! define_resource_id_struct {
($name:ident) => {
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub struct $name(NonZeroU32);
pub struct $name(NonZero<u32>);
impl $name {
#[allow(unsafe_code)]
#[inline]
pub unsafe fn new(id: u32) -> Self {
$name(NonZeroU32::new_unchecked(id))
$name(NonZero::new_unchecked(id))
}
#[inline]