servo: Merge #18046 - Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10) (from servo:rustup); r=emilio
authorSimon Sapin <simon.sapin@exyr.org>
Tue, 15 Aug 2017 07:31:04 -0500
changeset 647032 06ffe35b662bf5d6981a44a13fecb84726aa2d9f
parent 647031 122fa30ec6605756d1221e91facd661e4b8069d7
child 647033 8c6d1061135491843c8dcfa0337d14e974d8e82d
push id74288
push userhikezoe@mozilla.com
push dateWed, 16 Aug 2017 00:19:57 +0000
reviewersemilio
milestone57.0a1
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
servo/Cargo.lock
servo/components/devtools/lib.rs
servo/components/layout/animation.rs
servo/components/layout/construct.rs
servo/components/layout/display_list_builder.rs
servo/components/layout/flex.rs
servo/components/layout/inline.rs
servo/components/layout/sequential.rs
servo/components/layout/table_cell.rs
servo/components/layout/text.rs
servo/components/net/cookie_storage.rs
servo/components/profile/heartbeats.rs
servo/components/script/dom/bindings/js.rs
servo/components/script/dom/cssstyledeclaration.rs
servo/components/script/dom/cssstylerule.rs
servo/components/script/dom/document.rs
servo/components/script/dom/medialist.rs
servo/components/script/dom/range.rs
servo/components/script/dom/servoparser/async_html.rs
servo/components/script/dom/url.rs
servo/components/script/dom/vrdisplay.rs
servo/components/script/dom/webglrenderingcontext.rs
servo/components/script/dom/xmlhttprequest.rs
servo/components/script/lib.rs
servo/components/script_plugins/unrooted_must_root.rs
servo/components/selectors/matching.rs
servo/components/selectors/parser.rs
servo/components/style/invalidation/element/invalidator.rs
servo/components/style/matching.rs
servo/components/style/properties/properties.mako.rs
servo/components/style/style_adjuster.rs
servo/components/style/style_resolver.rs
servo/components/style/stylesheets/rule_list.rs
servo/components/style/stylesheets/rule_parser.rs
servo/components/style/stylesheets/rules_iterator.rs
servo/components/style/values/animated/color.rs
servo/components/style/values/computed/border.rs
servo/components/webdriver_server/lib.rs
servo/rust-commit-hash
servo/tests/unit/style/stylist.rs
--- a/servo/Cargo.lock
+++ b/servo/Cargo.lock
@@ -3582,32 +3582,32 @@ dependencies = [
 ]
 
 [[package]]
 name = "x11-clipboard"
 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]]
 name = "x11-dl"
 version = "2.14.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[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)",
  "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "xdg"
