diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-08-17 11:05:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-17 11:05:32 -0500 |
commit | cc86ca2bcdec5e89ee5279085ea38db63ef41af9 (patch) | |
tree | a09b090cb4d7ea965354af9971fca97a238ae49d | |
parent | b6e0f4e9523d61ddbcef755e2d5887e05016e0a4 (diff) | |
parent | 35282042bcf59770a6067a1dc09bf5579ae3f774 (diff) | |
download | servo-cc86ca2bcdec5e89ee5279085ea38db63ef41af9.tar.gz servo-cc86ca2bcdec5e89ee5279085ea38db63ef41af9.zip |
Auto merge of #18126 - servo:glow-fox, r=emilio
geckolib: Fix some warnings (treated as error) new in Rust Nigthly
<!-- 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/18126)
<!-- Reviewable:end -->
-rw-r--r-- | components/style/gecko/conversions.rs | 2 | ||||
-rw-r--r-- | components/style/gecko/wrapper.rs | 2 | ||||
-rw-r--r-- | components/style/gecko_bindings/sugar/ns_t_array.rs | 4 | ||||
-rw-r--r-- | components/style/properties/gecko.mako.rs | 18 | ||||
-rw-r--r-- | components/style/style_adjuster.rs | 4 | ||||
-rw-r--r-- | ports/geckolib/glue.rs | 12 |
6 files changed, 21 insertions, 21 deletions
diff --git a/components/style/gecko/conversions.rs b/components/style/gecko/conversions.rs index 327b4b056ec..f8455749ae3 100644 --- a/components/style/gecko/conversions.rs +++ b/components/style/gecko/conversions.rs @@ -352,7 +352,7 @@ impl nsStyleImage { // NB: stops are guaranteed to be none in the gecko side by // default. - let mut gecko_stop = unsafe { + let gecko_stop = unsafe { &mut (*gecko_gradient).mStops[index] }; let mut coord = nsStyleCoord::null(); diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 59c0b040d9f..e4e0936c203 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -413,7 +413,7 @@ impl<'lb> GeckoXBLBinding<'lb> { } } - fn each_xbl_stylist<F>(self, mut f: &mut F) + fn each_xbl_stylist<F>(self, f: &mut F) where F: FnMut(&Stylist), { diff --git a/components/style/gecko_bindings/sugar/ns_t_array.rs b/components/style/gecko_bindings/sugar/ns_t_array.rs index 6bc389702f5..068e10ddea1 100644 --- a/components/style/gecko_bindings/sugar/ns_t_array.rs +++ b/components/style/gecko_bindings/sugar/ns_t_array.rs @@ -90,7 +90,7 @@ impl<T> nsTArray<T> { // this can leak debug_assert!(len >= self.len() as u32); self.ensure_capacity(len as usize); - let mut header = self.header_mut(); + let header = self.header_mut(); header.mLength = len; } @@ -99,7 +99,7 @@ impl<T> nsTArray<T> { /// This will not leak since it only works on POD types (and thus doesn't assert) pub unsafe fn set_len_pod(&mut self, len: u32) where T: Copy { self.ensure_capacity(len as usize); - let mut header = unsafe { self.header_mut() }; + let header = unsafe { self.header_mut() }; header.mLength = len; } } diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 6d3b1cc4ce8..682e2cfb39a 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -4432,14 +4432,14 @@ fn static_assert() { fn init_shadow(filter: &mut nsStyleFilter) -> &mut nsCSSShadowArray { unsafe { let ref mut union = filter.__bindgen_anon_1; - let mut shadow_array: &mut *mut nsCSSShadowArray = union.mDropShadow.as_mut(); + let shadow_array: &mut *mut nsCSSShadowArray = union.mDropShadow.as_mut(); *shadow_array = Gecko_NewCSSShadowArray(1); &mut **shadow_array } } - let mut gecko_shadow = init_shadow(gecko_filter); + let gecko_shadow = init_shadow(gecko_filter); gecko_shadow.mArray[0].set_from_simple_shadow(shadow); }, Url(ref url) => { @@ -4988,14 +4988,14 @@ fn static_assert() { unsafe { // We have to be very careful to avoid a copy here! let ref mut union = ${ident}.__bindgen_anon_1; - let mut shape: &mut *mut StyleBasicShape = union.mBasicShape.as_mut(); + let shape: &mut *mut StyleBasicShape = union.mBasicShape.as_mut(); *shape = Gecko_NewBasicShape(ty); &mut **shape } } match servo_shape { BasicShape::Inset(inset) => { - let mut shape = init_shape(${ident}, StyleBasicShapeType::Inset); + let shape = init_shape(${ident}, StyleBasicShapeType::Inset); unsafe { shape.mCoordinates.set_len(4) }; // set_len() can't call constructors, so the coordinates @@ -5017,7 +5017,7 @@ fn static_assert() { set_corners_from_radius(inset.round, &mut shape.mRadius); } BasicShape::Circle(circ) => { - let mut shape = init_shape(${ident}, StyleBasicShapeType::Circle); + let shape = init_shape(${ident}, StyleBasicShapeType::Circle); unsafe { shape.mCoordinates.set_len(1) }; shape.mCoordinates[0].leaky_set_null(); circ.radius.to_gecko_style_coord(&mut shape.mCoordinates[0]); @@ -5025,7 +5025,7 @@ fn static_assert() { shape.mPosition = circ.position.into(); } BasicShape::Ellipse(el) => { - let mut shape = init_shape(${ident}, StyleBasicShapeType::Ellipse); + let shape = init_shape(${ident}, StyleBasicShapeType::Ellipse); unsafe { shape.mCoordinates.set_len(2) }; shape.mCoordinates[0].leaky_set_null(); el.semiaxis_x.to_gecko_style_coord(&mut shape.mCoordinates[0]); @@ -5035,7 +5035,7 @@ fn static_assert() { shape.mPosition = el.position.into(); } BasicShape::Polygon(poly) => { - let mut shape = init_shape(${ident}, StyleBasicShapeType::Polygon); + let shape = init_shape(${ident}, StyleBasicShapeType::Polygon); unsafe { shape.mCoordinates.set_len(poly.coordinates.len() as u32 * 2); } @@ -5150,7 +5150,7 @@ clip-path unsafe { bindings::Gecko_nsStyleSVG_SetDashArrayLength(&mut self.gecko, v.len() as u32); } - for (mut gecko, servo) in self.gecko.mStrokeDasharray.iter_mut().zip(v) { + for (gecko, servo) in self.gecko.mStrokeDasharray.iter_mut().zip(v) { match servo { Either::First(number) => gecko.set_value(CoordDataValue::Factor(number.into())), Either::Second(lop) => gecko.set(lop), @@ -5216,7 +5216,7 @@ clip-path } self.gecko.mContextPropsBits = 0; - for (mut gecko, servo) in self.gecko.mContextProps.iter_mut().zip(v) { + for (gecko, servo) in self.gecko.mContextProps.iter_mut().zip(v) { if servo.0 == atom!("fill") { self.gecko.mContextPropsBits |= structs::NS_STYLE_CONTEXT_PROPERTY_FILL as u8; } else if servo.0 == atom!("stroke") { diff --git a/components/style/style_adjuster.rs b/components/style/style_adjuster.rs index b59841abc02..9e0a0e9b409 100644 --- a/components/style/style_adjuster.rs +++ b/components/style/style_adjuster.rs @@ -198,7 +198,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { // When 'contain: paint', update overflow from 'visible' to 'clip'. if self.style.get_box().clone_contain().contains(contain::PAINT) { if self.style.get_box().clone_overflow_x() == overflow::visible { - let mut box_style = self.style.mutate_box(); + let box_style = self.style.mutate_box(); box_style.set_overflow_x(overflow::_moz_hidden_unscrollable); box_style.set_overflow_y(overflow::_moz_hidden_unscrollable); } @@ -213,7 +213,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { use properties::longhands::font_style::computed_value::T as font_style; use properties::longhands::font_weight::computed_value::T as font_weight; if self.style.get_font().clone__moz_math_variant() != moz_math_variant::none { - let mut font_style = self.style.mutate_font(); + let font_style = self.style.mutate_font(); // Sadly we don't have a nice name for the computed value // of "font-weight: normal". font_style.set_font_weight(font_weight::normal()); diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 4d6061206f2..b362f768afb 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -888,7 +888,7 @@ pub extern "C" fn Servo_StyleSet_AppendStyleSheet( ) { let global_style_data = &*GLOBAL_STYLE_DATA; let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); - let mut data = &mut *data; + let data = &mut *data; let guard = global_style_data.shared_lock.read(); let sheet = unsafe { GeckoStyleSheet::new(sheet) }; data.stylesheets.append_stylesheet(&data.stylist, sheet, &guard); @@ -937,7 +937,7 @@ pub extern "C" fn Servo_StyleSet_PrependStyleSheet( ) { let global_style_data = &*GLOBAL_STYLE_DATA; let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); - let mut data = &mut *data; + let data = &mut *data; let guard = global_style_data.shared_lock.read(); let sheet = unsafe { GeckoStyleSheet::new(sheet) }; data.stylesheets.prepend_stylesheet(&data.stylist, sheet, &guard); @@ -951,7 +951,7 @@ pub extern "C" fn Servo_StyleSet_InsertStyleSheetBefore( ) { let global_style_data = &*GLOBAL_STYLE_DATA; let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); - let mut data = &mut *data; + let data = &mut *data; let guard = global_style_data.shared_lock.read(); let sheet = unsafe { GeckoStyleSheet::new(sheet) }; data.stylesheets.insert_stylesheet_before( @@ -969,7 +969,7 @@ pub extern "C" fn Servo_StyleSet_RemoveStyleSheet( ) { let global_style_data = &*GLOBAL_STYLE_DATA; let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); - let mut data = &mut *data; + let data = &mut *data; let guard = global_style_data.shared_lock.read(); let sheet = unsafe { GeckoStyleSheet::new(sheet) }; data.stylesheets.remove_stylesheet(&data.stylist, sheet, &guard); @@ -1359,7 +1359,7 @@ pub extern "C" fn Servo_StyleRule_GetSpecificityAtIndex( specificity: *mut u64 ) { read_locked_arc(rule, |rule: &StyleRule| { - let mut specificity = unsafe { specificity.as_mut().unwrap() }; + let specificity = unsafe { specificity.as_mut().unwrap() }; let index = index as usize; if index >= rule.selectors.0.len() { *specificity = 0; @@ -2831,7 +2831,7 @@ pub extern "C" fn Servo_NoteExplicitHints(element: RawGeckoElementBorrowed, pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed, was_restyled: *mut bool) -> u32 { - let mut was_restyled = unsafe { was_restyled.as_mut().unwrap() }; + let was_restyled = unsafe { was_restyled.as_mut().unwrap() }; let element = GeckoElement(element); let damage = match element.mutate_data() { |