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

@ -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),
}
}
}