@@ -3924,13 +3924,13 @@ dependencies = [
 "checksum webrender_api 0.48.0 (git+https://github.com/servo/webrender)" = "<none>"
 "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
 "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
 "checksum ws 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04614a58714f3fd4a8b1da4bcae9f031c532d35988c3d39627619248113f8be8"
 "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
 "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"
 "checksum xml5ever 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b55c0fe16ec63e5bb4c2e1a4f22ee982d0df940b90827689932a9b2c34782c23"
--- a/servo/components/devtools/lib.rs
+++ b/servo/components/devtools/lib.rs
@@ -301,17 +301,17 @@ fn run_server(sender: Sender<DevtoolsCon
                 }.to_owned(),
                 timeStamp: precise_time_ns(),
                 arguments: vec!(console_message.message),
                 filename: console_message.filename,
                 lineNumber: console_message.lineNumber,
                 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);
         }
     }
 
     fn find_console_actor(actors: Arc<Mutex<ActorRegistry>>,
                           id: PipelineId,
                           worker_id: Option<WorkerId>,
                           actor_workers: &HashMap<(PipelineId, WorkerId), String>,
--- a/servo/components/layout/animation.rs
+++ b/servo/components/layout/animation.rs
@@ -34,17 +34,17 @@ pub fn update_animation_state(constellat
     while let Ok(animation) = new_animations_receiver.try_recv() {
         let mut should_push = true;
         if let Animation::Keyframes(ref node, ref name, ref state) = animation {
             // If the animation was already present in the list for the
             // node, just update its state, else push the new animation to
             // 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);
                             anim_state.update_from_other(&state, timer);
                             should_push = false;
                             break;
                         }
                     }
--- a/servo/components/layout/construct.rs
+++ b/servo/components/layout/construct.rs
@@ -1916,17 +1916,17 @@ impl Legalizer {
     /// Attempts to make `child` a child of `parent`. On success, this returns true. If this would
     /// make the tree illegal, this method does nothing and returns false.
     ///
     /// This method attempts to create anonymous blocks in between `parent` and `child` if and only
     /// if those blocks will only ever have `child` as their sole child. At present, this is only
     /// 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) |
             (FlowClass::Table, FlowClass::TableColGroup) |
             (FlowClass::Table, FlowClass::TableRowGroup) |
             (FlowClass::Table, FlowClass::TableRow) |
             (FlowClass::Table, FlowClass::TableCaption) |
             (FlowClass::TableRowGroup, FlowClass::TableRow) |
@@ -1957,34 +1957,34 @@ impl Legalizer {
                                                      SpecificFragmentInfo::Generic,
                                                      BlockFlow::from_fragment);
                 {
                     let flag = if parent.as_flex().main_mode() == Direction::Inline {
                         IS_INLINE_FLEX_ITEM
                     } 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);
                 }
                 block_wrapper.add_new_child((*child).clone());
                 block_wrapper.finish();
                 parent.add_new_child(block_wrapper);
                 true
             }
 
             (FlowClass::Flex, _) => {
                 {
                     let flag = if parent.as_flex().main_mode() == Direction::Inline {
                         IS_INLINE_FLEX_ITEM
                     } 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);
                 }
                 parent.add_new_child((*child).clone());
                 true
             }
 
             _ => {
--- a/servo/components/layout/display_list_builder.rs
+++ b/servo/components/layout/display_list_builder.rs
@@ -2726,17 +2726,17 @@ pub trait InlineFlowDisplayListBuilding 
 }
 
 impl InlineFlowDisplayListBuilding for InlineFlow {
     fn collect_stacking_contexts_for_inline(&mut self, state: &mut DisplayListBuildState) {
         self.base.stacking_context_id = state.current_stacking_context_id;
         self.base.clip_and_scroll_info = Some(state.current_clip_and_scroll_info);
         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_cb_clip_scroll_info = state.containing_block_clip_and_scroll_info;
             if establishes_containing_block_for_absolute(fragment.style.get_box().position) {
                 state.containing_block_clip_and_scroll_info = state.current_clip_and_scroll_info;
             }
 
             match fragment.specific {
                 SpecificFragmentInfo::InlineBlock(ref mut block_flow) => {
                     let block_flow = FlowRef::deref_mut(&mut block_flow.flow_ref);
--- a/servo/components/layout/flex.rs
+++ b/servo/components/layout/flex.rs
@@ -410,17 +410,17 @@ impl FlexFlow {
             return None;
         }
         let mut end = start;
         let mut total_line_size = Au(0);
         let mut margin_count = 0;
 
         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);
             if total_line_size + outer_main_size > container_size && end != start && self.is_wrappable {
                 break;
             }
             margin_count += item.auto_margin_count(kid, self.main_mode);
             total_line_size += outer_main_size;
@@ -602,17 +602,17 @@ impl FlexFlow {
                 justify_content::T::flex_end => {
                     cur_i += line.free_space;
                 }
                 _ => {}
             }
 
             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;
                 block.base.block_container_explicit_block_size = explicit_content_size;
                 // Per CSS 2.1 ยง 16.3.1, text alignment propagates to all children in flow.
                 //
                 // TODO(#2265, pcwalton): Do this in the cascade instead.
                 block.base.flags.set_text_align(containing_block_text_align);
@@ -654,17 +654,17 @@ impl FlexFlow {
         let mut cur_b = if !self.main_reverse {
             self.block_flow.fragment.border_padding.block_start
         } else {
             self.block_flow.fragment.border_box.size.block
         };
 
         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;
             } else {
                 cur_b = cur_b - base.position.size.block;
                 base.position.start.b = cur_b;
             }
         }
--- a/servo/components/layout/inline.rs
+++ b/servo/components/layout/inline.rs
@@ -430,17 +430,17 @@ impl LineBreaker {
 
     /// Removes trailing whitespace from the pending line if necessary. This is done right before
     /// flushing it.
     fn strip_trailing_whitespace_from_pending_line_if_necessary(&mut self) {
         if self.pending_line.range.is_empty() {
             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;
 
         fragment.strip_trailing_whitespace_if_necessary();
 
         self.pending_line.bounds.size.inline +=
             fragment.border_box.size.inline - old_fragment_inline_size;
     }
@@ -1042,17 +1042,17 @@ impl InlineFlow {
         if expansion_opportunities == 0 {
             return
         }
 
         // Then distribute all the space across the expansion opportunities.
         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
             };
             let fragment_range = scanned_text_fragment_info.range;
             let run = Arc::make_mut(&mut scanned_text_fragment_info.run);
             run.extra_word_spacing = space_per_expansion_opportunity;
 
             // Recompute the fragment's border box size.
--- a/servo/components/layout/sequential.rs
+++ b/servo/components/layout/sequential.rs
@@ -112,17 +112,17 @@ pub fn iterate_through_flow_tree_fragmen
     doit(root, 0, iterator, &Point2D::zero());
 }
 
 pub fn store_overflow(layout_context: &LayoutContext, flow: &mut Flow) {
     if !flow::base(flow).restyle_damage.contains(STORE_OVERFLOW) {
         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);
     }
 
     flow.store_overflow(layout_context);
 
     flow::mut_base(flow)
         .restyle_damage
         .remove(STORE_OVERFLOW);
--- a/servo/components/layout/table_cell.rs
+++ b/servo/components/layout/table_cell.rs
@@ -131,17 +131,17 @@ impl TableCellFlow {
             vertical_align::T::bottom => kids_self_gap,
             _ => Au(0),
         };
         if offset == Au(0) {
             return
         }
 
         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
             }
         }
     }
 }
 
 impl Flow for TableCellFlow {
--- a/servo/components/layout/text.rs
+++ b/servo/components/layout/text.rs
@@ -455,17 +455,17 @@ pub fn line_height_from_style(style: &Co
 }
 
 fn split_first_fragment_at_newline_if_necessary(fragments: &mut LinkedList<Fragment>) {
     if fragments.is_empty() {
         return
     }
 
     let new_fragment = {
-        let mut first_fragment = fragments.front_mut().unwrap();
+        let first_fragment = fragments.front_mut().unwrap();
         let string_before;
         let selection_before;
         {
             if !first_fragment.white_space().preserve_newlines() {
                 return;
             }
 
             let unscanned_text_fragment_info = match first_fragment.specific {
--- a/servo/components/net/cookie_storage.rs
+++ b/servo/components/net/cookie_storage.rs
@@ -98,17 +98,17 @@ impl CookieStorage {
         // Step 11
         if let Some(old_cookie) = old_cookie.unwrap() {
             // Step 11.3
             cookie.creation_time = old_cookie.creation_time;
         }
 
         // 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();
             cookies.retain(|c| !is_cookie_expired(&c));
             let new_len = cookies.len();
 
             // https://www.ietf.org/id/draft-ietf-httpbis-cookie-alone-01.txt
             if new_len == old_len && !evict_one_cookie(cookie.cookie.secure(), cookies) {
--- a/servo/components/profile/heartbeats.rs
+++ b/servo/components/profile/heartbeats.rs
@@ -28,17 +28,17 @@ pub fn cleanup() {
     let hbs_opt_box: Option<Box<HashMap<ProfilerCategory, Heartbeat>>> = lock_and_work(|hbs_opt|
         hbs_opt.take().map(|hbs_ptr|
             unsafe {
                 Box::from_raw(hbs_ptr)
             }
         )
     );
     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);
         }
         hbs.clear();
     }
 }
 
 /// Check if a heartbeat exists for the given category
@@ -60,17 +60,17 @@ pub fn maybe_heartbeat(category: &Profil
                        start_energy: u64,
                        end_energy: u64) {
     lock_and_work(|hbs_opt|
         if let Some(hbs_ptr) = *hbs_opt {
             unsafe {
                 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);
                 }
             }
         }
     );
 }
 
 // TODO(cimes): Android doesn't really do environment variables. Need a better way to configure dynamically.
--- a/servo/components/script/dom/bindings/js.rs
+++ b/servo/components/script/dom/bindings/js.rs
@@ -464,27 +464,27 @@ impl RootCollection {
         RootCollection {
             roots: UnsafeCell::new(vec![]),
         }
     }
 
     /// 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())
     }
 
     /// Stop tracking a stack-based reflector, asserting if it isn't found.
     unsafe fn unroot(&self, tracked_reflector: *const Reflector) {
         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);
             },
             None => panic!("Can't remove a root that was never rooted!"),
         }
     }
 }
