No bug - rustfmt recent style system changes.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 09 May 2019 19:21:58 +0200
changeset 532098 f74d8cca5c2d43a37226f80781e2ea0c0a3f7a58
parent 532097 11d0a9d33945acdff8b128b23bda54e7c92a17f6
child 532099 d82ae6b2d2d9dcd65b14721cac86494e955a1974
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
No bug - rustfmt recent style system changes.
servo/components/servo_arc/lib.rs
servo/components/style/gecko/conversions.rs
servo/components/style/gecko/values.rs
servo/components/style/values/animated/mod.rs
servo/components/style/values/specified/basic_shape.rs
servo/components/style/values/specified/svg_path.rs
servo/components/style_traits/owned_slice.rs
--- a/servo/components/servo_arc/lib.rs
+++ b/servo/components/servo_arc/lib.rs
@@ -682,17 +682,20 @@ impl<H, T> Arc<HeaderSlice<H, [T]>> {
                         items
                             .next()
                             .expect("ExactSizeIterator over-reported length"),
                     );
                     current = current.offset(1);
                 }
                 // We should have consumed the buffer exactly, maybe accounting
                 // for some padding from the alignment.
-                debug_assert!((buffer.offset(size as isize) as usize - current as *mut u8 as usize) < align_of::<Self>());
+                debug_assert!(
+                    (buffer.offset(size as isize) as usize - current as *mut u8 as usize) <
+                        align_of::<Self>()
+                );
             }
             assert!(
                 items.next().is_none(),
                 "ExactSizeIterator under-reported length"
             );
         }
 
         // Return the fat Arc.
@@ -787,17 +790,16 @@ type HeaderSliceWithLength<H, T> = Heade
 /// `ThinArc` solves this by storing the length in the allocation itself,
 /// via `HeaderSliceWithLength`.
 #[repr(C)]
 pub struct ThinArc<H, T> {
     ptr: ptr::NonNull<ArcInner<HeaderSliceWithLength<H, [T; 0]>>>,
     phantom: PhantomData<(H, T)>,
 }
 
-
 impl<H: fmt::Debug, T: fmt::Debug> fmt::Debug for ThinArc<H, T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         fmt::Debug::fmt(self.deref(), f)
     }
 }
 
 unsafe impl<H: Sync + Send, T: Sync + Send> Send for ThinArc<H, T> {}
 unsafe impl<H: Sync + Send, T: Sync + Send> Sync for ThinArc<H, T> {}
@@ -904,17 +906,20 @@ impl<H, T> Clone for ThinArc<H, T> {
     fn clone(&self) -> Self {
         ThinArc::with_arc(self, |a| Arc::into_thin(a.clone()))
     }
 }
 
 impl<H, T> Drop for ThinArc<H, T> {
     #[inline]
     fn drop(&mut self) {
-        let _ = Arc::from_thin(ThinArc { ptr: self.ptr, phantom: PhantomData, });
+        let _ = Arc::from_thin(ThinArc {
+            ptr: self.ptr,
+            phantom: PhantomData,
+        });
     }
 }
 
 impl<H, T> Arc<HeaderSliceWithLength<H, [T]>> {
     /// Converts an `Arc` into a `ThinArc`. This consumes the `Arc`, so the refcount
     /// is not modified.
     #[inline]
     pub fn into_thin(a: Self) -> ThinArc<H, T> {
@@ -923,17 +928,19 @@ impl<H, T> Arc<HeaderSliceWithLength<H, 
             a.slice.len(),
             "Length needs to be correct for ThinArc to work"
         );
         let fat_ptr: *mut ArcInner<HeaderSliceWithLength<H, [T]>> = a.ptr();
         mem::forget(a);
         let thin_ptr = fat_ptr as *mut [usize] as *mut usize;
         ThinArc {
             ptr: unsafe {
-                ptr::NonNull::new_unchecked(thin_ptr as *mut ArcInner<HeaderSliceWithLength<H, [T; 0]>>)
+                ptr::NonNull::new_unchecked(
+                    thin_ptr as *mut ArcInner<HeaderSliceWithLength<H, [T; 0]>>,
+                )
             },
             phantom: PhantomData,
         }
     }
 
     /// Converts a `ThinArc` into an `Arc`. This consumes the `ThinArc`, so the refcount
     /// is not modified.
     #[inline]
