Removed
Link Here
|
1 |
commit ea9c8db790e4 |
2 |
Author: Simon Sapin <simon.sapin@exyr.org> |
3 |
Date: Tue Aug 15 07:31:04 2017 -0500 |
4 |
|
5 |
servo: Merge #18046 - Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10) (from servo:rustup); r=emilio |
6 |
|
7 |
Source-Repo: https://github.com/servo/servo |
8 |
Source-Revision: 7d9b82b9efa7b10a2e34d93df5ac535d99518f7a |
9 |
|
10 |
--HG-- |
11 |
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear |
12 |
extra : subtree_revision : e1b3d113c3edaea3c4c07f8b206f2e02922e3caf |
13 |
--- |
14 |
servo/Cargo.lock | 6 +++--- |
15 |
servo/components/devtools/lib.rs | 2 +- |
16 |
servo/components/layout/animation.rs | 2 +- |
17 |
servo/components/layout/construct.rs | 6 +++--- |
18 |
servo/components/layout/display_list_builder.rs | 2 +- |
19 |
servo/components/layout/flex.rs | 6 +++--- |
20 |
servo/components/layout/inline.rs | 4 ++-- |
21 |
servo/components/layout/sequential.rs | 2 +- |
22 |
servo/components/layout/table_cell.rs | 2 +- |
23 |
servo/components/layout/text.rs | 2 +- |
24 |
servo/components/net/cookie_storage.rs | 2 +- |
25 |
servo/components/profile/heartbeats.rs | 4 ++-- |
26 |
servo/components/script/dom/bindings/js.rs | 4 ++-- |
27 |
servo/components/script/dom/cssstyledeclaration.rs | 8 ++++---- |
28 |
servo/components/script/dom/cssstylerule.rs | 2 +- |
29 |
servo/components/script/dom/document.rs | 12 ++++++------ |
30 |
servo/components/script/dom/medialist.rs | 4 ++-- |
31 |
servo/components/script/dom/range.rs | 4 ++-- |
32 |
.../script/dom/servoparser/async_html.rs | 4 ++-- |
33 |
servo/components/script/dom/url.rs | 4 ++-- |
34 |
servo/components/script/dom/vrdisplay.rs | 2 +- |
35 |
.../components/script/dom/webglrenderingcontext.rs | 2 +- |
36 |
servo/components/script/dom/xmlhttprequest.rs | 2 +- |
37 |
servo/components/script/lib.rs | 1 - |
38 |
.../script_plugins/unrooted_must_root.rs | 22 +++++++++++++++------- |
39 |
servo/components/selectors/matching.rs | 2 +- |
40 |
servo/components/selectors/parser.rs | 2 +- |
41 |
.../style/invalidation/element/invalidator.rs | 2 +- |
42 |
servo/components/style/matching.rs | 2 +- |
43 |
.../components/style/properties/properties.mako.rs | 2 +- |
44 |
servo/components/style/style_adjuster.rs | 2 +- |
45 |
servo/components/style/style_resolver.rs | 2 +- |
46 |
servo/components/style/stylesheets/rule_list.rs | 2 +- |
47 |
servo/components/style/stylesheets/rule_parser.rs | 2 +- |
48 |
.../components/style/stylesheets/rules_iterator.rs | 2 +- |
49 |
servo/components/style/values/animated/color.rs | 2 +- |
50 |
servo/components/style/values/computed/border.rs | 2 +- |
51 |
servo/components/webdriver_server/lib.rs | 2 +- |
52 |
servo/rust-commit-hash | 2 +- |
53 |
servo/tests/unit/style/stylist.rs | 13 ------------- |
54 |
40 files changed, 73 insertions(+), 79 deletions(-) |
55 |
|
56 |
diff --git servo/Cargo.lock servo/Cargo.lock |
57 |
index 50dd6e1a785a..2aa7bd8ea3dd 100644 |
58 |
--- servo/Cargo.lock |
59 |
+++ servo/Cargo.lock |
60 |
@@ -3577,7 +3577,7 @@ version = "0.1.4" |
61 |
source = "registry+https://github.com/rust-lang/crates.io-index" |
62 |
dependencies = [ |
63 |
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", |
64 |
- "xcb 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", |
65 |
+ "xcb 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", |
66 |
] |
67 |
|
68 |
[[package]] |
69 |
@@ -3592,7 +3592,7 @@ dependencies = [ |
70 |
|
71 |
[[package]] |
72 |
name = "xcb" |
73 |
-version = "0.7.6" |
74 |
+version = "0.7.7" |
75 |
source = "registry+https://github.com/rust-lang/crates.io-index" |
76 |
dependencies = [ |
77 |
"libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", |
78 |
@@ -3918,7 +3918,7 @@ dependencies = [ |
79 |
"checksum x11 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db27c597c187da52194a4b8232e7d869503911aab9ff726fefb76d7a830f78ed" |
80 |
"checksum x11-clipboard 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "731230b8edcbb9d99247105e4c9ec0a538594d50ad68d2afa8662195f9db2973" |
81 |
"checksum x11-dl 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "326c500cdc166fd7c70dd8c8a829cd5c0ce7be5a5d98c25817de2b9bdc67faf8" |
82 |
-"checksum xcb 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "63e3a849b73e4e1905e4f4d48f1750429bc86ea9f473632ab382a6f69ecb6b33" |
83 |
+"checksum xcb 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "7cede38417fcdf2f0a9d8abf1cea1c1b066320a8a316e9583a0d717c334fafb2" |
84 |
"checksum xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a66b7c2281ebde13cf4391d70d4c7e5946c3c25e72a7b859ca8f677dcd0b0c61" |
85 |
"checksum xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12ea8eda4b1eb72f02d148402e23832d56a33f55d8c1b2d5bcdde91d79d47cb1" |
86 |
"checksum xml-rs 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7ec6c39eaa68382c8e31e35239402c0a9489d4141a8ceb0c716099a0b515b562" |
87 |
diff --git servo/components/devtools/lib.rs servo/components/devtools/lib.rs |
88 |
index d5a2764a7102..6a25696eaed7 100644 |
89 |
--- servo/components/devtools/lib.rs |
90 |
+++ servo/components/devtools/lib.rs |
91 |
@@ -306,7 +306,7 @@ fn run_server(sender: Sender<DevtoolsControlMsg>, |
92 |
columnNumber: console_message.columnNumber, |
93 |
}, |
94 |
}; |
95 |
- for mut stream in &mut *console_actor.streams.borrow_mut() { |
96 |
+ for stream in &mut *console_actor.streams.borrow_mut() { |
97 |
stream.write_json_packet(&msg); |
98 |
} |
99 |
} |
100 |
diff --git servo/components/layout/animation.rs servo/components/layout/animation.rs |
101 |
index e4a2782c1271..ebbba82fcc6a 100644 |
102 |
--- servo/components/layout/animation.rs |
103 |
+++ servo/components/layout/animation.rs |
104 |
@@ -39,7 +39,7 @@ pub fn update_animation_state(constellation_chan: &IpcSender<ConstellationMsg>, |
105 |
// run. |
106 |
if let Some(ref mut animations) = running_animations.get_mut(node) { |
107 |
// TODO: This being linear is probably not optimal. |
108 |
- for mut anim in animations.iter_mut() { |
109 |
+ for anim in animations.iter_mut() { |
110 |
if let Animation::Keyframes(_, ref anim_name, ref mut anim_state) = *anim { |
111 |
if *name == *anim_name { |
112 |
debug!("update_animation_state: Found other animation {}", name); |
113 |
diff --git servo/components/layout/construct.rs servo/components/layout/construct.rs |
114 |
index c863219941e4..7ef391b42183 100644 |
115 |
--- servo/components/layout/construct.rs |
116 |
+++ servo/components/layout/construct.rs |
117 |
@@ -1921,7 +1921,7 @@ impl Legalizer { |
118 |
/// true for anonymous block children of flex flows. |
119 |
fn try_to_add_child(&mut self, context: &SharedStyleContext, parent: &mut FlowRef, child: &mut FlowRef) |
120 |
-> bool { |
121 |
- let mut parent = self.stack.last_mut().unwrap_or(parent); |
122 |
+ let parent = self.stack.last_mut().unwrap_or(parent); |
123 |
let (parent_class, child_class) = (parent.class(), child.class()); |
124 |
match (parent_class, child_class) { |
125 |
(FlowClass::TableWrapper, FlowClass::Table) | |
126 |
@@ -1962,7 +1962,7 @@ impl Legalizer { |
127 |
} else { |
128 |
IS_BLOCK_FLEX_ITEM |
129 |
}; |
130 |
- let mut block = FlowRef::deref_mut(&mut block_wrapper).as_mut_block(); |
131 |
+ let block = FlowRef::deref_mut(&mut block_wrapper).as_mut_block(); |
132 |
block.base.flags.insert(MARGINS_CANNOT_COLLAPSE); |
133 |
block.fragment.flags.insert(flag); |
134 |
} |
135 |
@@ -1979,7 +1979,7 @@ impl Legalizer { |
136 |
} else { |
137 |
IS_BLOCK_FLEX_ITEM |
138 |
}; |
139 |
- let mut block = FlowRef::deref_mut(child).as_mut_block(); |
140 |
+ let block = FlowRef::deref_mut(child).as_mut_block(); |
141 |
block.base.flags.insert(MARGINS_CANNOT_COLLAPSE); |
142 |
block.fragment.flags.insert(flag); |
143 |
} |
144 |
diff --git servo/components/layout/display_list_builder.rs servo/components/layout/display_list_builder.rs |
145 |
index f8b26899b57d..783574afd2a3 100644 |
146 |
--- servo/components/layout/display_list_builder.rs |
147 |
+++ servo/components/layout/display_list_builder.rs |
148 |
@@ -2718,7 +2718,7 @@ impl InlineFlowDisplayListBuilding for InlineFlow { |
149 |
self.base.scroll_root_id = Some(state.current_scroll_root_id); |
150 |
self.base.clip = state.clip_stack.last().cloned().unwrap_or_else(max_rect); |
151 |
|
152 |
- for mut fragment in self.fragments.fragments.iter_mut() { |
153 |
+ for fragment in self.fragments.fragments.iter_mut() { |
154 |
let previous_containing_block_scroll_root_id = state.containing_block_scroll_root_id; |
155 |
if establishes_containing_block_for_absolute(fragment.style.get_box().position) { |
156 |
state.containing_block_scroll_root_id = state.current_scroll_root_id; |
157 |
diff --git servo/components/layout/flex.rs servo/components/layout/flex.rs |
158 |
index 353c939f58b9..d79580f8cd0d 100644 |
159 |
--- servo/components/layout/flex.rs |
160 |
+++ servo/components/layout/flex.rs |
161 |
@@ -415,7 +415,7 @@ impl FlexFlow { |
162 |
|
163 |
let items = &mut self.items[start..]; |
164 |
let mut children = self.block_flow.base.children.random_access_mut(); |
165 |
- for mut item in items { |
166 |
+ for item in items { |
167 |
let kid = children.get(item.index); |
168 |
item.init_sizes(kid, container_size, self.main_mode); |
169 |
let outer_main_size = item.outer_main_size(kid, self.main_mode); |
170 |
@@ -607,7 +607,7 @@ impl FlexFlow { |
171 |
|
172 |
let mut children = self.block_flow.base.children.random_access_mut(); |
173 |
for item in items.iter_mut() { |
174 |
- let mut block = children.get(item.index).as_mut_block(); |
175 |
+ let block = children.get(item.index).as_mut_block(); |
176 |
|
177 |
block.base.block_container_writing_mode = container_mode; |
178 |
block.base.block_container_inline_size = inline_size; |
179 |
@@ -659,7 +659,7 @@ impl FlexFlow { |
180 |
|
181 |
let mut children = self.block_flow.base.children.random_access_mut(); |
182 |
for item in &mut self.items { |
183 |
- let mut base = flow::mut_base(children.get(item.index)); |
184 |
+ let base = flow::mut_base(children.get(item.index)); |
185 |
if !self.main_reverse { |
186 |
base.position.start.b = cur_b; |
187 |
cur_b = cur_b + base.position.size.block; |
188 |
diff --git servo/components/layout/inline.rs servo/components/layout/inline.rs |
189 |
index d5813d9bea22..10e091c3c66d 100644 |
190 |
--- servo/components/layout/inline.rs |
191 |
+++ servo/components/layout/inline.rs |
192 |
@@ -435,7 +435,7 @@ impl LineBreaker { |
193 |
return |
194 |
} |
195 |
let last_fragment_index = self.pending_line.range.end() - FragmentIndex(1); |
196 |
- let mut fragment = &mut self.new_fragments[last_fragment_index.get() as usize]; |
197 |
+ let fragment = &mut self.new_fragments[last_fragment_index.get() as usize]; |
198 |
|
199 |
let old_fragment_inline_size = fragment.border_box.size.inline; |
200 |
|
201 |
@@ -1047,7 +1047,7 @@ impl InlineFlow { |
202 |
let space_per_expansion_opportunity = slack_inline_size / expansion_opportunities as i32; |
203 |
for fragment_index in line.range.each_index() { |
204 |
let fragment = fragments.get_mut(fragment_index.to_usize()); |
205 |
- let mut scanned_text_fragment_info = match fragment.specific { |
206 |
+ let scanned_text_fragment_info = match fragment.specific { |
207 |
SpecificFragmentInfo::ScannedText(ref mut info) if !info.range.is_empty() => info, |
208 |
_ => continue |
209 |
}; |
210 |
diff --git servo/components/layout/sequential.rs servo/components/layout/sequential.rs |
211 |
index f6f8ce429e4f..4986ebb6c852 100644 |
212 |
--- servo/components/layout/sequential.rs |
213 |
+++ servo/components/layout/sequential.rs |
214 |
@@ -133,7 +133,7 @@ pub fn store_overflow(layout_context: &LayoutContext, flow: &mut Flow) { |
215 |
return; |
216 |
} |
217 |
|
218 |
- for mut kid in flow::mut_base(flow).child_iter_mut() { |
219 |
+ for kid in flow::mut_base(flow).child_iter_mut() { |
220 |
store_overflow(layout_context, kid); |
221 |
} |
222 |
|
223 |
diff --git servo/components/layout/table_cell.rs servo/components/layout/table_cell.rs |
224 |
index 7ef02e28db65..fd807989b463 100644 |
225 |
--- servo/components/layout/table_cell.rs |
226 |
+++ servo/components/layout/table_cell.rs |
227 |
@@ -136,7 +136,7 @@ impl TableCellFlow { |
228 |
} |
229 |
|
230 |
for kid in flow::mut_base(self).children.iter_mut() { |
231 |
- let mut kid_base = flow::mut_base(kid); |
232 |
+ let kid_base = flow::mut_base(kid); |
233 |
if !kid_base.flags.contains(IS_ABSOLUTELY_POSITIONED) { |
234 |
kid_base.position.start.b += offset |
235 |
} |
236 |
diff --git servo/components/layout/text.rs servo/components/layout/text.rs |
237 |
index 6e1c7b2a43a1..9a207a2bb84e 100644 |
238 |
--- servo/components/layout/text.rs |
239 |
+++ servo/components/layout/text.rs |
240 |
@@ -460,7 +460,7 @@ fn split_first_fragment_at_newline_if_necessary(fragments: &mut LinkedList<Fragm |
241 |
} |
242 |
|
243 |
let new_fragment = { |
244 |
- let mut first_fragment = fragments.front_mut().unwrap(); |
245 |
+ let first_fragment = fragments.front_mut().unwrap(); |
246 |
let string_before; |
247 |
let selection_before; |
248 |
{ |
249 |
diff --git servo/components/net/cookie_storage.rs servo/components/net/cookie_storage.rs |
250 |
index f255f57b56d2..b3147ef4dd32 100644 |
251 |
--- servo/components/net/cookie_storage.rs |
252 |
+++ servo/components/net/cookie_storage.rs |
253 |
@@ -103,7 +103,7 @@ impl CookieStorage { |
254 |
|
255 |
// Step 12 |
256 |
let domain = reg_host(&cookie.cookie.domain().as_ref().unwrap_or(&"")); |
257 |
- let mut cookies = self.cookies_map.entry(domain).or_insert(vec![]); |
258 |
+ let cookies = self.cookies_map.entry(domain).or_insert(vec![]); |
259 |
|
260 |
if cookies.len() == self.max_per_host { |
261 |
let old_len = cookies.len(); |
262 |
diff --git servo/components/profile/heartbeats.rs servo/components/profile/heartbeats.rs |
263 |
index 4661dad61836..0d474fe3a111 100644 |
264 |
--- servo/components/profile/heartbeats.rs |
265 |
+++ servo/components/profile/heartbeats.rs |
266 |
@@ -33,7 +33,7 @@ pub fn cleanup() { |
267 |
) |
268 |
); |
269 |
if let Some(mut hbs) = hbs_opt_box { |
270 |
- for (_, mut v) in hbs.iter_mut() { |
271 |
+ for (_, v) in hbs.iter_mut() { |
272 |
// log any remaining heartbeat records before dropping |
273 |
log_heartbeat_records(v); |
274 |
} |
275 |
@@ -65,7 +65,7 @@ pub fn maybe_heartbeat(category: &ProfilerCategory, |
276 |
if !(*hbs_ptr).contains_key(category) { |
277 |
maybe_create_heartbeat(&mut (*hbs_ptr), category.clone()); |
278 |
} |
279 |
- if let Some(mut h) = (*hbs_ptr).get_mut(category) { |
280 |
+ if let Some(h) = (*hbs_ptr).get_mut(category) { |
281 |
(*h).heartbeat(0, 1, start_time, end_time, start_energy, end_energy); |
282 |
} |
283 |
} |
284 |
diff --git servo/components/script/dom/bindings/js.rs servo/components/script/dom/bindings/js.rs |
285 |
index 975ddeda13b0..abfd9f47eff1 100644 |
286 |
--- servo/components/script/dom/bindings/js.rs |
287 |
+++ servo/components/script/dom/bindings/js.rs |
288 |
@@ -469,7 +469,7 @@ impl RootCollection { |
289 |
/// Start tracking a stack-based root |
290 |
unsafe fn root(&self, untracked_reflector: *const Reflector) { |
291 |
debug_assert!(thread_state::get().is_script()); |
292 |
- let mut roots = &mut *self.roots.get(); |
293 |
+ let roots = &mut *self.roots.get(); |
294 |
roots.push(untracked_reflector); |
295 |
assert!(!(*untracked_reflector).get_jsobject().is_null()) |
296 |
} |
297 |
@@ -479,7 +479,7 @@ impl RootCollection { |
298 |
assert!(!tracked_reflector.is_null()); |
299 |
assert!(!(*tracked_reflector).get_jsobject().is_null()); |
300 |
debug_assert!(thread_state::get().is_script()); |
301 |
- let mut roots = &mut *self.roots.get(); |
302 |
+ let roots = &mut *self.roots.get(); |
303 |
match roots.iter().rposition(|r| *r == tracked_reflector) { |
304 |
Some(idx) => { |
305 |
roots.remove(idx); |
306 |
diff --git servo/components/script/dom/cssstyledeclaration.rs servo/components/script/dom/cssstyledeclaration.rs |
307 |
index 0732c9af9e45..ddf085b34913 100644 |
308 |
--- servo/components/script/dom/cssstyledeclaration.rs |
309 |
+++ servo/components/script/dom/cssstyledeclaration.rs |
310 |
@@ -238,7 +238,7 @@ impl CSSStyleDeclaration { |
311 |
return Err(Error::NoModificationAllowed); |
312 |
} |
313 |
|
314 |
- self.owner.mutate_associated_block(|ref mut pdb, mut changed| { |
315 |
+ self.owner.mutate_associated_block(|pdb, changed| { |
316 |
if value.is_empty() { |
317 |
// Step 3 |
318 |
*changed = pdb.remove_property(&id); |
319 |
@@ -360,7 +360,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration { |
320 |
_ => return Ok(()), |
321 |
}; |
322 |
|
323 |
- self.owner.mutate_associated_block(|ref mut pdb, mut changed| { |
324 |
+ self.owner.mutate_associated_block(|pdb, changed| { |
325 |
// Step 5 & 6 |
326 |
*changed = pdb.set_importance(&id, importance); |
327 |
}); |
328 |
@@ -388,7 +388,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration { |
329 |
}; |
330 |
|
331 |
let mut string = String::new(); |
332 |
- self.owner.mutate_associated_block(|mut pdb, mut changed| { |
333 |
+ self.owner.mutate_associated_block(|pdb, changed| { |
334 |
pdb.property_value_to_css(&id, &mut string).unwrap(); |
335 |
*changed = pdb.remove_property(&id); |
336 |
}); |
337 |
@@ -438,7 +438,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration { |
338 |
} |
339 |
|
340 |
let quirks_mode = window.Document().quirks_mode(); |
341 |
- self.owner.mutate_associated_block(|mut pdb, mut _changed| { |
342 |
+ self.owner.mutate_associated_block(|pdb, _changed| { |
343 |
// Step 3 |
344 |
*pdb = parse_style_attribute(&value, |
345 |
&self.owner.base_url(), |
346 |
diff --git servo/components/script/dom/cssstylerule.rs servo/components/script/dom/cssstylerule.rs |
347 |
index ea121ef900a9..12e9cdcc8694 100644 |
348 |
--- servo/components/script/dom/cssstylerule.rs |
349 |
+++ servo/components/script/dom/cssstylerule.rs |
350 |
@@ -99,7 +99,7 @@ impl CSSStyleRuleMethods for CSSStyleRule { |
351 |
if let Ok(mut s) = SelectorList::parse(&parser, &mut css_parser) { |
352 |
// This mirrors what we do in CSSStyleOwner::mutate_associated_block. |
353 |
let mut guard = self.cssrule.shared_lock().write(); |
354 |
- let mut stylerule = self.stylerule.write_with(&mut guard); |
355 |
+ let stylerule = self.stylerule.write_with(&mut guard); |
356 |
mem::swap(&mut stylerule.selectors, &mut s); |
357 |
// It seems like we will want to avoid having to invalidate all |
358 |
// stylesheets eventually! |
359 |
diff --git servo/components/script/dom/document.rs servo/components/script/dom/document.rs |
360 |
index 90ea06fbe7b4..71bb02eaa364 100644 |
361 |
--- servo/components/script/dom/document.rs |
362 |
+++ servo/components/script/dom/document.rs |
363 |
@@ -633,7 +633,7 @@ impl Document { |
364 |
// reset_form_owner_for_listeners -> reset_form_owner -> GetElementById |
365 |
{ |
366 |
let mut id_map = self.id_map.borrow_mut(); |
367 |
- let mut elements = id_map.entry(id.clone()).or_insert(Vec::new()); |
368 |
+ let elements = id_map.entry(id.clone()).or_insert(Vec::new()); |
369 |
elements.insert_pre_order(element, root.r().upcast::<Node>()); |
370 |
} |
371 |
self.reset_form_owner_for_listeners(&id); |
372 |
@@ -642,7 +642,7 @@ impl Document { |
373 |
pub fn register_form_id_listener<T: ?Sized + FormControl>(&self, id: DOMString, listener: &T) { |
374 |
let mut map = self.form_id_listener_map.borrow_mut(); |
375 |
let listener = listener.to_element(); |
376 |
- let mut set = map.entry(Atom::from(id)).or_insert(HashSet::new()); |
377 |
+ let set = map.entry(Atom::from(id)).or_insert(HashSet::new()); |
378 |
set.insert(JS::from_ref(listener)); |
379 |
} |
380 |
|
381 |
@@ -1572,7 +1572,7 @@ impl Document { |
382 |
/// https://html.spec.whatwg.org/multipage/#dom-window-cancelanimationframe |
383 |
pub fn cancel_animation_frame(&self, ident: u32) { |
384 |
let mut list = self.animation_frame_list.borrow_mut(); |
385 |
- if let Some(mut pair) = list.iter_mut().find(|pair| pair.0 == ident) { |
386 |
+ if let Some(pair) = list.iter_mut().find(|pair| pair.0 == ident) { |
387 |
pair.1 = None; |
388 |
} |
389 |
} |
390 |
@@ -2399,7 +2399,7 @@ impl Document { |
391 |
if entry.snapshot.is_none() { |
392 |
entry.snapshot = Some(Snapshot::new(el.html_element_in_html_document())); |
393 |
} |
394 |
- let mut snapshot = entry.snapshot.as_mut().unwrap(); |
395 |
+ let snapshot = entry.snapshot.as_mut().unwrap(); |
396 |
if snapshot.state.is_none() { |
397 |
snapshot.state = Some(el.state()); |
398 |
} |
399 |
@@ -2426,7 +2426,7 @@ impl Document { |
400 |
entry.hint.insert(RESTYLE_SELF); |
401 |
} |
402 |
|
403 |
- let mut snapshot = entry.snapshot.as_mut().unwrap(); |
404 |
+ let snapshot = entry.snapshot.as_mut().unwrap(); |
405 |
if attr.local_name() == &local_name!("id") { |
406 |
snapshot.id_changed = true; |
407 |
} else if attr.local_name() == &local_name!("class") { |
408 |
@@ -4028,7 +4028,7 @@ impl PendingInOrderScriptVec { |
409 |
|
410 |
fn loaded(&self, element: &HTMLScriptElement, result: ScriptResult) { |
411 |
let mut scripts = self.scripts.borrow_mut(); |
412 |
- let mut entry = scripts.iter_mut().find(|entry| &*entry.element == element).unwrap(); |
413 |
+ let entry = scripts.iter_mut().find(|entry| &*entry.element == element).unwrap(); |
414 |
entry.loaded(result); |
415 |
} |
416 |
|
417 |
diff --git servo/components/script/dom/medialist.rs servo/components/script/dom/medialist.rs |
418 |
index 0064d0445095..ae20f5aa0422 100644 |
419 |
--- servo/components/script/dom/medialist.rs |
420 |
+++ servo/components/script/dom/medialist.rs |
421 |
@@ -63,7 +63,7 @@ impl MediaListMethods for MediaList { |
422 |
// https://drafts.csswg.org/cssom/#dom-medialist-mediatext |
423 |
fn SetMediaText(&self, value: DOMString) { |
424 |
let mut guard = self.shared_lock().write(); |
425 |
- let mut media_queries = self.media_queries.write_with(&mut guard); |
426 |
+ let media_queries = self.media_queries.write_with(&mut guard); |
427 |
// Step 2 |
428 |
if value.is_empty() { |
429 |
// Step 1 |
430 |
@@ -154,7 +154,7 @@ impl MediaListMethods for MediaList { |
431 |
// Step 3 |
432 |
let m_serialized = m.unwrap().to_css_string(); |
433 |
let mut guard = self.shared_lock().write(); |
434 |
- let mut media_list = self.media_queries.write_with(&mut guard); |
435 |
+ let media_list = self.media_queries.write_with(&mut guard); |
436 |
let new_vec = media_list.media_queries.drain(..) |
437 |
.filter(|q| m_serialized != q.to_css_string()) |
438 |
.collect(); |
439 |
diff --git servo/components/script/dom/range.rs servo/components/script/dom/range.rs |
440 |
index fa849a0fc1a2..1e65caedc9dd 100644 |
441 |
--- servo/components/script/dom/range.rs |
442 |
+++ servo/components/script/dom/range.rs |
443 |
@@ -1049,7 +1049,7 @@ impl WeakRangeVec { |
444 |
let offset = context.index(); |
445 |
let parent = context.parent; |
446 |
unsafe { |
447 |
- let mut ranges = &mut *self.cell.get(); |
448 |
+ let ranges = &mut *self.cell.get(); |
449 |
|
450 |
ranges.update(|entry| { |
451 |
let range = entry.root().unwrap(); |
452 |
@@ -1076,7 +1076,7 @@ impl WeakRangeVec { |
453 |
} |
454 |
|
455 |
unsafe { |
456 |
- let mut ranges = &mut *self.cell.get(); |
457 |
+ let ranges = &mut *self.cell.get(); |
458 |
|
459 |
ranges.update(|entry| { |
460 |
let range = entry.root().unwrap(); |
461 |
diff --git servo/components/script/dom/servoparser/async_html.rs servo/components/script/dom/servoparser/async_html.rs |
462 |
index 59411fda1c73..70d2008f49f6 100644 |
463 |
--- servo/components/script/dom/servoparser/async_html.rs |
464 |
+++ servo/components/script/dom/servoparser/async_html.rs |
465 |
@@ -568,7 +568,7 @@ impl TreeSink for Sink { |
466 |
} |
467 |
let node = self.new_parse_node(); |
468 |
{ |
469 |
- let mut data = self.get_parse_node_data_mut(&target.id); |
470 |
+ let data = self.get_parse_node_data_mut(&target.id); |
471 |
data.contents = Some(node.clone()); |
472 |
} |
473 |
self.send_op(ParseOperation::GetTemplateContents { target: target.id, contents: node.id }); |
474 |
@@ -596,7 +596,7 @@ impl TreeSink for Sink { |
475 |
let mut node = self.new_parse_node(); |
476 |
node.qual_name = Some(name.clone()); |
477 |
{ |
478 |
- let mut node_data = self.get_parse_node_data_mut(&node.id); |
479 |
+ let node_data = self.get_parse_node_data_mut(&node.id); |
480 |
node_data.is_integration_point = html_attrs.iter() |
481 |
.any(|attr| { |
482 |
let attr_value = &String::from(attr.value.clone()); |
483 |
diff --git servo/components/script/dom/url.rs servo/components/script/dom/url.rs |
484 |
index a02a735638fc..41de4dcc0c72 100644 |
485 |
--- servo/components/script/dom/url.rs |
486 |
+++ servo/components/script/dom/url.rs |
487 |
@@ -96,8 +96,8 @@ impl URL { |
488 |
|
489 |
// https://w3c.github.io/FileAPI/#dfn-createObjectURL |
490 |
pub fn CreateObjectURL(global: &GlobalScope, blob: &Blob) -> DOMString { |
491 |
- /// XXX: Second field is an unicode-serialized Origin, it is a temporary workaround |
492 |
- /// and should not be trusted. See issue https://github.com/servo/servo/issues/11722 |
493 |
+ // XXX: Second field is an unicode-serialized Origin, it is a temporary workaround |
494 |
+ // and should not be trusted. See issue https://github.com/servo/servo/issues/11722 |
495 |
let origin = get_blob_origin(&global.get_url()); |
496 |
|
497 |
let id = blob.get_blob_url_id(); |
498 |
diff --git servo/components/script/dom/vrdisplay.rs servo/components/script/dom/vrdisplay.rs |
499 |
index 3f73a577fad7..54f06fb928f2 100644 |
500 |
--- servo/components/script/dom/vrdisplay.rs |
501 |
+++ servo/components/script/dom/vrdisplay.rs |
502 |
@@ -268,7 +268,7 @@ impl VRDisplayMethods for VRDisplay { |
503 |
fn CancelAnimationFrame(&self, handle: u32) { |
504 |
if self.presenting.get() { |
505 |
let mut list = self.raf_callback_list.borrow_mut(); |
506 |
- if let Some(mut pair) = list.iter_mut().find(|pair| pair.0 == handle) { |
507 |
+ if let Some(pair) = list.iter_mut().find(|pair| pair.0 == handle) { |
508 |
pair.1 = None; |
509 |
} |
510 |
} else { |
511 |
diff --git servo/components/script/dom/webglrenderingcontext.rs servo/components/script/dom/webglrenderingcontext.rs |
512 |
index 73d4ddba1b90..62c92b42785c 100644 |
513 |
--- servo/components/script/dom/webglrenderingcontext.rs |
514 |
+++ servo/components/script/dom/webglrenderingcontext.rs |
515 |
@@ -2434,7 +2434,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { |
516 |
} |
517 |
|
518 |
typedarray!(in(cx) let mut pixels_data: ArrayBufferView = pixels); |
519 |
- let (array_type, mut data) = match { pixels_data.as_mut() } { |
520 |
+ let (array_type, data) = match { pixels_data.as_mut() } { |
521 |
Ok(data) => (data.get_array_type(), data.as_mut_slice()), |
522 |
Err(_) => return Err(Error::Type("Not an ArrayBufferView".to_owned())), |
523 |
}; |
524 |
diff --git servo/components/script/dom/xmlhttprequest.rs servo/components/script/dom/xmlhttprequest.rs |
525 |
index 6ed2dda1851f..e6652d79d706 100644 |
526 |
--- servo/components/script/dom/xmlhttprequest.rs |
527 |
+++ servo/components/script/dom/xmlhttprequest.rs |
528 |
@@ -627,7 +627,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest { |
529 |
|
530 |
if !content_type_set { |
531 |
let ct = request.headers.get_mut::<ContentType>(); |
532 |
- if let Some(mut ct) = ct { |
533 |
+ if let Some(ct) = ct { |
534 |
if let Some(encoding) = encoding { |
535 |
for param in &mut (ct.0).2 { |
536 |
if param.0 == MimeAttr::Charset { |
537 |
diff --git servo/components/script/lib.rs servo/components/script/lib.rs |
538 |
index e1a1ab592cb7..5824d6f2e490 100644 |
539 |
--- servo/components/script/lib.rs |
540 |
+++ servo/components/script/lib.rs |
541 |
@@ -9,7 +9,6 @@ |
542 |
#![feature(mpsc_select)] |
543 |
#![feature(nonzero)] |
544 |
#![feature(on_unimplemented)] |
545 |
-#![feature(option_entry)] |
546 |
#![feature(plugin)] |
547 |
#![feature(proc_macro)] |
548 |
#![feature(stmt_expr_attributes)] |
549 |
diff --git servo/components/script_plugins/unrooted_must_root.rs servo/components/script_plugins/unrooted_must_root.rs |
550 |
index 5dbd2b1a3bdd..f3f5e60ab62a 100644 |
551 |
--- servo/components/script_plugins/unrooted_must_root.rs |
552 |
+++ servo/components/script_plugins/unrooted_must_root.rs |
553 |
@@ -182,7 +182,7 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> { |
554 |
} |
555 |
|
556 |
match expr.node { |
557 |
- /// Trait casts from #[must_root] types are not allowed |
558 |
+ // Trait casts from #[must_root] types are not allowed |
559 |
hir::ExprCast(ref subexpr, _) => require_rooted(cx, self.in_new_function, &*subexpr), |
560 |
// This catches assignments... the main point of this would be to catch mutable |
561 |
// references to `JS<T>`. |
562 |
@@ -206,13 +206,21 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> { |
563 |
fn visit_pat(&mut self, pat: &'tcx hir::Pat) { |
564 |
let cx = self.cx; |
565 |
|
566 |
- if let hir::PatKind::Binding(hir::BindingMode::BindByValue(_), _, _, _) = pat.node { |
567 |
- let ty = cx.tables.pat_ty(pat); |
568 |
- if is_unrooted_ty(cx, ty, self.in_new_function) { |
569 |
- cx.span_lint(UNROOTED_MUST_ROOT, |
570 |
- pat.span, |
571 |
- &format!("Expression of type {:?} must be rooted", ty)) |
572 |
+ // We want to detect pattern bindings that move a value onto the stack. |
573 |
+ // When "default binding modes" https://github.com/rust-lang/rust/issues/42640 |
574 |
+ // are implemented, the `Unannotated` case could cause false-positives. |
575 |
+ // These should be fixable by adding an explicit `ref`. |
576 |
+ match pat.node { |
577 |
+ hir::PatKind::Binding(hir::BindingAnnotation::Unannotated, _, _, _) | |
578 |
+ hir::PatKind::Binding(hir::BindingAnnotation::Mutable, _, _, _) => { |
579 |
+ let ty = cx.tables.pat_ty(pat); |
580 |
+ if is_unrooted_ty(cx, ty, self.in_new_function) { |
581 |
+ cx.span_lint(UNROOTED_MUST_ROOT, |
582 |
+ pat.span, |
583 |
+ &format!("Expression of type {:?} must be rooted", ty)) |
584 |
+ } |
585 |
} |
586 |
+ _ => {} |
587 |
} |
588 |
|
589 |
visit::walk_pat(self, pat); |
590 |
diff --git servo/components/selectors/matching.rs servo/components/selectors/matching.rs |
591 |
index 7bd9814d26fb..8f6b2fa6aa54 100644 |
592 |
--- servo/components/selectors/matching.rs |
593 |
+++ servo/components/selectors/matching.rs |
594 |
@@ -458,7 +458,7 @@ where |
595 |
/// Matches a complex selector. |
596 |
pub fn matches_complex_selector<E, F>(mut iter: SelectorIter<E::Impl>, |
597 |
element: &E, |
598 |
- mut context: &mut LocalMatchingContext<E::Impl>, |
599 |
+ context: &mut LocalMatchingContext<E::Impl>, |
600 |
flags_setter: &mut F) |
601 |
-> bool |
602 |
where E: Element, |
603 |
diff --git servo/components/selectors/parser.rs servo/components/selectors/parser.rs |
604 |
index 490399ce38ce..6b2c1f2b4e86 100644 |
605 |
--- servo/components/selectors/parser.rs |
606 |
+++ servo/components/selectors/parser.rs |
607 |
@@ -1464,7 +1464,7 @@ fn parse_negation<'i, 't, P, E, Impl>(parser: &P, |
608 |
fn parse_compound_selector<'i, 't, P, E, Impl>( |
609 |
parser: &P, |
610 |
input: &mut CssParser<'i, 't>, |
611 |
- mut builder: &mut SelectorBuilder<Impl>) |
612 |
+ builder: &mut SelectorBuilder<Impl>) |
613 |
-> Result<bool, ParseError<'i, SelectorParseError<'i, E>>> |
614 |
where P: Parser<'i, Impl=Impl, Error=E>, Impl: SelectorImpl |
615 |
{ |
616 |
diff --git servo/components/style/invalidation/element/invalidator.rs servo/components/style/invalidation/element/invalidator.rs |
617 |
index 848c5cd13dc8..b8510ba3169b 100644 |
618 |
--- servo/components/style/invalidation/element/invalidator.rs |
619 |
+++ servo/components/style/invalidation/element/invalidator.rs |
620 |
@@ -154,7 +154,7 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E> |
621 |
trace!(" > visitedness change, force subtree restyle"); |
622 |
// We can't just return here because there may also be attribute |
623 |
// changes as well that imply additional hints. |
624 |
- let mut data = self.data.as_mut().unwrap(); |
625 |
+ let data = self.data.as_mut().unwrap(); |
626 |
data.restyle.hint.insert(RestyleHint::restyle_subtree()); |
627 |
} |
628 |
|
629 |
diff --git servo/components/style/matching.rs servo/components/style/matching.rs |
630 |
index b62bc54bf768..f58d7cd123e6 100644 |
631 |
--- servo/components/style/matching.rs |
632 |
+++ servo/components/style/matching.rs |
633 |
@@ -440,7 +440,7 @@ pub trait MatchMethods : TElement { |
634 |
fn finish_restyle( |
635 |
&self, |
636 |
context: &mut StyleContext<Self>, |
637 |
- mut data: &mut ElementData, |
638 |
+ data: &mut ElementData, |
639 |
mut new_styles: ElementStyles, |
640 |
important_rules_changed: bool, |
641 |
) -> ChildCascadeRequirement { |
642 |
diff --git servo/components/style/properties/properties.mako.rs servo/components/style/properties/properties.mako.rs |
643 |
index d98e173db5ba..81ff00fb6d5e 100644 |
644 |
--- servo/components/style/properties/properties.mako.rs |
645 |
+++ servo/components/style/properties/properties.mako.rs |
646 |
@@ -3364,7 +3364,7 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc<ComputedValues>, |
647 |
return; |
648 |
} |
649 |
} |
650 |
- let mut style = Arc::make_mut(style); |
651 |
+ let style = Arc::make_mut(style); |
652 |
let border = Arc::make_mut(&mut style.border); |
653 |
match side { |
654 |
PhysicalSide::Left => { |
655 |
diff --git servo/components/style/style_adjuster.rs servo/components/style/style_adjuster.rs |
656 |
index 366641ebe0bc..6e51fa74072a 100644 |
657 |
--- servo/components/style/style_adjuster.rs |
658 |
+++ servo/components/style/style_adjuster.rs |
659 |
@@ -269,7 +269,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { |
660 |
|
661 |
if overflow_x != original_overflow_x || |
662 |
overflow_y != original_overflow_y { |
663 |
- let mut box_style = self.style.mutate_box(); |
664 |
+ let box_style = self.style.mutate_box(); |
665 |
box_style.set_overflow_x(overflow_x); |
666 |
box_style.set_overflow_y(overflow_y); |
667 |
} |
668 |
diff --git servo/components/style/style_resolver.rs servo/components/style/style_resolver.rs |
669 |
index cf512c4fbdd2..3fc1d57cc8f7 100644 |
670 |
--- servo/components/style/style_resolver.rs |
671 |
+++ servo/components/style/style_resolver.rs |
672 |
@@ -247,7 +247,7 @@ where |
673 |
Some(&*primary_style.style) |
674 |
}; |
675 |
|
676 |
- for (i, mut inputs) in pseudo_array.iter_mut().enumerate() { |
677 |
+ for (i, inputs) in pseudo_array.iter_mut().enumerate() { |
678 |
if let Some(inputs) = inputs.take() { |
679 |
let pseudo = PseudoElement::from_eager_index(i); |
680 |
pseudo_styles.set( |
681 |
diff --git servo/components/style/stylesheets/rule_list.rs servo/components/style/stylesheets/rule_list.rs |
682 |
index 82e78015400d..14b3dc5e7696 100644 |
683 |
--- servo/components/style/stylesheets/rule_list.rs |
684 |
+++ servo/components/style/stylesheets/rule_list.rs |
685 |
@@ -150,7 +150,7 @@ impl CssRulesHelpers for RawOffsetArc<Locked<CssRules>> { |
686 |
|
687 |
{ |
688 |
let mut write_guard = lock.write(); |
689 |
- let mut rules = self.write_with(&mut write_guard); |
690 |
+ let rules = self.write_with(&mut write_guard); |
691 |
// Step 5 |
692 |
// Computes the maximum allowed parser state at a given index. |
693 |
let rev_state = rules.0.get(index).map_or(State::Body, CssRule::rule_state); |
694 |
diff --git servo/components/style/stylesheets/rule_parser.rs servo/components/style/stylesheets/rule_parser.rs |
695 |
index 007d7e11026e..f0d224e498a7 100644 |
696 |
--- servo/components/style/stylesheets/rule_parser.rs |
697 |
+++ servo/components/style/stylesheets/rule_parser.rs |
698 |
@@ -209,7 +209,7 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> { |
699 |
let id = register_namespace(&url) |
700 |
.map_err(|()| StyleParseError::UnspecifiedError)?; |
701 |
|
702 |
- let mut namespaces = self.namespaces.as_mut().unwrap(); |
703 |
+ let namespaces = self.namespaces.as_mut().unwrap(); |
704 |
|
705 |
let opt_prefix = if let Ok(prefix) = prefix_result { |
706 |
let prefix = Prefix::from(prefix.as_ref()); |
707 |
diff --git servo/components/style/stylesheets/rules_iterator.rs servo/components/style/stylesheets/rules_iterator.rs |
708 |
index 95a3ab8b3885..65e1b637ae52 100644 |
709 |
--- servo/components/style/stylesheets/rules_iterator.rs |
710 |
+++ servo/components/style/stylesheets/rules_iterator.rs |
711 |
@@ -70,7 +70,7 @@ impl<'a, 'b, C> Iterator for RulesIterator<'a, 'b, C> |
712 |
|
713 |
let rule; |
714 |
let sub_iter = { |
715 |
- let mut nested_iter = self.stack.last_mut().unwrap(); |
716 |
+ let nested_iter = self.stack.last_mut().unwrap(); |
717 |
rule = match nested_iter.next() { |
718 |
Some(r) => r, |
719 |
None => { |
720 |
diff --git servo/components/webdriver_server/lib.rs servo/components/webdriver_server/lib.rs |
721 |
index bd2f667f9892..28a4885f0d41 100644 |
722 |
--- servo/components/webdriver_server/lib.rs |
723 |
+++ servo/components/webdriver_server/lib.rs |
724 |
@@ -702,7 +702,7 @@ impl Handler { |
725 |
fn handle_set_timeouts(&mut self, |
726 |
parameters: &TimeoutsParameters) |
727 |
-> WebDriverResult<WebDriverResponse> { |
728 |
- let mut session = self.session |
729 |
+ let session = self.session |
730 |
.as_mut() |
731 |
.ok_or(WebDriverError::new(ErrorStatus::SessionNotCreated, ""))?; |
732 |
|
733 |
diff --git servo/rust-commit-hash servo/rust-commit-hash |
734 |
index d4f08fe97644..a08d23cd1a71 100644 |
735 |
--- servo/rust-commit-hash |
736 |
+++ servo/rust-commit-hash |
737 |
@@ -1 +1 @@ |
738 |
-599be0d18f4c6ddf36366d2a5a2ca6dc65886896 |
739 |
+13d94d5fa8129a34f5c77a1bcd76983f5aed2434 |
740 |
diff --git servo/tests/unit/style/stylist.rs servo/tests/unit/style/stylist.rs |
741 |
index da9a9478957a..52067b501788 100644 |
742 |
--- servo/tests/unit/style/stylist.rs |
743 |
+++ servo/tests/unit/style/stylist.rs |
744 |
@@ -51,19 +51,6 @@ fn get_mock_rules(css_selectors: &[&str]) -> (Vec<Vec<Rule>>, SharedRwLock) { |
745 |
}).collect(), shared_lock) |
746 |
} |
747 |
|
748 |
-fn get_mock_map(selectors: &[&str]) -> (SelectorMap<Rule>, SharedRwLock) { |
749 |
- let mut map = SelectorMap::<Rule>::new(); |
750 |
- let (selector_rules, shared_lock) = get_mock_rules(selectors); |
751 |
- |
752 |
- for rules in selector_rules.into_iter() { |
753 |
- for rule in rules.into_iter() { |
754 |
- map.insert(rule, QuirksMode::NoQuirks) |
755 |
- } |
756 |
- } |
757 |
- |
758 |
- (map, shared_lock) |
759 |
-} |
760 |
- |
761 |
fn parse_selectors(selectors: &[&str]) -> Vec<Selector<SelectorImpl>> { |
762 |
selectors.iter() |
763 |
.map(|x| SelectorParser::parse_author_origin_no_namespace(x).unwrap().0 |