--- a/servo/components/script/dom/cssstyledeclaration.rs
+++ b/servo/components/script/dom/cssstyledeclaration.rs
@@ -233,17 +233,17 @@ impl CSSStyleDeclaration {
     }
 
     fn set_property(&self, id: PropertyId, value: DOMString, priority: DOMString) -> ErrorResult {
         // Step 1
         if self.readonly {
             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);
                 return Ok(());
             }
 
             // Step 4
             let importance = match &*priority {
@@ -355,17 +355,17 @@ impl CSSStyleDeclarationMethods for CSSS
 
         // Step 4
         let importance = match &*priority {
             "" => Importance::Normal,
             p if p.eq_ignore_ascii_case("important") => Importance::Important,
             _ => 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);
         });
 
         Ok(())
     }
 
     // https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-setpropertyvalue
@@ -383,17 +383,17 @@ impl CSSStyleDeclarationMethods for CSSS
         let id = if let Ok(id) = PropertyId::parse(&property) {
             id
         } else {
             // Unkwown property, cannot be there to remove.
             return Ok(DOMString::new())
         };
 
         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);
         });
 
         // Step 6
         Ok(DOMString::from(string))
     }
 
@@ -433,17 +433,17 @@ impl CSSStyleDeclarationMethods for CSSS
         let window = self.owner.window();
 
         // Step 1
         if self.readonly {
             return Err(Error::NoModificationAllowed);
         }
 
         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(),
                                          window.css_error_reporter(),
                                          quirks_mode);
         });
 
         Ok(())
