Skip to content

Commit

Permalink
servo: Merge #19316 - Fix Stylo tests to pass on both Stable and Nigh…
Browse files Browse the repository at this point in the history
…tly Rust (from servo:stylo-size-of); r=emilio

This is on top of servo/servo#19285.

Rust Nightly has new enum memory layout optimizations: rust-lang/rust#45225

Source-Repo: https://github.com/servo/servo
Source-Revision: 17e97b9320fdb7cdb33bbc5f4d0fde0653bbf2e4

UltraBlame original commit: 6de571030d5d998dcadbd3dac602fa006395165c
  • Loading branch information
marco-c committed Oct 2, 2019
1 parent 3b1fbc9 commit 7fe1e8b
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 7 deletions.
95 changes: 95 additions & 0 deletions servo/components/style/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,101 @@ crate
"
)
.
envs
(
if
std
:
:
mem
:
:
size_of
:
:
<
Option
<
bool
>
>
(
)
=
=
1
{
/
/
FIXME
:
remove
this
envs
(
)
call
/
/
and
make
unconditional
code
that
depends
on
RUSTC_HAS_PR45225
/
/
once
Firefox
requires
Rust
1
.
23
+
/
/
https
:
/
/
github
.
com
/
rust
-
lang
/
rust
/
pull
/
45225
vec
!
[
(
"
RUSTC_HAS_PR45225
"
"
1
"
)
]
}
else
{
vec
!
[
]
}
)
.
status
(
)
Expand Down
13 changes: 13 additions & 0 deletions servo/components/style/properties/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@
__file__
=
template

RUSTC_HAS_PR45225
=
os
.
environ
.
get
(
"
RUSTC_HAS_PR45225
"
)
)

if
Expand Down
13 changes: 13 additions & 0 deletions servo/components/style/properties/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,19 @@
False
"
]
"
Unexpected
value
for
boolean
arguement
:
"
+
repr
(
arg
)

return
arg
Expand Down
10 changes: 4 additions & 6 deletions servo/components/style/properties/longhand/inherited_svg.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,8 @@ gecko
"
boxed
=
"
True
"
not
RUSTC_HAS_PR45225
animation_value_type
=
"
Expand Down Expand Up @@ -980,9 +979,8 @@ gecko
"
boxed
=
"
True
"
not
RUSTC_HAS_PR45225
animation_value_type
=
"
Expand Down
3 changes: 2 additions & 1 deletion servo/components/style/properties/longhand/pointing.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,8 @@ Auto
"
boxed
=
True
not
RUSTC_HAS_PR45225
ignored_when_colors_disabled
=
True
Expand Down
55 changes: 55 additions & 0 deletions servo/tests/unit/stylo/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,61 @@ 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
=
Expand Down
24 changes: 24 additions & 0 deletions servo/tests/unit/stylo/size_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,19 @@ image
:
:
ImageLayer
if
cfg
!
(
rustc_has_pr45225
)
{
40
}
else
{
48
}
)
;
size_of_test
Expand All @@ -646,6 +658,18 @@ image
:
:
ImageLayer
if
cfg
!
(
rustc_has_pr45225
)
{
40
}
else
{
48
}
)
;

0 comments on commit 7fe1e8b

Please sign in to comment.