firefox: update to 57.0.

This commit is contained in:
Enno Boland 2017-11-14 10:53:55 +01:00 committed by Enno Boland
parent 13bab4357e
commit 7ac0dd9267
8 changed files with 2 additions and 1267 deletions

View file

@ -45,5 +45,4 @@ ac_add_options --enable-pie
ac_add_options --enable-release
ac_add_options --enable-official-branding
ac_add_options --enable-safe-browsing
ac_add_options --enable-application=browser

View file

@ -1,17 +0,0 @@
--- xpcom/ds/nsMathUtils.h.orig
+++ xpcom/ds/nsMathUtils.h
@@ -104,12 +104,12 @@
#ifdef WIN32
// NOTE: '!!' casts an int to bool without spamming MSVC warning C4800.
return !!_finite(aNum);
-#elif defined(XP_DARWIN)
+#elif defined(XP_DARWIN) || defined(_GLIBCXX_CMATH)
// Darwin has deprecated |finite| and recommends |isfinite|. The former is
// not present in the iOS SDK.
return std::isfinite(aNum);
#else
- return finite(aNum);
+ return isfinite(aNum);
#endif
}

View file

@ -1,89 +0,0 @@
commit efbe3a9af876
Author: Manish Goregaokar <manishearth@gmail.com>
Date: Wed Aug 2 11:24:35 2017 -0700
Bug 1386887 - Clean up FFI lifetimes to work on nightly; r=emilio
MozReview-Commit-ID: 5WAIVd6p2du
---
layout/style/ServoBindingList.h | 4 ++--
layout/style/ServoBindingTypes.h | 2 ++
layout/style/ServoBindings.h | 4 ++--
layout/style/ServoBindings.toml | 4 +++-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git layout/style/ServoBindingList.h layout/style/ServoBindingList.h
index 6c669ebb3d3e..87ade14ea4de 100644
--- layout/style/ServoBindingList.h
+++ layout/style/ServoBindingList.h
@@ -379,10 +379,10 @@ SERVO_BINDING_FUNC(Servo_DeclarationBlock_HasCSSWideKeyword, bool,
nsCSSPropertyID property)
// Compose animation value for a given property.
// |base_values| is nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>.
-// We use void* to avoid exposing nsRefPtrHashtable in FFI.
+// We use RawServoAnimationValueTableBorrowed to avoid exposing nsRefPtrHashtable in FFI.
SERVO_BINDING_FUNC(Servo_AnimationCompose, void,
RawServoAnimationValueMapBorrowedMut animation_values,
- void* base_values,
+ RawServoAnimationValueTableBorrowed base_values,
nsCSSPropertyID property,
RawGeckoAnimationPropertySegmentBorrowed animation_segment,
RawGeckoAnimationPropertySegmentBorrowed last_segment,
diff --git layout/style/ServoBindingTypes.h layout/style/ServoBindingTypes.h
index aaf4fc27e1b9..69be15ee9f51 100644
--- layout/style/ServoBindingTypes.h
+++ layout/style/ServoBindingTypes.h
@@ -54,6 +54,8 @@ class nsXBLBinding;
using mozilla::dom::StyleChildrenIterator;
using mozilla::ServoElementSnapshot;
+typedef void* RawServoAnimationValueTableBorrowed;
+
typedef nsINode RawGeckoNode;
typedef mozilla::dom::Element RawGeckoElement;
typedef nsIDocument RawGeckoDocument;
diff --git layout/style/ServoBindings.h layout/style/ServoBindings.h
index 493ca63f932b..c6ced6d1fedb 100644
--- layout/style/ServoBindings.h
+++ layout/style/ServoBindings.h
@@ -268,9 +268,9 @@ double Gecko_GetPositionInSegment(
// Get servo's AnimationValue for |aProperty| from the cached base style
// |aBaseStyles|.
// |aBaseStyles| is nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>.
-// We use void* to avoid exposing nsRefPtrHashtable in FFI.
+// We use RawServoAnimationValueTableBorrowed to avoid exposing nsRefPtrHashtable in FFI.
RawServoAnimationValueBorrowedOrNull Gecko_AnimationGetBaseStyle(
- void* aBaseStyles,
+ RawServoAnimationValueTableBorrowed aBaseStyles,
nsCSSPropertyID aProperty);
void Gecko_StyleTransition_SetUnsupportedProperty(
mozilla::StyleTransition* aTransition,
diff --git layout/style/ServoBindings.toml layout/style/ServoBindings.toml
index 11e372541235..3c3902beea80 100644
--- layout/style/ServoBindings.toml
+++ layout/style/ServoBindings.toml
@@ -357,6 +357,7 @@ raw-lines = [
"pub type ServoStyleContextBorrowed<'a> = &'a ::properties::ComputedValues;",
"pub type ServoStyleContextBorrowedOrNull<'a> = Option<&'a ::properties::ComputedValues>;",
"pub type ServoComputedDataBorrowed<'a> = &'a ServoComputedData;",
+ "pub type RawServoAnimationValueTableBorrowed<'a> = &'a ();"
]
whitelist-functions = ["Servo_.*", "Gecko_.*"]
structs-types = [
@@ -389,7 +390,7 @@ structs-types = [
"RawGeckoPresContext",
"RawGeckoPresContextOwned",
"RawGeckoStyleAnimationList",
- "RawGeckoStyleChildrenIteratorBorrowedMut",
+ "RawGeckoStyleChildrenIterator",
"RawGeckoServoStyleRuleList",
"RawGeckoURLExtraData",
"RawGeckoXBLBinding",
@@ -526,6 +527,7 @@ servo-borrow-types = [
"RawGeckoFontFaceRuleList",
"RawGeckoServoStyleRuleList",
"RawGeckoServoAnimationValueList",
+ "RawGeckoStyleChildrenIterator",
]
fixups = [
# hack for gecko-owned string

View file

@ -1,53 +0,0 @@
commit 4cbdfa028752
Author: Manish Goregaokar <manishsmail@gmail.com>
Date: Tue Aug 1 12:57:42 2017 -0500
servo: Merge #17934 - Remove doc comment on statement (from Manishearth:doc-comment); r=canaltinova
rustc warns about these now
Source-Repo: https://github.com/servo/servo
Source-Revision: b49311c65a083a9b8eb03741bf7ea980b64f1e03
--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 6b3c7d7f4ffeb9e271c52d418cda42cac5dd378d
---
servo/components/style/values/specified/image.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git servo/components/style/values/specified/image.rs servo/components/style/values/specified/image.rs
index 37ed00ccf443..687c6f17d432 100644
--- servo/components/style/values/specified/image.rs
+++ servo/components/style/values/specified/image.rs
@@ -686,14 +686,14 @@ impl LineDirection {
input.try(|i| {
let to_ident = i.try(|i| i.expect_ident_matching("to"));
match *compat_mode {
- /// `to` keyword is mandatory in modern syntax.
+ // `to` keyword is mandatory in modern syntax.
CompatMode::Modern => to_ident?,
// Fall back to Modern compatibility mode in case there is a `to` keyword.
// According to Gecko, `-moz-linear-gradient(to ...)` should serialize like
// `linear-gradient(to ...)`.
CompatMode::Moz if to_ident.is_ok() => *compat_mode = CompatMode::Modern,
- /// There is no `to` keyword in webkit prefixed syntax. If it's consumed,
- /// parsing should throw an error.
+ // There is no `to` keyword in webkit prefixed syntax. If it's consumed,
+ // parsing should throw an error.
CompatMode::WebKit if to_ident.is_ok() => {
return Err(SelectorParseError::UnexpectedIdent("to".into()).into())
},
diff --git servo/components/style/properties/gecko.mako.rs servo/components/style/properties/gecko.mako.rs
index 37ed00ccf443..687c6f17d432 100644
--- servo/components/style/properties/gecko.mako.rs
+++ servo/components/style/properties/gecko.mako.rs
@@ -2081,7 +2081,7 @@ fn static_assert() {
return (parent_size, parent_unconstrained_size)
}
- /// XXXManishearth this should also handle text zoom
+ // XXXManishearth this should also handle text zoom
let min = Au(parent.gecko.mScriptMinSize);
let scale = (parent.gecko.mScriptSizeMultiplier as f32).powi(delta as i32);

View file

@ -1,110 +0,0 @@
commit 9f5c1f2e4b5b
Author: Manish Goregaokar <manishsmail@gmail.com>
Date: Thu Aug 3 16:27:12 2017 -0500
servo: Merge #17969 - Update stylo code to work on nightly (from Manishearth:rustup); r=emilio
r=emilio https://bugzilla.mozilla.org/show_bug.cgi?id=1386887
Source-Repo: https://github.com/servo/servo
Source-Revision: 7cee7d7fcc4194e410fa8a308a77d37ac452778a
--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : d9c874ebcfa1e64c86265d0ed2e5cff65d9133be
---
servo/components/style/gecko/generated/bindings.rs | 12 +++++++++---
servo/components/style/gecko/wrapper.rs | 7 ++++++-
servo/ports/geckolib/glue.rs | 3 ++-
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git servo/components/style/gecko/generated/bindings.rs servo/components/style/gecko/generated/bindings.rs
index e46bdfe1e1ea..b6703ab95bf7 100644
--- servo/components/style/gecko/generated/bindings.rs
+++ servo/components/style/gecko/generated/bindings.rs
@@ -8,6 +8,7 @@ type nsAString_internal = nsAString;
pub type ServoStyleContextBorrowed<'a> = &'a ::properties::ComputedValues;
pub type ServoStyleContextBorrowedOrNull<'a> = Option<&'a ::properties::ComputedValues>;
pub type ServoComputedDataBorrowed<'a> = &'a ServoComputedData;
+pub type RawServoAnimationValueTableBorrowed<'a> = &'a ();
use gecko_bindings::structs::mozilla::css::GridTemplateAreasValue;
use gecko_bindings::structs::mozilla::css::ErrorReporter;
use gecko_bindings::structs::mozilla::css::ImageValue;
@@ -37,7 +38,7 @@ use gecko_bindings::structs::RawServoStyleRule;
use gecko_bindings::structs::RawGeckoPresContext;
use gecko_bindings::structs::RawGeckoPresContextOwned;
use gecko_bindings::structs::RawGeckoStyleAnimationList;
-use gecko_bindings::structs::RawGeckoStyleChildrenIteratorBorrowedMut;
+use gecko_bindings::structs::RawGeckoStyleChildrenIterator;
use gecko_bindings::structs::RawGeckoServoStyleRuleList;
use gecko_bindings::structs::RawGeckoURLExtraData;
use gecko_bindings::structs::RawGeckoXBLBinding;
@@ -320,6 +321,10 @@ pub type RawGeckoServoAnimationValueListBorrowed<'a> = &'a RawGeckoServoAnimatio
pub type RawGeckoServoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoServoAnimationValueList>;
pub type RawGeckoServoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoServoAnimationValueList;
pub type RawGeckoServoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoServoAnimationValueList>;
+pub type RawGeckoStyleChildrenIteratorBorrowed<'a> = &'a RawGeckoStyleChildrenIterator;
+pub type RawGeckoStyleChildrenIteratorBorrowedOrNull<'a> = Option<&'a RawGeckoStyleChildrenIterator>;
+pub type RawGeckoStyleChildrenIteratorBorrowedMut<'a> = &'a mut RawGeckoStyleChildrenIterator;
+pub type RawGeckoStyleChildrenIteratorBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoStyleChildrenIterator>;
pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoCssRules>;
pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules;
pub type ServoCssRulesBorrowedOrNull<'a> = Option<&'a ServoCssRules>;
@@ -840,7 +845,7 @@ extern "C" {
}
extern "C" {
pub fn Gecko_AnimationGetBaseStyle(aBaseStyles:
- *mut ::std::os::raw::c_void,
+ RawServoAnimationValueTableBorrowed,
aProperty: nsCSSPropertyID)
-> RawServoAnimationValueBorrowedOrNull;
}
@@ -2602,7 +2607,8 @@ extern "C" {
extern "C" {
pub fn Servo_AnimationCompose(animation_values:
RawServoAnimationValueMapBorrowedMut,
- base_values: *mut ::std::os::raw::c_void,
+ base_values:
+ RawServoAnimationValueTableBorrowed,
property: nsCSSPropertyID,
animation_segment:
RawGeckoAnimationPropertySegmentBorrowed,
diff --git servo/components/style/gecko/wrapper.rs servo/components/style/gecko/wrapper.rs
index dae898692313..6d62f54951cc 100644
--- servo/components/style/gecko/wrapper.rs
+++ servo/components/style/gecko/wrapper.rs
@@ -387,7 +387,12 @@ impl<'a> Iterator for GeckoChildrenIterator<'a> {
curr
},
GeckoChildrenIterator::GeckoIterator(ref mut it) => unsafe {
- Gecko_GetNextStyleChild(it).map(GeckoNode)
+ // We do this unsafe lengthening of the lifetime here because
+ // structs::StyleChildrenIterator is actually StyleChildrenIterator<'a>,
+ // however we can't express this easily with bindgen, and it would
+ // introduce functions with two input lifetimes into bindgen,
+ // which would be out of scope for elision.
+ Gecko_GetNextStyleChild(&mut * (it as *mut _)).map(GeckoNode)
}
}
}
diff --git servo/ports/geckolib/glue.rs servo/ports/geckolib/glue.rs
index 367d24ff87b2..e69959f3710b 100644
--- servo/ports/geckolib/glue.rs
+++ servo/ports/geckolib/glue.rs
@@ -59,6 +59,7 @@ use style::gecko_bindings::bindings::RawGeckoServoStyleRuleListBorrowedMut;
use style::gecko_bindings::bindings::RawServoAnimationValueBorrowed;
use style::gecko_bindings::bindings::RawServoAnimationValueMapBorrowedMut;
use style::gecko_bindings::bindings::RawServoAnimationValueStrong;
+use style::gecko_bindings::bindings::RawServoAnimationValueTableBorrowed;
use style::gecko_bindings::bindings::RawServoStyleRuleBorrowed;
use style::gecko_bindings::bindings::ServoStyleContextBorrowedOrNull;
use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t;
@@ -374,7 +375,7 @@ pub extern "C" fn Servo_AnimationValues_ComputeDistance(from: RawServoAnimationV
#[no_mangle]
pub extern "C" fn Servo_AnimationCompose(raw_value_map: RawServoAnimationValueMapBorrowedMut,
- base_values: *mut ::std::os::raw::c_void,
+ base_values: RawServoAnimationValueTableBorrowed,
css_property: nsCSSPropertyID,
segment: RawGeckoAnimationPropertySegmentBorrowed,
last_segment: RawGeckoAnimationPropertySegmentBorrowed,

View file

@ -1,763 +0,0 @@
commit ea9c8db790e4
Author: Simon Sapin <simon.sapin@exyr.org>
Date: Tue Aug 15 07:31:04 2017 -0500
servo: Merge #18046 - Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10) (from servo:rustup); r=emilio
Source-Repo: https://github.com/servo/servo
Source-Revision: 7d9b82b9efa7b10a2e34d93df5ac535d99518f7a
--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : e1b3d113c3edaea3c4c07f8b206f2e02922e3caf
---
servo/Cargo.lock | 6 +++---
servo/components/devtools/lib.rs | 2 +-
servo/components/layout/animation.rs | 2 +-
servo/components/layout/construct.rs | 6 +++---
servo/components/layout/display_list_builder.rs | 2 +-
servo/components/layout/flex.rs | 6 +++---
servo/components/layout/inline.rs | 4 ++--
servo/components/layout/sequential.rs | 2 +-
servo/components/layout/table_cell.rs | 2 +-
servo/components/layout/text.rs | 2 +-
servo/components/net/cookie_storage.rs | 2 +-
servo/components/profile/heartbeats.rs | 4 ++--
servo/components/script/dom/bindings/js.rs | 4 ++--
servo/components/script/dom/cssstyledeclaration.rs | 8 ++++----
servo/components/script/dom/cssstylerule.rs | 2 +-
servo/components/script/dom/document.rs | 12 ++++++------
servo/components/script/dom/medialist.rs | 4 ++--
servo/components/script/dom/range.rs | 4 ++--
.../script/dom/servoparser/async_html.rs | 4 ++--
servo/components/script/dom/url.rs | 4 ++--
servo/components/script/dom/vrdisplay.rs | 2 +-
.../components/script/dom/webglrenderingcontext.rs | 2 +-
servo/components/script/dom/xmlhttprequest.rs | 2 +-
servo/components/script/lib.rs | 1 -
.../script_plugins/unrooted_must_root.rs | 22 +++++++++++++++-------
servo/components/selectors/matching.rs | 2 +-
servo/components/selectors/parser.rs | 2 +-
.../style/invalidation/element/invalidator.rs | 2 +-
servo/components/style/matching.rs | 2 +-
.../components/style/properties/properties.mako.rs | 2 +-
servo/components/style/style_adjuster.rs | 2 +-
servo/components/style/style_resolver.rs | 2 +-
servo/components/style/stylesheets/rule_list.rs | 2 +-
servo/components/style/stylesheets/rule_parser.rs | 2 +-
.../components/style/stylesheets/rules_iterator.rs | 2 +-
servo/components/style/values/animated/color.rs | 2 +-
servo/components/style/values/computed/border.rs | 2 +-
servo/components/webdriver_server/lib.rs | 2 +-
servo/rust-commit-hash | 2 +-
servo/tests/unit/style/stylist.rs | 13 -------------
40 files changed, 73 insertions(+), 79 deletions(-)
diff --git servo/Cargo.lock servo/Cargo.lock
index 50dd6e1a785a..2aa7bd8ea3dd 100644
--- servo/Cargo.lock
+++ servo/Cargo.lock
@@ -3577,7 +3577,7 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "xcb 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "xcb 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -3592,7 +3592,7 @@ dependencies = [
[[package]]
name = "xcb"
-version = "0.7.6"
+version = "0.7.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3918,7 +3918,7 @@ dependencies = [
"checksum x11 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db27c597c187da52194a4b8232e7d869503911aab9ff726fefb76d7a830f78ed"
"checksum x11-clipboard 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "731230b8edcbb9d99247105e4c9ec0a538594d50ad68d2afa8662195f9db2973"
"checksum x11-dl 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "326c500cdc166fd7c70dd8c8a829cd5c0ce7be5a5d98c25817de2b9bdc67faf8"
-"checksum xcb 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "63e3a849b73e4e1905e4f4d48f1750429bc86ea9f473632ab382a6f69ecb6b33"
+"checksum xcb 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "7cede38417fcdf2f0a9d8abf1cea1c1b066320a8a316e9583a0d717c334fafb2"
"checksum xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a66b7c2281ebde13cf4391d70d4c7e5946c3c25e72a7b859ca8f677dcd0b0c61"
"checksum xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12ea8eda4b1eb72f02d148402e23832d56a33f55d8c1b2d5bcdde91d79d47cb1"
"checksum xml-rs 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7ec6c39eaa68382c8e31e35239402c0a9489d4141a8ceb0c716099a0b515b562"
diff --git servo/components/devtools/lib.rs servo/components/devtools/lib.rs
index d5a2764a7102..6a25696eaed7 100644
--- servo/components/devtools/lib.rs
+++ servo/components/devtools/lib.rs
@@ -306,7 +306,7 @@ fn run_server(sender: Sender<DevtoolsControlMsg>,
columnNumber: console_message.columnNumber,
},
};
- for mut stream in &mut *console_actor.streams.borrow_mut() {
+ for stream in &mut *console_actor.streams.borrow_mut() {
stream.write_json_packet(&msg);
}
}
diff --git servo/components/layout/animation.rs servo/components/layout/animation.rs
index e4a2782c1271..ebbba82fcc6a 100644
--- servo/components/layout/animation.rs
+++ servo/components/layout/animation.rs
@@ -39,7 +39,7 @@ pub fn update_animation_state(constellation_chan: &IpcSender<ConstellationMsg>,
// run.
if let Some(ref mut animations) = running_animations.get_mut(node) {
// TODO: This being linear is probably not optimal.
- for mut anim in animations.iter_mut() {
+ for anim in animations.iter_mut() {
if let Animation::Keyframes(_, ref anim_name, ref mut anim_state) = *anim {
if *name == *anim_name {
debug!("update_animation_state: Found other animation {}", name);
diff --git servo/components/layout/construct.rs servo/components/layout/construct.rs
index c863219941e4..7ef391b42183 100644
--- servo/components/layout/construct.rs
+++ servo/components/layout/construct.rs
@@ -1921,7 +1921,7 @@ impl Legalizer {
/// true for anonymous block children of flex flows.
fn try_to_add_child(&mut self, context: &SharedStyleContext, parent: &mut FlowRef, child: &mut FlowRef)
-> bool {
- let mut parent = self.stack.last_mut().unwrap_or(parent);
+ let parent = self.stack.last_mut().unwrap_or(parent);
let (parent_class, child_class) = (parent.class(), child.class());
match (parent_class, child_class) {
(FlowClass::TableWrapper, FlowClass::Table) |
@@ -1962,7 +1962,7 @@ impl Legalizer {
} else {
IS_BLOCK_FLEX_ITEM
};
- let mut block = FlowRef::deref_mut(&mut block_wrapper).as_mut_block();
+ let block = FlowRef::deref_mut(&mut block_wrapper).as_mut_block();
block.base.flags.insert(MARGINS_CANNOT_COLLAPSE);
block.fragment.flags.insert(flag);
}
@@ -1979,7 +1979,7 @@ impl Legalizer {
} else {
IS_BLOCK_FLEX_ITEM
};
- let mut block = FlowRef::deref_mut(child).as_mut_block();
+ let block = FlowRef::deref_mut(child).as_mut_block();
block.base.flags.insert(MARGINS_CANNOT_COLLAPSE);
block.fragment.flags.insert(flag);
}
diff --git servo/components/layout/display_list_builder.rs servo/components/layout/display_list_builder.rs
index f8b26899b57d..783574afd2a3 100644
--- servo/components/layout/display_list_builder.rs
+++ servo/components/layout/display_list_builder.rs
@@ -2718,7 +2718,7 @@ impl InlineFlowDisplayListBuilding for InlineFlow {
self.base.scroll_root_id = Some(state.current_scroll_root_id);
self.base.clip = state.clip_stack.last().cloned().unwrap_or_else(max_rect);
- for mut fragment in self.fragments.fragments.iter_mut() {
+ for fragment in self.fragments.fragments.iter_mut() {
let previous_containing_block_scroll_root_id = state.containing_block_scroll_root_id;
if establishes_containing_block_for_absolute(fragment.style.get_box().position) {
state.containing_block_scroll_root_id = state.current_scroll_root_id;
diff --git servo/components/layout/flex.rs servo/components/layout/flex.rs
index 353c939f58b9..d79580f8cd0d 100644
--- servo/components/layout/flex.rs
+++ servo/components/layout/flex.rs
@@ -415,7 +415,7 @@ impl FlexFlow {
let items = &mut self.items[start..];
let mut children = self.block_flow.base.children.random_access_mut();
- for mut item in items {
+ for item in items {
let kid = children.get(item.index);
item.init_sizes(kid, container_size, self.main_mode);
let outer_main_size = item.outer_main_size(kid, self.main_mode);
@@ -607,7 +607,7 @@ impl FlexFlow {
let mut children = self.block_flow.base.children.random_access_mut();
for item in items.iter_mut() {
- let mut block = children.get(item.index).as_mut_block();
+ let block = children.get(item.index).as_mut_block();
block.base.block_container_writing_mode = container_mode;
block.base.block_container_inline_size = inline_size;
@@ -659,7 +659,7 @@ impl FlexFlow {
let mut children = self.block_flow.base.children.random_access_mut();
for item in &mut self.items {
- let mut base = flow::mut_base(children.get(item.index));
+ let base = flow::mut_base(children.get(item.index));
if !self.main_reverse {
base.position.start.b = cur_b;
cur_b = cur_b + base.position.size.block;
diff --git servo/components/layout/inline.rs servo/components/layout/inline.rs
index d5813d9bea22..10e091c3c66d 100644
--- servo/components/layout/inline.rs
+++ servo/components/layout/inline.rs
@@ -435,7 +435,7 @@ impl LineBreaker {
return
}
let last_fragment_index = self.pending_line.range.end() - FragmentIndex(1);
- let mut fragment = &mut self.new_fragments[last_fragment_index.get() as usize];
+ let fragment = &mut self.new_fragments[last_fragment_index.get() as usize];
let old_fragment_inline_size = fragment.border_box.size.inline;
@@ -1047,7 +1047,7 @@ impl InlineFlow {
let space_per_expansion_opportunity = slack_inline_size / expansion_opportunities as i32;
for fragment_index in line.range.each_index() {
let fragment = fragments.get_mut(fragment_index.to_usize());
- let mut scanned_text_fragment_info = match fragment.specific {
+ let scanned_text_fragment_info = match fragment.specific {
SpecificFragmentInfo::ScannedText(ref mut info) if !info.range.is_empty() => info,
_ => continue
};
diff --git servo/components/layout/sequential.rs servo/components/layout/sequential.rs
index f6f8ce429e4f..4986ebb6c852 100644
--- servo/components/layout/sequential.rs
+++ servo/components/layout/sequential.rs
@@ -133,7 +133,7 @@ pub fn store_overflow(layout_context: &LayoutContext, flow: &mut Flow) {
return;
}
- for mut kid in flow::mut_base(flow).child_iter_mut() {
+ for kid in flow::mut_base(flow).child_iter_mut() {
store_overflow(layout_context, kid);
}
diff --git servo/components/layout/table_cell.rs servo/components/layout/table_cell.rs
index 7ef02e28db65..fd807989b463 100644
--- servo/components/layout/table_cell.rs
+++ servo/components/layout/table_cell.rs
@@ -136,7 +136,7 @@ impl TableCellFlow {
}
for kid in flow::mut_base(self).children.iter_mut() {
- let mut kid_base = flow::mut_base(kid);
+ let kid_base = flow::mut_base(kid);
if !kid_base.flags.contains(IS_ABSOLUTELY_POSITIONED) {
kid_base.position.start.b += offset
}
diff --git servo/components/layout/text.rs servo/components/layout/text.rs
index 6e1c7b2a43a1..9a207a2bb84e 100644
--- servo/components/layout/text.rs
+++ servo/components/layout/text.rs
@@ -460,7 +460,7 @@ fn split_first_fragment_at_newline_if_necessary(fragments: &mut LinkedList<Fragm
}
let new_fragment = {
- let mut first_fragment = fragments.front_mut().unwrap();
+ let first_fragment = fragments.front_mut().unwrap();
let string_before;
let selection_before;
{
diff --git servo/components/net/cookie_storage.rs servo/components/net/cookie_storage.rs
index f255f57b56d2..b3147ef4dd32 100644
--- servo/components/net/cookie_storage.rs
+++ servo/components/net/cookie_storage.rs
@@ -103,7 +103,7 @@ impl CookieStorage {
// Step 12
let domain = reg_host(&cookie.cookie.domain().as_ref().unwrap_or(&""));
- let mut cookies = self.cookies_map.entry(domain).or_insert(vec![]);
+ let cookies = self.cookies_map.entry(domain).or_insert(vec![]);
if cookies.len() == self.max_per_host {
let old_len = cookies.len();
diff --git servo/components/profile/heartbeats.rs servo/components/profile/heartbeats.rs
index 4661dad61836..0d474fe3a111 100644
--- servo/components/profile/heartbeats.rs
+++ servo/components/profile/heartbeats.rs
@@ -33,7 +33,7 @@ pub fn cleanup() {
)
);
if let Some(mut hbs) = hbs_opt_box {
- for (_, mut v) in hbs.iter_mut() {
+ for (_, v) in hbs.iter_mut() {
// log any remaining heartbeat records before dropping
log_heartbeat_records(v);
}
@@ -65,7 +65,7 @@ pub fn maybe_heartbeat(category: &ProfilerCategory,
if !(*hbs_ptr).contains_key(category) {
maybe_create_heartbeat(&mut (*hbs_ptr), category.clone());
}
- if let Some(mut h) = (*hbs_ptr).get_mut(category) {
+ if let Some(h) = (*hbs_ptr).get_mut(category) {
(*h).heartbeat(0, 1, start_time, end_time, start_energy, end_energy);
}
}
diff --git servo/components/script/dom/bindings/js.rs servo/components/script/dom/bindings/js.rs
index 975ddeda13b0..abfd9f47eff1 100644
--- servo/components/script/dom/bindings/js.rs
+++ servo/components/script/dom/bindings/js.rs
@@ -469,7 +469,7 @@ impl RootCollection {
/// Start tracking a stack-based root
unsafe fn root(&self, untracked_reflector: *const Reflector) {
debug_assert!(thread_state::get().is_script());
- let mut roots = &mut *self.roots.get();
+ let roots = &mut *self.roots.get();
roots.push(untracked_reflector);
assert!(!(*untracked_reflector).get_jsobject().is_null())
}
@@ -479,7 +479,7 @@ impl RootCollection {
assert!(!tracked_reflector.is_null());
assert!(!(*tracked_reflector).get_jsobject().is_null());
debug_assert!(thread_state::get().is_script());
- let mut roots = &mut *self.roots.get();
+ let roots = &mut *self.roots.get();
match roots.iter().rposition(|r| *r == tracked_reflector) {
Some(idx) => {
roots.remove(idx);
diff --git servo/components/script/dom/cssstyledeclaration.rs servo/components/script/dom/cssstyledeclaration.rs
index 0732c9af9e45..ddf085b34913 100644
--- servo/components/script/dom/cssstyledeclaration.rs
+++ servo/components/script/dom/cssstyledeclaration.rs
@@ -238,7 +238,7 @@ impl CSSStyleDeclaration {
return Err(Error::NoModificationAllowed);
}
- self.owner.mutate_associated_block(|ref mut pdb, mut changed| {
+ self.owner.mutate_associated_block(|pdb, changed| {
if value.is_empty() {
// Step 3
*changed = pdb.remove_property(&id);
@@ -360,7 +360,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
_ => return Ok(()),
};
- self.owner.mutate_associated_block(|ref mut pdb, mut changed| {
+ self.owner.mutate_associated_block(|pdb, changed| {
// Step 5 & 6
*changed = pdb.set_importance(&id, importance);
});
@@ -388,7 +388,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
};
let mut string = String::new();
- self.owner.mutate_associated_block(|mut pdb, mut changed| {
+ self.owner.mutate_associated_block(|pdb, changed| {
pdb.property_value_to_css(&id, &mut string).unwrap();
*changed = pdb.remove_property(&id);
});
@@ -438,7 +438,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
}
let quirks_mode = window.Document().quirks_mode();
- self.owner.mutate_associated_block(|mut pdb, mut _changed| {
+ self.owner.mutate_associated_block(|pdb, _changed| {
// Step 3
*pdb = parse_style_attribute(&value,
&self.owner.base_url(),
diff --git servo/components/script/dom/cssstylerule.rs servo/components/script/dom/cssstylerule.rs
index ea121ef900a9..12e9cdcc8694 100644
--- servo/components/script/dom/cssstylerule.rs
+++ servo/components/script/dom/cssstylerule.rs
@@ -99,7 +99,7 @@ impl CSSStyleRuleMethods for CSSStyleRule {
if let Ok(mut s) = SelectorList::parse(&parser, &mut css_parser) {
// This mirrors what we do in CSSStyleOwner::mutate_associated_block.
let mut guard = self.cssrule.shared_lock().write();
- let mut stylerule = self.stylerule.write_with(&mut guard);
+ let stylerule = self.stylerule.write_with(&mut guard);
mem::swap(&mut stylerule.selectors, &mut s);
// It seems like we will want to avoid having to invalidate all
// stylesheets eventually!
diff --git servo/components/script/dom/document.rs servo/components/script/dom/document.rs
index 90ea06fbe7b4..71bb02eaa364 100644
--- servo/components/script/dom/document.rs
+++ servo/components/script/dom/document.rs
@@ -633,7 +633,7 @@ impl Document {
// reset_form_owner_for_listeners -> reset_form_owner -> GetElementById
{
let mut id_map = self.id_map.borrow_mut();
- let mut elements = id_map.entry(id.clone()).or_insert(Vec::new());
+ let elements = id_map.entry(id.clone()).or_insert(Vec::new());
elements.insert_pre_order(element, root.r().upcast::<Node>());
}
self.reset_form_owner_for_listeners(&id);
@@ -642,7 +642,7 @@ impl Document {
pub fn register_form_id_listener<T: ?Sized + FormControl>(&self, id: DOMString, listener: &T) {
let mut map = self.form_id_listener_map.borrow_mut();
let listener = listener.to_element();
- let mut set = map.entry(Atom::from(id)).or_insert(HashSet::new());
+ let set = map.entry(Atom::from(id)).or_insert(HashSet::new());
set.insert(JS::from_ref(listener));
}
@@ -1572,7 +1572,7 @@ impl Document {
/// https://html.spec.whatwg.org/multipage/#dom-window-cancelanimationframe
pub fn cancel_animation_frame(&self, ident: u32) {
let mut list = self.animation_frame_list.borrow_mut();
- if let Some(mut pair) = list.iter_mut().find(|pair| pair.0 == ident) {
+ if let Some(pair) = list.iter_mut().find(|pair| pair.0 == ident) {
pair.1 = None;
}
}
@@ -2399,7 +2399,7 @@ impl Document {
if entry.snapshot.is_none() {
entry.snapshot = Some(Snapshot::new(el.html_element_in_html_document()));
}
- let mut snapshot = entry.snapshot.as_mut().unwrap();
+ let snapshot = entry.snapshot.as_mut().unwrap();
if snapshot.state.is_none() {
snapshot.state = Some(el.state());
}
@@ -2426,7 +2426,7 @@ impl Document {
entry.hint.insert(RESTYLE_SELF);
}
- let mut snapshot = entry.snapshot.as_mut().unwrap();
+ let snapshot = entry.snapshot.as_mut().unwrap();
if attr.local_name() == &local_name!("id") {
snapshot.id_changed = true;
} else if attr.local_name() == &local_name!("class") {
@@ -4028,7 +4028,7 @@ impl PendingInOrderScriptVec {
fn loaded(&self, element: &HTMLScriptElement, result: ScriptResult) {
let mut scripts = self.scripts.borrow_mut();
- let mut entry = scripts.iter_mut().find(|entry| &*entry.element == element).unwrap();
+ let entry = scripts.iter_mut().find(|entry| &*entry.element == element).unwrap();
entry.loaded(result);
}
diff --git servo/components/script/dom/medialist.rs servo/components/script/dom/medialist.rs
index 0064d0445095..ae20f5aa0422 100644
--- servo/components/script/dom/medialist.rs
+++ servo/components/script/dom/medialist.rs
@@ -63,7 +63,7 @@ impl MediaListMethods for MediaList {
// https://drafts.csswg.org/cssom/#dom-medialist-mediatext
fn SetMediaText(&self, value: DOMString) {
let mut guard = self.shared_lock().write();
- let mut media_queries = self.media_queries.write_with(&mut guard);
+ let media_queries = self.media_queries.write_with(&mut guard);
// Step 2
if value.is_empty() {
// Step 1
@@ -154,7 +154,7 @@ impl MediaListMethods for MediaList {
// Step 3
let m_serialized = m.unwrap().to_css_string();
let mut guard = self.shared_lock().write();
- let mut media_list = self.media_queries.write_with(&mut guard);
+ let media_list = self.media_queries.write_with(&mut guard);
let new_vec = media_list.media_queries.drain(..)
.filter(|q| m_serialized != q.to_css_string())
.collect();
diff --git servo/components/script/dom/range.rs servo/components/script/dom/range.rs
index fa849a0fc1a2..1e65caedc9dd 100644
--- servo/components/script/dom/range.rs
+++ servo/components/script/dom/range.rs
@@ -1049,7 +1049,7 @@ impl WeakRangeVec {
let offset = context.index();
let parent = context.parent;
unsafe {
- let mut ranges = &mut *self.cell.get();
+ let ranges = &mut *self.cell.get();
ranges.update(|entry| {
let range = entry.root().unwrap();
@@ -1076,7 +1076,7 @@ impl WeakRangeVec {
}
unsafe {
- let mut ranges = &mut *self.cell.get();
+ let ranges = &mut *self.cell.get();
ranges.update(|entry| {
let range = entry.root().unwrap();
diff --git servo/components/script/dom/servoparser/async_html.rs servo/components/script/dom/servoparser/async_html.rs
index 59411fda1c73..70d2008f49f6 100644
--- servo/components/script/dom/servoparser/async_html.rs
+++ servo/components/script/dom/servoparser/async_html.rs
@@ -568,7 +568,7 @@ impl TreeSink for Sink {
}
let node = self.new_parse_node();
{
- let mut data = self.get_parse_node_data_mut(&target.id);
+ let data = self.get_parse_node_data_mut(&target.id);
data.contents = Some(node.clone());
}
self.send_op(ParseOperation::GetTemplateContents { target: target.id, contents: node.id });
@@ -596,7 +596,7 @@ impl TreeSink for Sink {
let mut node = self.new_parse_node();
node.qual_name = Some(name.clone());
{
- let mut node_data = self.get_parse_node_data_mut(&node.id);
+ let node_data = self.get_parse_node_data_mut(&node.id);
node_data.is_integration_point = html_attrs.iter()
.any(|attr| {
let attr_value = &String::from(attr.value.clone());
diff --git servo/components/script/dom/url.rs servo/components/script/dom/url.rs
index a02a735638fc..41de4dcc0c72 100644
--- servo/components/script/dom/url.rs
+++ servo/components/script/dom/url.rs
@@ -96,8 +96,8 @@ impl URL {
// https://w3c.github.io/FileAPI/#dfn-createObjectURL
pub fn CreateObjectURL(global: &GlobalScope, blob: &Blob) -> DOMString {
- /// XXX: Second field is an unicode-serialized Origin, it is a temporary workaround
- /// and should not be trusted. See issue https://github.com/servo/servo/issues/11722
+ // XXX: Second field is an unicode-serialized Origin, it is a temporary workaround
+ // and should not be trusted. See issue https://github.com/servo/servo/issues/11722
let origin = get_blob_origin(&global.get_url());
let id = blob.get_blob_url_id();
diff --git servo/components/script/dom/vrdisplay.rs servo/components/script/dom/vrdisplay.rs
index 3f73a577fad7..54f06fb928f2 100644
--- servo/components/script/dom/vrdisplay.rs
+++ servo/components/script/dom/vrdisplay.rs
@@ -268,7 +268,7 @@ impl VRDisplayMethods for VRDisplay {
fn CancelAnimationFrame(&self, handle: u32) {
if self.presenting.get() {
let mut list = self.raf_callback_list.borrow_mut();
- if let Some(mut pair) = list.iter_mut().find(|pair| pair.0 == handle) {
+ if let Some(pair) = list.iter_mut().find(|pair| pair.0 == handle) {
pair.1 = None;
}
} else {
diff --git servo/components/script/dom/webglrenderingcontext.rs servo/components/script/dom/webglrenderingcontext.rs
index 73d4ddba1b90..62c92b42785c 100644
--- servo/components/script/dom/webglrenderingcontext.rs
+++ servo/components/script/dom/webglrenderingcontext.rs
@@ -2434,7 +2434,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
typedarray!(in(cx) let mut pixels_data: ArrayBufferView = pixels);
- let (array_type, mut data) = match { pixels_data.as_mut() } {
+ let (array_type, data) = match { pixels_data.as_mut() } {
Ok(data) => (data.get_array_type(), data.as_mut_slice()),
Err(_) => return Err(Error::Type("Not an ArrayBufferView".to_owned())),
};
diff --git servo/components/script/dom/xmlhttprequest.rs servo/components/script/dom/xmlhttprequest.rs
index 6ed2dda1851f..e6652d79d706 100644
--- servo/components/script/dom/xmlhttprequest.rs
+++ servo/components/script/dom/xmlhttprequest.rs
@@ -627,7 +627,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
if !content_type_set {
let ct = request.headers.get_mut::<ContentType>();
- if let Some(mut ct) = ct {
+ if let Some(ct) = ct {
if let Some(encoding) = encoding {
for param in &mut (ct.0).2 {
if param.0 == MimeAttr::Charset {
diff --git servo/components/script/lib.rs servo/components/script/lib.rs
index e1a1ab592cb7..5824d6f2e490 100644
--- servo/components/script/lib.rs
+++ servo/components/script/lib.rs
@@ -9,7 +9,6 @@
#![feature(mpsc_select)]
#![feature(nonzero)]
#![feature(on_unimplemented)]
-#![feature(option_entry)]
#![feature(plugin)]
#![feature(proc_macro)]
#![feature(stmt_expr_attributes)]
diff --git servo/components/script_plugins/unrooted_must_root.rs servo/components/script_plugins/unrooted_must_root.rs
index 5dbd2b1a3bdd..f3f5e60ab62a 100644
--- servo/components/script_plugins/unrooted_must_root.rs
+++ servo/components/script_plugins/unrooted_must_root.rs
@@ -182,7 +182,7 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> {
}
match expr.node {
- /// Trait casts from #[must_root] types are not allowed
+ // Trait casts from #[must_root] types are not allowed
hir::ExprCast(ref subexpr, _) => require_rooted(cx, self.in_new_function, &*subexpr),
// This catches assignments... the main point of this would be to catch mutable
// references to `JS<T>`.
@@ -206,13 +206,21 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> {
fn visit_pat(&mut self, pat: &'tcx hir::Pat) {
let cx = self.cx;
- if let hir::PatKind::Binding(hir::BindingMode::BindByValue(_), _, _, _) = pat.node {
- let ty = cx.tables.pat_ty(pat);
- if is_unrooted_ty(cx, ty, self.in_new_function) {
- cx.span_lint(UNROOTED_MUST_ROOT,
- pat.span,
- &format!("Expression of type {:?} must be rooted", ty))
+ // We want to detect pattern bindings that move a value onto the stack.
+ // When "default binding modes" https://github.com/rust-lang/rust/issues/42640
+ // are implemented, the `Unannotated` case could cause false-positives.
+ // These should be fixable by adding an explicit `ref`.
+ match pat.node {
+ hir::PatKind::Binding(hir::BindingAnnotation::Unannotated, _, _, _) |
+ hir::PatKind::Binding(hir::BindingAnnotation::Mutable, _, _, _) => {
+ let ty = cx.tables.pat_ty(pat);
+ if is_unrooted_ty(cx, ty, self.in_new_function) {
+ cx.span_lint(UNROOTED_MUST_ROOT,
+ pat.span,
+ &format!("Expression of type {:?} must be rooted", ty))
+ }
}
+ _ => {}
}
visit::walk_pat(self, pat);
diff --git servo/components/selectors/matching.rs servo/components/selectors/matching.rs
index 7bd9814d26fb..8f6b2fa6aa54 100644
--- servo/components/selectors/matching.rs
+++ servo/components/selectors/matching.rs
@@ -458,7 +458,7 @@ where
/// Matches a complex selector.
pub fn matches_complex_selector<E, F>(mut iter: SelectorIter<E::Impl>,
element: &E,
- mut context: &mut LocalMatchingContext<E::Impl>,
+ context: &mut LocalMatchingContext<E::Impl>,
flags_setter: &mut F)
-> bool
where E: Element,
diff --git servo/components/selectors/parser.rs servo/components/selectors/parser.rs
index 490399ce38ce..6b2c1f2b4e86 100644
--- servo/components/selectors/parser.rs
+++ servo/components/selectors/parser.rs
@@ -1464,7 +1464,7 @@ fn parse_negation<'i, 't, P, E, Impl>(parser: &P,
fn parse_compound_selector<'i, 't, P, E, Impl>(
parser: &P,
input: &mut CssParser<'i, 't>,
- mut builder: &mut SelectorBuilder<Impl>)
+ builder: &mut SelectorBuilder<Impl>)
-> Result<bool, ParseError<'i, SelectorParseError<'i, E>>>
where P: Parser<'i, Impl=Impl, Error=E>, Impl: SelectorImpl
{
diff --git servo/components/style/invalidation/element/invalidator.rs servo/components/style/invalidation/element/invalidator.rs
index 848c5cd13dc8..b8510ba3169b 100644
--- servo/components/style/invalidation/element/invalidator.rs
+++ servo/components/style/invalidation/element/invalidator.rs
@@ -154,7 +154,7 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E>
trace!(" > visitedness change, force subtree restyle");
// We can't just return here because there may also be attribute
// changes as well that imply additional hints.
- let mut data = self.data.as_mut().unwrap();
+ let data = self.data.as_mut().unwrap();
data.restyle.hint.insert(RestyleHint::restyle_subtree());
}
diff --git servo/components/style/matching.rs servo/components/style/matching.rs
index b62bc54bf768..f58d7cd123e6 100644
--- servo/components/style/matching.rs
+++ servo/components/style/matching.rs
@@ -440,7 +440,7 @@ pub trait MatchMethods : TElement {
fn finish_restyle(
&self,
context: &mut StyleContext<Self>,
- mut data: &mut ElementData,
+ data: &mut ElementData,
mut new_styles: ElementStyles,
important_rules_changed: bool,
) -> ChildCascadeRequirement {
diff --git servo/components/style/properties/properties.mako.rs servo/components/style/properties/properties.mako.rs
index d98e173db5ba..81ff00fb6d5e 100644
--- servo/components/style/properties/properties.mako.rs
+++ servo/components/style/properties/properties.mako.rs
@@ -3364,7 +3364,7 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc<ComputedValues>,
return;
}
}
- let mut style = Arc::make_mut(style);
+ let style = Arc::make_mut(style);
let border = Arc::make_mut(&mut style.border);
match side {
PhysicalSide::Left => {
diff --git servo/components/style/style_adjuster.rs servo/components/style/style_adjuster.rs
index 366641ebe0bc..6e51fa74072a 100644
--- servo/components/style/style_adjuster.rs
+++ servo/components/style/style_adjuster.rs
@@ -269,7 +269,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
if overflow_x != original_overflow_x ||
overflow_y != original_overflow_y {
- let mut box_style = self.style.mutate_box();
+ let box_style = self.style.mutate_box();
box_style.set_overflow_x(overflow_x);
box_style.set_overflow_y(overflow_y);
}
diff --git servo/components/style/style_resolver.rs servo/components/style/style_resolver.rs
index cf512c4fbdd2..3fc1d57cc8f7 100644
--- servo/components/style/style_resolver.rs
+++ servo/components/style/style_resolver.rs
@@ -247,7 +247,7 @@ where
Some(&*primary_style.style)
};
- for (i, mut inputs) in pseudo_array.iter_mut().enumerate() {
+ for (i, inputs) in pseudo_array.iter_mut().enumerate() {
if let Some(inputs) = inputs.take() {
let pseudo = PseudoElement::from_eager_index(i);
pseudo_styles.set(
diff --git servo/components/style/stylesheets/rule_list.rs servo/components/style/stylesheets/rule_list.rs
index 82e78015400d..14b3dc5e7696 100644
--- servo/components/style/stylesheets/rule_list.rs
+++ servo/components/style/stylesheets/rule_list.rs
@@ -150,7 +150,7 @@ impl CssRulesHelpers for RawOffsetArc<Locked<CssRules>> {
{
let mut write_guard = lock.write();
- let mut rules = self.write_with(&mut write_guard);
+ let rules = self.write_with(&mut write_guard);
// Step 5
// Computes the maximum allowed parser state at a given index.
let rev_state = rules.0.get(index).map_or(State::Body, CssRule::rule_state);
diff --git servo/components/style/stylesheets/rule_parser.rs servo/components/style/stylesheets/rule_parser.rs
index 007d7e11026e..f0d224e498a7 100644
--- servo/components/style/stylesheets/rule_parser.rs
+++ servo/components/style/stylesheets/rule_parser.rs
@@ -209,7 +209,7 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> {
let id = register_namespace(&url)
.map_err(|()| StyleParseError::UnspecifiedError)?;
- let mut namespaces = self.namespaces.as_mut().unwrap();
+ let namespaces = self.namespaces.as_mut().unwrap();
let opt_prefix = if let Ok(prefix) = prefix_result {
let prefix = Prefix::from(prefix.as_ref());
diff --git servo/components/style/stylesheets/rules_iterator.rs servo/components/style/stylesheets/rules_iterator.rs
index 95a3ab8b3885..65e1b637ae52 100644
--- servo/components/style/stylesheets/rules_iterator.rs
+++ servo/components/style/stylesheets/rules_iterator.rs
@@ -70,7 +70,7 @@ impl<'a, 'b, C> Iterator for RulesIterator<'a, 'b, C>
let rule;
let sub_iter = {
- let mut nested_iter = self.stack.last_mut().unwrap();
+ let nested_iter = self.stack.last_mut().unwrap();
rule = match nested_iter.next() {
Some(r) => r,
None => {
diff --git servo/components/webdriver_server/lib.rs servo/components/webdriver_server/lib.rs
index bd2f667f9892..28a4885f0d41 100644
--- servo/components/webdriver_server/lib.rs
+++ servo/components/webdriver_server/lib.rs
@@ -702,7 +702,7 @@ impl Handler {
fn handle_set_timeouts(&mut self,
parameters: &TimeoutsParameters)
-> WebDriverResult<WebDriverResponse> {
- let mut session = self.session
+ let session = self.session
.as_mut()
.ok_or(WebDriverError::new(ErrorStatus::SessionNotCreated, ""))?;
diff --git servo/rust-commit-hash servo/rust-commit-hash
index d4f08fe97644..a08d23cd1a71 100644
--- servo/rust-commit-hash
+++ servo/rust-commit-hash
@@ -1 +1 @@
-599be0d18f4c6ddf36366d2a5a2ca6dc65886896
+13d94d5fa8129a34f5c77a1bcd76983f5aed2434
diff --git servo/tests/unit/style/stylist.rs servo/tests/unit/style/stylist.rs
index da9a9478957a..52067b501788 100644
--- servo/tests/unit/style/stylist.rs
+++ servo/tests/unit/style/stylist.rs
@@ -51,19 +51,6 @@ fn get_mock_rules(css_selectors: &[&str]) -> (Vec<Vec<Rule>>, SharedRwLock) {
}).collect(), shared_lock)
}
-fn get_mock_map(selectors: &[&str]) -> (SelectorMap<Rule>, SharedRwLock) {
- let mut map = SelectorMap::<Rule>::new();
- let (selector_rules, shared_lock) = get_mock_rules(selectors);
-
- for rules in selector_rules.into_iter() {
- for rule in rules.into_iter() {
- map.insert(rule, QuirksMode::NoQuirks)
- }
- }
-
- (map, shared_lock)
-}
-
fn parse_selectors(selectors: &[&str]) -> Vec<Selector<SelectorImpl>> {
selectors.iter()
.map(|x| SelectorParser::parse_author_origin_no_namespace(x).unwrap().0

View file

@ -1,232 +0,0 @@
commit f0acf27d189d
Author: Simon Sapin <simon.sapin@exyr.org>
Date: Thu Aug 17 11:05:32 2017 -0500
servo: Merge #18126 - geckolib: Fix some warnings (treated as error) new in Rust Nigthly (from servo:glow-fox); r=emilio
Source-Repo: https://github.com/servo/servo
Source-Revision: cc86ca2bcdec5e89ee5279085ea38db63ef41af9
--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 0586dbc81f1411c89821605a6dae4ebd0af8f0d5
---
servo/components/style/gecko/conversions.rs | 2 +-
servo/components/style/gecko/wrapper.rs | 2 +-
.../style/gecko_bindings/sugar/ns_t_array.rs | 4 ++--
servo/components/style/properties/gecko.mako.rs | 18 +++++++++---------
servo/components/style/style_adjuster.rs | 4 ++--
servo/ports/geckolib/glue.rs | 12 ++++++------
6 files changed, 21 insertions(+), 21 deletions(-)
diff --git servo/components/style/gecko/conversions.rs servo/components/style/gecko/conversions.rs
index 8f3fb6bf2d0f..51015997c5c1 100644
--- servo/components/style/gecko/conversions.rs
+++ servo/components/style/gecko/conversions.rs
@@ -348,7 +348,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 servo/components/style/gecko/wrapper.rs servo/components/style/gecko/wrapper.rs
index 034dd94590e2..c402ddaf15bd 100644
--- servo/components/style/gecko/wrapper.rs
+++ servo/components/style/gecko/wrapper.rs
@@ -424,7 +424,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 servo/components/style/gecko_bindings/sugar/ns_t_array.rs servo/components/style/gecko_bindings/sugar/ns_t_array.rs
index 6bc389702f54..068e10ddea1b 100644
--- servo/components/style/gecko_bindings/sugar/ns_t_array.rs
+++ servo/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 servo/components/style/properties/gecko.mako.rs servo/components/style/properties/gecko.mako.rs
index 9a2ab2135fc5..bc41ef139af5 100644
--- servo/components/style/properties/gecko.mako.rs
+++ servo/components/style/properties/gecko.mako.rs
@@ -4136,14 +4136,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) => {
@@ -4665,14 +4665,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
@@ -4694,7 +4694,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]);
@@ -4702,7 +4702,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]);
@@ -4712,7 +4712,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);
}
@@ -4797,7 +4797,7 @@ clip-path
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)),
Either::Second(lop) => gecko.set(lop),
@@ -4885,7 +4885,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 servo/components/style/style_adjuster.rs servo/components/style/style_adjuster.rs
index 03b15916b237..366641ebe0bc 100644
--- servo/components/style/style_adjuster.rs
+++ servo/components/style/style_adjuster.rs
@@ -167,7 +167,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);
}
@@ -182,7 +182,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 servo/ports/geckolib/glue.rs servo/ports/geckolib/glue.rs
index 977728286fc3..fa09bee29553 100644
--- servo/ports/geckolib/glue.rs
+++ servo/ports/geckolib/glue.rs
@@ -815,7 +815,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();
data.stylesheets.append_stylesheet(
&data.stylist,
@@ -867,7 +867,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();
data.stylesheets.prepend_stylesheet(
&data.stylist,
@@ -885,7 +885,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();
data.stylesheets.insert_stylesheet_before(
&data.stylist,
@@ -903,7 +903,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();
data.stylesheets.remove_stylesheet(
&data.stylist,
@@ -1274,7 +1274,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;
@@ -2775,7 +2775,7 @@ pub extern "C" fn Servo_NoteExplicitHints(element: RawGeckoElementBorrowed,
pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed,
was_restyled: *mut bool) -> nsChangeHint
{
- 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() {

View file

@ -1,13 +1,13 @@
# Template build file for 'firefox'.
pkgname=firefox
version=56.0.2
version=57.0
revision=1
short_desc="Mozilla Firefox web browser"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="https://www.mozilla.org/firefox/"
license="MPL-2.0, GPL-2, LGPL-2.1"
distfiles="${MOZILLA_SITE}/${pkgname}/releases/${version}/source/${pkgname}-${version}.source.tar.xz"
checksum=6f7d284c31383a9860d7b52f05f866526d5a7c31e3ef2959d79122ba074f5ca1
checksum=603af00155be87f2c9c58047dd0072971f1cdab1f632695aae6ad072efefbb8f
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
nopie=yes