Fix some warnings

This commit is contained in:
Simon Sapin 2017-09-02 18:41:25 +02:00
parent e94d8d5bc1
commit fae2da0f59
4 changed files with 2 additions and 30 deletions

View file

@ -11,7 +11,7 @@ use servo_config::prefs::{PREFS, PrefValue};
use servo_url::ServoUrl;
use style::context::QuirksMode;
use style::media_queries::{Device, MediaList, MediaType};
use style::parser::{Parse, ParserContext, ParserErrorContext};
use style::parser::{ParserContext, ParserErrorContext};
use style::shared_lock::SharedRwLock;
use style::stylesheets::{CssRuleType, Stylesheet, StylesheetInDocument, Origin};
use style::stylesheets::viewport_rule::*;

View file

@ -12,7 +12,6 @@ extern crate selectors;
#[macro_use] extern crate style;
extern crate style_traits;
mod sanity_checks;
#[cfg(target_pointer_width = "64")]
mod size_of;
mod specified_values;

View file

@ -1,28 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Different static asserts that ensure the build does what it's expected to.
//!
//! TODO: maybe cfg(test) this?
#![allow(unused_imports)]
use std::mem;
macro_rules! check_enum_value {
($a:expr, $b:expr) => {
unsafe {
mem::transmute::<[u32; $a as usize],
[u32; $b as usize]>([0; $a as usize]);
}
}
}
// NB: It's a shame we can't do this statically with bitflags, but no
// const-fn and no other way to access the numerical value :-(
macro_rules! check_enum_value_non_static {
($a:expr, $b:expr) => {
assert_eq!($a.0 as usize, $b as usize);
}
}

View file

@ -5,6 +5,7 @@
use style;
#[cfg(all(test, target_pointer_width = "64"))]
#[test]
fn size_of_specified_values() {
use std::mem::size_of;
let threshold = 24;