--- a/servo/components/script/dom/cssstylerule.rs
+++ b/servo/components/script/dom/cssstylerule.rs
@@ -95,16 +95,16 @@ impl CSSStyleRuleMethods for CSSStyleRul
             namespaces: &namespaces,
             url_data: None,
         };
         let mut css_parser = CssParserInput::new(&*value);
         let mut css_parser = CssParser::new(&mut css_parser);
         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!
             self.global().as_window().Document().invalidate_stylesheets();
         }
     }
 }
--- a/servo/components/script/dom/document.rs
+++ b/servo/components/script/dom/document.rs
@@ -628,26 +628,26 @@ impl Document {
                        .expect("The element is in the document, so there must be a document \
                                 element.");
 
         // Limit the scope of the borrow because id_map might be borrowed again by
         // GetElementById through the following sequence of calls
         // 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);
     }
 
     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));
     }
 
     pub fn unregister_form_id_listener<T: ?Sized + FormControl>(&self, id: DOMString, listener: &T) {
         let mut map = self.form_id_listener_map.borrow_mut();
         if let Occupied(mut entry) = map.entry(Atom::from(id)) {
             entry.get_mut().remove(&JS::from_ref(listener.to_element()));
             if entry.get().is_empty() {
@@ -1554,17 +1554,17 @@ impl Document {
         }
 
         ident
     }
 
     /// 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;
         }
     }
 
     /// https://html.spec.whatwg.org/multipage/#run-the-animation-frame-callbacks
     pub fn run_the_animation_frame_callbacks(&self) {
         rooted_vec!(let mut animation_frame_list);
         mem::swap(
@@ -2386,17 +2386,17 @@ impl Document {
         RefMut::map(map, |m| m.entry(JS::from_ref(el)).or_insert_with(PendingRestyle::new))
     }
 
     pub fn element_state_will_change(&self, el: &Element) {
         let mut entry = self.ensure_pending_restyle(el);
         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());
         }
     }
 
     pub fn element_attr_will_change(&self, el: &Element, attr: &Attr) {
         // FIXME(emilio): Kind of a shame we have to duplicate this.
         //
@@ -2413,17 +2413,17 @@ impl Document {
 
         // FIXME(emilio): This should become something like
         // element.is_attribute_mapped(attr.local_name()).
         if attr.local_name() == &local_name!("width") ||
            attr.local_name() == &local_name!("height") {
             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") {
             snapshot.class_changed = true;
         } else {
             snapshot.other_attributes_changed = true;
         }
         if snapshot.attrs.is_none() {
@@ -4014,17 +4014,17 @@ impl PendingInOrderScriptVec {
     }
 
     fn push(&self, element: &HTMLScriptElement) {
         self.scripts.borrow_mut().push_back(PendingScript::new(element));
     }
 
     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);
     }
 
     fn take_next_ready_to_be_executed(&self) -> Option<(Root<HTMLScriptElement>, ScriptResult)> {
         let mut scripts = self.scripts.borrow_mut();
         let pair = scripts.front_mut().and_then(PendingScript::take_result);
         if pair.is_none() {
             return None;
--- a/servo/components/script/dom/medialist.rs
+++ b/servo/components/script/dom/medialist.rs
@@ -58,17 +58,17 @@ impl MediaListMethods for MediaList {
     fn MediaText(&self) -> DOMString {
         let guard = self.shared_lock().read();
         DOMString::from(self.media_queries.read_with(&guard).to_css_string())
     }
 
     // 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
             *media_queries = StyleMediaList::empty();
             return;
         }
         // Step 3
         let mut input = ParserInput::new(&value);
@@ -149,15 +149,15 @@ impl MediaListMethods for MediaList {
         let m = MediaQuery::parse(&context, &mut parser);
         // Step 2
         if let Err(_) = m {
             return;
         }
         // 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();
         media_list.media_queries = new_vec;
     }
 }
--- a/servo/components/script/dom/range.rs
+++ b/servo/components/script/dom/range.rs
@@ -1044,17 +1044,17 @@ impl WeakRangeVec {
     pub fn drain_to_parent(&self, context: &UnbindContext, child: &Node) {
         if self.is_empty() {
             return;
         }
 
         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();
                 if &range.start.node == parent || &range.end.node == parent {
                     entry.remove();
                 }
                 if &range.start.node == child {
                     range.start.set(context.parent, offset);
@@ -1071,17 +1071,17 @@ impl WeakRangeVec {
     /// Used for steps 7.1-2. when normalizing a node.
     /// https://dom.spec.whatwg.org/#dom-node-normalize
     pub fn drain_to_preceding_text_sibling(&self, node: &Node, sibling: &Node, length: u32) {
         if self.is_empty() {
             return;
         }
 
         unsafe {
-            let mut ranges = &mut *self.cell.get();
+            let ranges = &mut *self.cell.get();
 
             ranges.update(|entry| {
                 let range = entry.root().unwrap();
                 if &range.start.node == sibling || &range.end.node == sibling {
                     entry.remove();
                 }
                 if &range.start.node == node {
                     range.start.set(sibling, range.StartOffset() + length);
--- a/servo/components/script/dom/servoparser/async_html.rs
+++ b/servo/components/script/dom/servoparser/async_html.rs
@@ -563,17 +563,17 @@ impl TreeSink for Sink {
     }
 
     fn get_template_contents(&mut self, target: &Self::Handle) -> Self::Handle {
         if let Some(ref contents) = self.get_parse_node_data(&target.id).contents {
             return contents.clone();
         }
         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 });
         node
     }
 
     fn same_node(&self, x: &Self::Handle, y: &Self::Handle) -> bool {
         x.id == y.id
@@ -591,17 +591,17 @@ impl TreeSink for Sink {
         }
     }
 
     fn create_element(&mut self, name: QualName, html_attrs: Vec<HtmlAttribute>, _flags: ElementFlags)
         -> Self::Handle {
         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());
                 (attr.name.local == local_name!("encoding") && attr.name.ns == ns!()) &&
                 (attr_value.eq_ignore_ascii_case("text/html") ||
                 attr_value.eq_ignore_ascii_case("application/xhtml+xml"))
             });
         }
--- a/servo/components/script/dom/url.rs
+++ b/servo/components/script/dom/url.rs
@@ -91,18 +91,18 @@ impl URL {
         // Step 8: Instead of construcing a new `URLSearchParams` object here, construct it
         //         on-demand inside `URL::SearchParams`.
         // Step 9.
         Ok(result)
     }
 
     // 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();
 
         DOMString::from(URL::unicode_serialization_blob_url(&origin, &id))
     }
 
     // https://w3c.github.io/FileAPI/#dfn-revokeObjectURL
--- a/servo/components/script/dom/vrdisplay.rs
+++ b/servo/components/script/dom/vrdisplay.rs
@@ -263,17 +263,17 @@ impl VRDisplayMethods for VRDisplay {
             self.global().as_window().RequestAnimationFrame(callback)
         }
     }
 
     // https://w3c.github.io/webvr/#dom-vrdisplay-cancelanimationframe
     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 {
             // WebVR spec: When a VRDisplay is not presenting it should
             // fallback to window.cancelAnimationFrame.
             self.global().as_window().CancelAnimationFrame(handle);
         }
     }
--- a/servo/components/script/dom/webglrenderingcontext.rs
+++ b/servo/components/script/dom/webglrenderingcontext.rs
@@ -2429,17 +2429,17 @@ impl WebGLRenderingContextMethods for We
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.12
     unsafe fn ReadPixels(&self, cx: *mut JSContext, x: i32, y: i32, width: i32, height: i32,
                   format: u32, pixel_type: u32, pixels: *mut JSObject) -> Fallible<()> {
         if pixels.is_null() {
             return Ok(self.webgl_error(InvalidValue));
         }
 
         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())),
         };
 
         if !self.validate_framebuffer_complete() {
             return Ok(());
         }
 
--- a/servo/components/script/dom/xmlhttprequest.rs
+++ b/servo/components/script/dom/xmlhttprequest.rs
@@ -622,17 +622,17 @@ impl XMLHttpRequestMethods for XMLHttpRe
                     if !request.headers.has::<ContentType>() {
                         request.headers.set_raw("content-type", vec![ct.bytes().collect()]);
                         content_type_set = true;
                     }
                 }
 
                 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 {
                                     if !param.0.as_str().eq_ignore_ascii_case(encoding.as_str()) {
                                         *param = (MimeAttr::Charset, encoding.clone());
                                     }
                                 }
                             }
