Fix Stylo tests to pass on both Stable and Nightly Rust.

This is on top of https://github.com/servo/servo/pull/19285.

Rust Nightly has new enum memory layout optimizations:
https://github.com/rust-lang/rust/pull/45225
This commit is contained in:
Simon Sapin 2017-11-21 12:15:06 +01:00
parent 6031de9a39
commit aaba33e56b
7 changed files with 25 additions and 4 deletions

View file

@ -11,6 +11,11 @@ use std::io::{BufRead, BufReader, Write};
use std::path::Path;
fn main() {
if std::mem::size_of::<Option<bool>>() == 1 {
// https://github.com/rust-lang/rust/pull/45225
println!("cargo:rustc-cfg=rustc_has_pr45225")
}
let root_path = Path::new("../../../");
let bindings_file = root_path.join("components/style/gecko/generated/bindings.rs");
let glue_file = root_path.join("ports/geckolib/glue.rs");

View file

@ -57,5 +57,7 @@ size_of_test!(test_size_of_specified_image, specified::image::Image, 40);
// FIXME(bz): These can shrink if we move the None_ value inside the
// enum instead of paying an extra word for the Either discriminant.
size_of_test!(test_size_of_computed_image_layer, computed::image::ImageLayer, 40);
size_of_test!(test_size_of_specified_image_layer, specified::image::ImageLayer, 40);
size_of_test!(test_size_of_computed_image_layer, computed::image::ImageLayer,
if cfg!(rustc_has_pr45225) { 40 } else { 48 });
size_of_test!(test_size_of_specified_image_layer, specified::image::ImageLayer,
if cfg!(rustc_has_pr45225) { 40 } else { 48 });