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 d9f645a commit 4dec72d
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 7 deletions.
46 changes: 46 additions & 0 deletions servo/components/style/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,52 @@ crate
"
)
.
envs
(
if
std
:
:
mem
:
:
size_of
:
:
<
Option
<
bool
>
>
(
)
=
=
1
{
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 @@ -258,6 +258,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 @@ -1107,6 +1107,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 @@ -564,9 +564,8 @@ gecko
"
boxed
=
"
True
"
not
RUSTC_HAS_PR45225
animation_value_type
=
"
Expand Down Expand Up @@ -922,9 +921,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 @@ -1516,7 +1516,8 @@ Auto
"
boxed
=
True
not
RUSTC_HAS_PR45225
ignored_when_colors_disabled
=
True
Expand Down
36 changes: 36 additions & 0 deletions servo/tests/unit/stylo/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,42 @@ main
(
)
{
if
std
:
:
mem
:
:
size_of
:
:
<
Option
<
bool
>
>
(
)
=
=
1
{
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 @@ -416,7 +416,19 @@ image
:
:
ImageLayer
if
cfg
!
(
rustc_has_pr45225
)
{
40
}
else
{
48
}
)
;
size_of_test
Expand All @@ -430,6 +442,18 @@ image
:
:
ImageLayer
if
cfg
!
(
rustc_has_pr45225
)
{
40
}
else
{
48
}
)
;

0 comments on commit 4dec72d

Please sign in to comment.