--- a/servo/components/script/lib.rs
+++ b/servo/components/script/lib.rs
@@ -5,17 +5,16 @@
 #![feature(ascii_ctype)]
 #![feature(box_syntax)]
 #![feature(conservative_impl_trait)]
 #![feature(const_fn)]
 #![feature(core_intrinsics)]
 #![feature(mpsc_select)]
 #![feature(nonzero)]
 #![feature(on_unimplemented)]
-#![feature(option_entry)]
 #![feature(plugin)]
 #![feature(proc_macro)]
 #![feature(stmt_expr_attributes)]
 #![feature(try_from)]
 #![feature(unboxed_closures)]
 #![feature(untagged_unions)]
 
 #![deny(unsafe_code)]
--- a/servo/components/script_plugins/unrooted_must_root.rs
+++ b/servo/components/script_plugins/unrooted_must_root.rs
@@ -177,17 +177,17 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> 
             if is_unrooted_ty(cx, ty, in_new_function) {
                 cx.span_lint(UNROOTED_MUST_ROOT,
                              subexpr.span,
                              &format!("Expression of type {:?} must be rooted", ty))
             }
         }
 
         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>`.
             // FIXME: Enable this? Triggers on certain kinds of uses of DOMRefCell.
             // hir::ExprAssign(_, ref rhs) => require_rooted(cx, self.in_new_function, &*rhs),
             // This catches calls; basically, this enforces the constraint that only constructors
             // can call other constructors.
             // FIXME: Enable this? Currently triggers with constructs involving DOMRefCell, and
@@ -201,23 +201,31 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> 
         }
 
         visit::walk_expr(self, expr);
     }
 
     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);
     }
 
     fn visit_ty(&mut self, _: &'tcx hir::Ty) {}
 
     fn nested_visit_map<'this>(&'this mut self) -> hir::intravisit::NestedVisitorMap<'this, 'tcx> {
--- a/servo/components/selectors/matching.rs
+++ b/servo/components/selectors/matching.rs
@@ -453,17 +453,17 @@ where
     return CompoundSelectorMatchingResult::Matched {
         next_combinator_offset: 0,
     }
 }
 
 /// 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,
           F: FnMut(&E, ElementSelectorFlags),
 {
     if cfg!(debug_assertions) {
         if context.nesting_level == 0 &&
             context.shared.matching_mode == MatchingMode::ForStatelessPseudoElement {
--- a/servo/components/selectors/parser.rs
+++ b/servo/components/selectors/parser.rs
@@ -1459,17 +1459,17 @@ fn parse_negation<'i, 't, P, E, Impl>(pa
 /// | [ HASH | class | attrib | pseudo | negation ]+
 ///
 /// `Err(())` means invalid selector.
 ///
 /// The boolean represent whether a pseudo-element has been parsed.
 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
 {
     // Consume any leading whitespace.
     loop {
         let before_this_token = input.state();
         if !matches!(input.next_including_whitespace(), Ok(&Token::WhiteSpace(_))) {
             input.reset(&before_this_token);
--- a/servo/components/style/invalidation/element/invalidator.rs
+++ b/servo/components/style/invalidation/element/invalidator.rs
@@ -149,17 +149,17 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator
         // If we are sensitive to visitedness and the visited state changed, we
         // force a restyle here. Matching doesn't depend on the actual visited
         // state at all, so we can't look at matching results to decide what to
         // do for this case.
         if state_changes.intersects(IN_VISITED_OR_UNVISITED_STATE) {
             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());
         }
 
         let mut classes_removed = SmallVec::<[Atom; 8]>::new();
         let mut classes_added = SmallVec::<[Atom; 8]>::new();
         if snapshot.class_changed() {
             // TODO(emilio): Do this more efficiently!
             snapshot.each_class(|c| {
--- a/servo/components/style/matching.rs
+++ b/servo/components/style/matching.rs
@@ -477,17 +477,17 @@ pub trait MatchMethods : TElement {
         }
     }
 
     /// Updates the styles with the new ones, diffs them, and stores the restyle
     /// damage.
     fn finish_restyle(
         &self,
         context: &mut StyleContext<Self>,
-        mut data: &mut ElementData,
+        data: &mut ElementData,
         mut new_styles: ElementStyles,
         important_rules_changed: bool,
     ) -> ChildCascadeRequirement {
         use dom::TNode;
         use std::cmp;
         use std::mem;
 
         debug_assert!(new_styles.primary.is_some(), "How did that happen?");
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -3390,17 +3390,17 @@ pub fn modify_border_style_for_inline_si
                 PhysicalSide::Right =>  (border.border_right_width,  border.border_right_style),
                 PhysicalSide::Top =>    (border.border_top_width,    border.border_top_style),
                 PhysicalSide::Bottom => (border.border_bottom_width, border.border_bottom_style),
             };
             if current_style == (NonNegativeAu::zero(), BorderStyle::none) {
                 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 => {
                 border.border_left_width = NonNegativeAu::zero();
                 border.border_left_style = BorderStyle::none;
             }
             PhysicalSide::Right => {
                 border.border_right_width = NonNegativeAu::zero();
--- a/servo/components/style/style_adjuster.rs
+++ b/servo/components/style/style_adjuster.rs
@@ -295,17 +295,17 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
             }
             if overflow_y == overflow::_moz_hidden_unscrollable {
                 overflow_y = overflow::hidden;
             }
         }
 
         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);
         }
     }
 
     /// Native anonymous content converts display:contents into display:inline.
     #[cfg(feature = "gecko")]
     fn adjust_for_prohibited_display_contents(&mut self, flags: CascadeFlags) {
--- a/servo/components/style/style_resolver.rs
+++ b/servo/components/style/style_resolver.rs
@@ -242,17 +242,17 @@ where
             if let Some(mut pseudo_array) = inputs.pseudos.into_array() {
                 let layout_parent_style_for_pseudo =
                     if primary_style.style.is_display_contents() {
                         layout_parent_style
                     } else {
                         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(
                             &pseudo,
                             self.cascade_style_and_visited(
                                 inputs,
                                 Some(&*primary_style.style),
                                 layout_parent_style_for_pseudo,
--- a/servo/components/style/stylesheets/rule_list.rs
+++ b/servo/components/style/stylesheets/rule_list.rs
@@ -145,17 +145,17 @@ impl CssRulesHelpers for RawOffsetArc<Lo
                 parent_stylesheet_contents,
                 lock,
                 state,
                 loader
             )?;
 
         {
             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);
             if new_state > rev_state {
                 // We inserted a rule too early, e.g. inserting
                 // a regular style rule before @namespace rules
                 return Err(RulesMutateError::HierarchyRequest);
             }
--- a/servo/components/style/stylesheets/rule_parser.rs
+++ b/servo/components/style/stylesheets/rule_parser.rs
@@ -204,17 +204,17 @@ impl<'a, 'i> AtRuleParser<'i> for TopLev
                         return Err(StyleParseError::UnexpectedTokenWithinNamespace(t).into()),
                     Err(e) => return Err(e.into()),
                 };
                 let url = Namespace::from(maybe_namespace.as_ref());
 
                 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());
                     namespaces
                         .prefixes
                         .insert(prefix.clone(), (url.clone(), id));
                     Some(prefix)
                 } else {
--- a/servo/components/style/stylesheets/rules_iterator.rs
+++ b/servo/components/style/stylesheets/rules_iterator.rs
@@ -65,17 +65,17 @@ impl<'a, 'b, C> Iterator for RulesIterat
             if nested_iter_finished {
                 self.stack.pop();
                 nested_iter_finished = false;
                 continue;
             }
 
             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 => {
                         nested_iter_finished = true;
                         continue
                     }
                 };
 
--- a/servo/components/style/values/animated/color.rs
+++ b/servo/components/style/values/animated/color.rs
@@ -203,12 +203,12 @@ impl ComputeSquaredDistance for Color {
             )
         }
     }
 }
 
 impl ToAnimatedZero for Color {
     #[inline]
     fn to_animated_zero(&self) -> Result<Self, ()> {
-        /// FIXME(nox): This does not look correct to me.
+        // FIXME(nox): This does not look correct to me.
         Err(())
     }
 }
--- a/servo/components/style/values/computed/border.rs
+++ b/servo/components/style/values/computed/border.rs
@@ -34,12 +34,12 @@ impl BorderImageSideWidth {
     pub fn one() -> Self {
         GenericBorderImageSideWidth::Number(1.)
     }
 }
 
 impl ToAnimatedZero for BorderCornerRadius {
     #[inline]
     fn to_animated_zero(&self) -> Result<Self, ()> {
-        /// FIXME(nox): Why?
+        // FIXME(nox): Why?
         Err(())
     }
 }
--- a/servo/components/webdriver_server/lib.rs
+++ b/servo/components/webdriver_server/lib.rs
@@ -697,17 +697,17 @@ impl Handler {
                                                                                    "Unable to set cookie"))
             }
         }
     }
 
     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, ""))?;
 
         session.script_timeout = parameters.script;
         session.load_timeout = parameters.page_load;
         session.implicit_wait_timeout = parameters.implicit;
 
         Ok(WebDriverResponse::Void)
--- a/servo/rust-commit-hash
+++ b/servo/rust-commit-hash
@@ -1,1 +1,1 @@
-599be0d18f4c6ddf36366d2a5a2ca6dc65886896
+13d94d5fa8129a34f5c77a1bcd76983f5aed2434
--- a/servo/tests/unit/style/stylist.rs
+++ b/servo/tests/unit/style/stylist.rs
@@ -45,29 +45,16 @@ fn get_mock_rules(css_selectors: &[&str]
         let guard = shared_lock.read();
         let rule = locked.read_with(&guard);
         rule.selectors.0.iter().map(|s| {
             Rule::new(s.clone(), AncestorHashes::new(s, QuirksMode::NoQuirks), locked.clone(), i as u32)
         }).collect()
     }).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
                                                                          .into_iter()
                                                                          .nth(0)
                                                                          .unwrap())
              .collect()
 }