mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
Auto merge of #19316 - servo:stylo-size-of, r=emilio
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 <!-- 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/19316) <!-- Reviewable:end -->
This commit is contained in:
commit
17e97b9320
7 changed files with 25 additions and 7 deletions
|
@ -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");
|
||||
|
|
|
@ -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, 48);
|
||||
size_of_test!(test_size_of_specified_image_layer, specified::image::ImageLayer, 48);
|
||||
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 });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue