Auto merge of #16473 - servo:rustup, r=emilio

Upgrade to rustc 1.18.0-nightly (5f13a3b54 2017-04-15)

This version enables [struct field reordering][1] which brings the size of the types for specified values of some CSS properties under the threshold such that they shouldn’t be boxed anymore, making unit tests fail.

Simply unboxing them moves the test failure to Stylo’s unit tests, since the stable compiler used in that case does not do field re-ordering. Therefore, we manually reorder a couple fields to effectively bring this optimization to older compilers for a few specific types.

[1]: https://github.com/rust-lang/rust/pull/40377

<!-- 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/16473)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-04-16 00:13:28 -05:00 committed by GitHub
commit c453e2ef89
11 changed files with 50 additions and 53 deletions

View file

@ -36,7 +36,7 @@ ${helpers.gecko_keyword_conversion(Keyword('border-style',
"none solid double dotted dashed hidden groove ridge inset outset"),
type="::values::specified::BorderStyle")}
% for side in ALL_SIDES:
<%helpers:longhand name="border-${side[0]}-width" boxed="True" animation_type="normal" logical="${side[1]}"
<%helpers:longhand name="border-${side[0]}-width" animation_type="normal" logical="${side[1]}"
alias="${maybe_moz_logical_alias(product, side, '-moz-border-%s-width')}"
spec="${maybe_logical_spec(side, 'width')}">
use app_units::Au;

View file

@ -1864,7 +1864,6 @@ ${helpers.predefined_type("perspective",
gecko_ffi_name="mChildPerspective",
spec="https://drafts.csswg.org/css-transforms/#perspective",
extra_prefixes="moz webkit",
boxed=True,
creates_stacking_context=True,
fixpos_cb=True,
animation_type="normal")}

View file

@ -13,7 +13,6 @@ ${helpers.predefined_type("column-width",
initial_specified_value="Either::Second(Auto)",
parse_method="parse_non_negative_length",
extra_prefixes="moz",
boxed=True,
animation_type="none",
experimental=True,
spec="https://drafts.csswg.org/css-multicol/#propdef-column-width")}
@ -36,7 +35,6 @@ ${helpers.predefined_type("column-gap",
parse_method='parse_non_negative_length',
extra_prefixes="moz",
experimental=True,
boxed=True,
animation_type="none",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-gap")}
@ -45,7 +43,7 @@ ${helpers.single_keyword("column-fill", "balance auto", extra_prefixes="moz",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-fill")}
// https://drafts.csswg.org/css-multicol-1/#propdef-column-rule-width
<%helpers:longhand name="column-rule-width" products="gecko" boxed="True" animation_type="normal" extra_prefixes="moz"
<%helpers:longhand name="column-rule-width" products="gecko" animation_type="normal" extra_prefixes="moz"
spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-width">
use app_units::Au;
use std::fmt;

View file

@ -406,7 +406,7 @@ ${helpers.single_keyword("text-align-last",
% endif
</%helpers:longhand>
<%helpers:longhand name="letter-spacing" boxed="True" animation_type="normal"
<%helpers:longhand name="letter-spacing" animation_type="normal"
spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing">
use std::fmt;
use style_traits::ToCss;
@ -1211,7 +1211,7 @@ ${helpers.predefined_type(
"-moz-tab-size", "LengthOrNumber",
"::values::Either::Second(8.0)",
"parse_non_negative",
products="gecko", boxed=True, animation_type="none",
products="gecko", animation_type="none",
spec="https://drafts.csswg.org/css-text-3/#tab-size-property")}
@ -1232,7 +1232,7 @@ ${helpers.predefined_type(
complex_color=True, need_clone=True,
spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-color")}
<%helpers:longhand products="gecko" name="-webkit-text-stroke-width" boxed="True" animation_type="none"
<%helpers:longhand products="gecko" name="-webkit-text-stroke-width" animation_type="none"
spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-width">
use app_units::Au;
use std::fmt;

View file

@ -46,7 +46,7 @@ impl ToComputedValue for specified::Length {
fn to_computed_value(&self, context: &Context) -> Au {
match *self {
specified::Length::NoCalc(l) => l.to_computed_value(context),
specified::Length::Calc(ref calc, range) => range.clamp(calc.to_computed_value(context).length()),
specified::Length::Calc(range, ref calc) => range.clamp(calc.to_computed_value(context).length()),
}
}

View file

@ -465,7 +465,7 @@ pub enum Length {
/// A calc expression.
///
/// https://drafts.csswg.org/css-values/#calc-notation
Calc(Box<CalcLengthOrPercentage>, AllowedLengthType),
Calc(AllowedLengthType, Box<CalcLengthOrPercentage>),
}
impl From<NoCalcLength> for Length {
@ -479,7 +479,7 @@ impl HasViewportPercentage for Length {
fn has_viewport_percentage(&self) -> bool {
match *self {
Length::NoCalc(ref inner) => inner.has_viewport_percentage(),
Length::Calc(ref calc, _) => calc.has_viewport_percentage(),
Length::Calc(_, ref calc) => calc.has_viewport_percentage(),
}
}
}
@ -488,7 +488,7 @@ impl ToCss for Length {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
match *self {
Length::NoCalc(ref inner) => inner.to_css(dest),
Length::Calc(ref calc, _) => calc.to_css(dest),
Length::Calc(_, ref calc) => calc.to_css(dest),
}
}
}
@ -828,7 +828,7 @@ impl CalcLengthOrPercentage {
input: &mut Parser,
num_context: AllowedLengthType) -> Result<Length, ()> {
CalcLengthOrPercentage::parse(context, input, CalcUnit::Length).map(|calc| {
Length::Calc(Box::new(calc), num_context)
Length::Calc(num_context, Box::new(calc))
})
}
@ -1091,7 +1091,7 @@ impl From<Length> for LengthOrPercentage {
fn from(len: Length) -> LengthOrPercentage {
match len {
Length::NoCalc(l) => LengthOrPercentage::Length(l),
Length::Calc(l, _) => LengthOrPercentage::Calc(l),
Length::Calc(_, l) => LengthOrPercentage::Calc(l),
}
}
}