--- a/servo/components/style/gecko/conversions.rs
+++ b/servo/components/style/gecko/conversions.rs
@@ -531,22 +531,20 @@ impl nsStyleImage {
 }
 
 pub mod basic_shape {
     //! Conversions from and to CSS shape representations.
     use crate::gecko_bindings::structs::{
         StyleGeometryBox, StyleShapeSource, StyleShapeSourceType,
     };
     use crate::gecko_bindings::sugar::refptr::RefPtr;
-    use crate::values::computed::basic_shape::{
-        BasicShape, ClippingShape, FloatAreaShape,
-    };
+    use crate::values::computed::basic_shape::{BasicShape, ClippingShape, FloatAreaShape};
     use crate::values::computed::motion::OffsetPath;
     use crate::values::computed::url::ComputedUrl;
-    use crate::values::generics::basic_shape::{Path, GeometryBox, ShapeBox, ShapeSource};
+    use crate::values::generics::basic_shape::{GeometryBox, Path, ShapeBox, ShapeSource};
     use crate::values::specified::SVGPathData;
 
     impl StyleShapeSource {
         /// Convert StyleShapeSource to ShapeSource except URL and Image
         /// types.
         fn into_shape_source<ReferenceBox, ImageOrUrl>(
             &self,
         ) -> Option<ShapeSource<BasicShape, ReferenceBox, ImageOrUrl>>
--- a/servo/components/style/gecko/values.rs
+++ b/servo/components/style/gecko/values.rs
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 
 #![allow(unsafe_code)]
 
 //! Different kind of helpers to interact with Gecko values.
 
 use crate::counter_style::{Symbol, Symbols};
+use crate::gecko_bindings::structs::StyleGridTrackBreadth;
 use crate::gecko_bindings::structs::{nsStyleCoord, CounterStylePtr};
-use crate::gecko_bindings::structs::StyleGridTrackBreadth;
 use crate::gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, CoordDataValue};
 use crate::values::computed::{Angle, Length, LengthPercentage};
 use crate::values::computed::{Number, NumberOrPercentage, Percentage};
 use crate::values::generics::gecko::ScrollSnapPoint;
 use crate::values::generics::grid::{TrackBreadth, TrackKeyword};
 use crate::values::generics::length::LengthPercentageOrAuto;
 use crate::values::generics::{CounterStyleOrNone, NonNegative};
 use crate::values::Either;
--- a/servo/components/style/values/animated/mod.rs
+++ b/servo/components/style/values/animated/mod.rs
@@ -293,27 +293,25 @@ where
     }
 
     #[inline]
     fn from_animated_value(animated: Self::AnimatedValue) -> Self {
         Box::new(T::from_animated_value(*animated))
     }
 }
 
-
 impl<T> ToAnimatedValue for Box<[T]>
 where
     T: ToAnimatedValue,
 {
     type AnimatedValue = Box<[<T as ToAnimatedValue>::AnimatedValue]>;
 
     #[inline]
     fn to_animated_value(self) -> Self::AnimatedValue {
-        self
-            .into_vec()
+        self.into_vec()
             .into_iter()
             .map(T::to_animated_value)
             .collect::<Vec<_>>()
             .into_boxed_slice()
     }
 
     #[inline]
     fn from_animated_value(animated: Self::AnimatedValue) -> Self {
--- a/servo/components/style/values/specified/basic_shape.rs
+++ b/servo/components/style/values/specified/basic_shape.rs
@@ -347,22 +347,24 @@ impl Polygon {
         let fill = input
             .try(|i| -> Result<_, ParseError> {
                 let fill = FillRule::parse(i)?;
                 i.expect_comma()?; // only eat the comma if there is something before it
                 Ok(fill)
             })
             .unwrap_or_default();
 
-        let coordinates = input.parse_comma_separated(|i| {
-            Ok(PolygonCoord(
-                LengthPercentage::parse(context, i)?,
-                LengthPercentage::parse(context, i)?,
-            ))
-        })?.into();
+        let coordinates = input
+            .parse_comma_separated(|i| {
+                Ok(PolygonCoord(
+                    LengthPercentage::parse(context, i)?,
+                    LengthPercentage::parse(context, i)?,
+                ))
+            })?
+            .into();
 
         Ok(Polygon { fill, coordinates })
     }
 }
 
 impl Parse for Path {
     fn parse<'i, 't>(
         context: &ParserContext,
--- a/servo/components/style/values/specified/svg_path.rs
+++ b/servo/components/style/values/specified/svg_path.rs
@@ -28,18 +28,17 @@ use style_traits::{CssWriter, ParseError
     ToComputedValue,
     ToResolvedValue,
     ToShmem,
 )]
 #[repr(C)]
 pub struct SVGPathData(
     // TODO(emilio): Should probably measure this somehow only from the
     // specified values.
-    #[ignore_malloc_size_of = "Arc"]
-    pub crate::ArcSlice<PathCommand>
+    #[ignore_malloc_size_of = "Arc"] pub crate::ArcSlice<PathCommand>,
 );
 
 impl SVGPathData {
     /// Get the array of PathCommand.
     #[inline]
     pub fn commands(&self) -> &[PathCommand] {
         debug_assert!(!self.0.is_empty());
         &self.0
@@ -98,17 +97,19 @@ impl Parse for SVGPathData {
         // Parse the svg path string as multiple sub-paths.
         let mut path_parser = PathParser::new(path_string);
         while skip_wsp(&mut path_parser.chars) {
             if path_parser.parse_subpath().is_err() {
                 return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
             }
         }
 
-        Ok(SVGPathData(crate::ArcSlice::from_iter(path_parser.path.into_iter())))
+        Ok(SVGPathData(crate::ArcSlice::from_iter(
+            path_parser.path.into_iter(),
+        )))
     }
 }
 
 impl Animate for SVGPathData {
     fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
         if self.0.len() != other.0.len() {
             return Err(());
         }
--- a/servo/components/style_traits/owned_slice.rs
+++ b/servo/components/style_traits/owned_slice.rs
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 
 #![allow(unsafe_code)]
 
 //! A replacement for `Box<[T]>` that cbindgen can understand.
 
+use malloc_size_of::{MallocShallowSizeOf, MallocSizeOf, MallocSizeOfOps};
 use std::marker::PhantomData;
-use std::{fmt, mem, slice};
+use std::ops::{Deref, DerefMut};
 use std::ptr::NonNull;
-use std::ops::{Deref, DerefMut};
-use malloc_size_of::{MallocSizeOf, MallocShallowSizeOf, MallocSizeOfOps};
+use std::{fmt, mem, slice};
 use to_shmem::{SharedMemoryBuilder, ToShmem};
 
 /// A struct that basically replaces a `Box<[T]>`, but which cbindgen can
 /// understand.
 ///
 /// We could rely on the struct layout of `Box<[T]>` per:
 ///
 ///   https://github.com/rust-lang/unsafe-code-guidelines/blob/master/reference/src/layout/pointers.md
@@ -81,19 +81,17 @@ impl<T: Sized> OwnedSlice<T> {
     #[inline]
     pub fn into_box(self) -> Box<[T]> {
         self.into_vec().into_boxed_slice()
     }
 
     /// Convert the OwnedSlice into a Vec.
     #[inline]
     pub fn into_vec(self) -> Vec<T> {
-        let ret = unsafe {
-            Vec::from_raw_parts(self.ptr.as_ptr(), self.len, self.len)
-        };
+        let ret = unsafe { Vec::from_raw_parts(self.ptr.as_ptr(), self.len, self.len) };
         mem::forget(self);
         ret
     }
 
     /// Iterate over all the elements in the slice taking ownership of them.
     #[inline]
     pub fn into_iter(self) -> impl Iterator<Item = T> {
         self.into_vec().into_iter()