Skip to content

Commit 3225d19

Browse files
webbeefsagudev
andauthored
cargo: Bump rustc to 1.89 (servo#36818)
Update Rustc to 1.89. Reviewable by commit. Leftover work: - servo#37330 - servo#38777 --------- Signed-off-by: sagudev <[email protected]> Co-authored-by: sagudev <[email protected]>
1 parent 8587536 commit 3225d19

File tree

126 files changed

+407
-609
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+407
-609
lines changed

components/canvas/raqote_backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl Repetition {
135135
}
136136
}
137137

138-
pub fn source(pattern: &Pattern) -> raqote::Source {
138+
pub fn source(pattern: &Pattern) -> raqote::Source<'_> {
139139
match pattern {
140140
Pattern::Color(a, r, g, b) => raqote::Source::Solid(
141141
raqote::SolidSource::from_unpremultiplied_argb(*a, *r, *g, *b),

components/compositing/compositor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ impl IOCompositor {
13761376
}
13771377

13781378
/// Get the message receiver for this [`IOCompositor`].
1379-
pub fn receiver(&self) -> Ref<Receiver<CompositorMsg>> {
1379+
pub fn receiver(&self) -> Ref<'_, Receiver<CompositorMsg>> {
13801380
Ref::map(self.global.borrow(), |global| &global.compositor_receiver)
13811381
}
13821382

components/compositing/webview_renderer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl WebViewRenderer {
187187

188188
pub(crate) fn set_frame_tree(&mut self, frame_tree: &SendableFrameTree) {
189189
let pipeline_id = frame_tree.pipeline.id;
190-
let old_pipeline_id = std::mem::replace(&mut self.root_pipeline_id, Some(pipeline_id));
190+
let old_pipeline_id = self.root_pipeline_id.replace(pipeline_id);
191191

192192
if old_pipeline_id != self.root_pipeline_id {
193193
debug!(

components/constellation/constellation.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ where
10191019
fn fully_active_descendant_browsing_contexts_iter(
10201020
&self,
10211021
browsing_context_id: BrowsingContextId,
1022-
) -> FullyActiveBrowsingContextsIterator {
1022+
) -> FullyActiveBrowsingContextsIterator<'_> {
10231023
FullyActiveBrowsingContextsIterator {
10241024
stack: vec![browsing_context_id],
10251025
pipelines: &self.pipelines,
@@ -1031,15 +1031,15 @@ where
10311031
fn fully_active_browsing_contexts_iter(
10321032
&self,
10331033
webview_id: WebViewId,
1034-
) -> FullyActiveBrowsingContextsIterator {
1034+
) -> FullyActiveBrowsingContextsIterator<'_> {
10351035
self.fully_active_descendant_browsing_contexts_iter(BrowsingContextId::from(webview_id))
10361036
}
10371037

10381038
/// Get an iterator for the browsing contexts in a subtree.
10391039
fn all_descendant_browsing_contexts_iter(
10401040
&self,
10411041
browsing_context_id: BrowsingContextId,
1042-
) -> AllBrowsingContextsIterator {
1042+
) -> AllBrowsingContextsIterator<'_> {
10431043
AllBrowsingContextsIterator {
10441044
stack: vec![browsing_context_id],
10451045
pipelines: &self.pipelines,
@@ -1157,6 +1157,7 @@ where
11571157
/// Handles loading pages, navigation, and granting access to the compositor
11581158
#[servo_tracing::instrument(skip_all)]
11591159
fn handle_request(&mut self) {
1160+
#[allow(clippy::large_enum_variant)]
11601161
#[derive(Debug)]
11611162
enum Request {
11621163
PipelineNamespace(PipelineNamespaceRequest),
@@ -3174,16 +3175,16 @@ where
31743175
);
31753176
},
31763177
};
3177-
let is_parent_private = match self.browsing_contexts.get(&parent_browsing_context_id) {
3178+
3179+
match self.browsing_contexts.get(&parent_browsing_context_id) {
31783180
Some(ctx) => ctx.is_private,
31793181
None => {
31803182
return warn!(
31813183
"{}: Script loaded url in iframe {} in closed parent browsing context",
31823184
parent_browsing_context_id, browsing_context_id,
31833185
);
31843186
},
3185-
};
3186-
is_parent_private
3187+
}
31873188
};
31883189
let is_private = is_private || is_parent_private;
31893190

components/devtools/actors/inspector/page_style.rs

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -175,42 +175,41 @@ impl PageStyleActor {
175175

176176
// For each selector (plus an empty one that represents the style attribute)
177177
// get all of the rules associated with it.
178-
let entries =
179-
once(("".into(), usize::MAX))
180-
.chain(selectors)
181-
.filter_map(move |selector| {
182-
let rule = match node_actor.style_rules.borrow_mut().entry(selector) {
183-
Entry::Vacant(e) => {
184-
let name = registry.new_name("style-rule");
185-
let actor = StyleRuleActor::new(
186-
name.clone(),
187-
node_actor.name(),
188-
(!e.key().0.is_empty()).then_some(e.key().clone()),
189-
);
190-
let rule = actor.applied(registry)?;
191178

192-
registry.register_later(Box::new(actor));
193-
e.insert(name);
194-
rule
195-
},
196-
Entry::Occupied(e) => {
197-
let actor = registry.find::<StyleRuleActor>(e.get());
198-
actor.applied(registry)?
199-
},
200-
};
201-
if inherited.is_some() && rule.declarations.is_empty() {
202-
return None;
203-
}
179+
once(("".into(), usize::MAX))
180+
.chain(selectors)
181+
.filter_map(move |selector| {
182+
let rule = match node_actor.style_rules.borrow_mut().entry(selector) {
183+
Entry::Vacant(e) => {
184+
let name = registry.new_name("style-rule");
185+
let actor = StyleRuleActor::new(
186+
name.clone(),
187+
node_actor.name(),
188+
(!e.key().0.is_empty()).then_some(e.key().clone()),
189+
);
190+
let rule = actor.applied(registry)?;
204191

205-
Some(AppliedEntry {
206-
rule,
207-
// TODO: Handle pseudo elements
208-
pseudo_element: None,
209-
is_system: false,
210-
inherited: inherited.clone(),
211-
})
212-
});
213-
entries
192+
registry.register_later(Box::new(actor));
193+
e.insert(name);
194+
rule
195+
},
196+
Entry::Occupied(e) => {
197+
let actor = registry.find::<StyleRuleActor>(e.get());
198+
actor.applied(registry)?
199+
},
200+
};
201+
if inherited.is_some() && rule.declarations.is_empty() {
202+
return None;
203+
}
204+
205+
Some(AppliedEntry {
206+
rule,
207+
// TODO: Handle pseudo elements
208+
pseudo_element: None,
209+
is_system: false,
210+
inherited: inherited.clone(),
211+
})
212+
})
214213
})
215214
.collect();
216215
let msg = GetAppliedReply {

components/fonts/font_context.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl FontContext {
320320
font_key
321321
});
322322

323-
let key = *self
323+
*self
324324
.webrender_font_instance_keys
325325
.write()
326326
.entry((font_key, pt_size, variations.clone()))
@@ -334,8 +334,7 @@ impl FontContext {
334334
variations,
335335
);
336336
font_instance_key
337-
});
338-
key
337+
})
339338
}
340339

341340
fn invalidate_font_groups_after_web_font_load(&self) {

components/fonts/glyph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ impl GlyphStore {
606606
pub fn iter_glyphs_for_byte_range(
607607
&self,
608608
range: &Range<ByteIndex>,
609-
) -> impl Iterator<Item = GlyphInfo> + use<'_> {
609+
) -> impl Iterator<Item = GlyphInfo<'_>> + use<'_> {
610610
if range.begin() >= self.len() {
611611
panic!("iter_glyphs_for_range: range.begin beyond length!");
612612
}

components/hyper_serde/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@ impl Serialize for Ser<'_, HeaderMap> {
431431
{
432432
let mut serializer = serializer.serialize_seq(Some(self.0.len()))?;
433433
for v in self.0 {
434+
#[allow(
435+
clippy::collapsible_if,
436+
reason = "let chains are not available in 1.85"
437+
)]
434438
if self.1 {
435439
if let Ok(v) = str::from_utf8(v) {
436440
serializer.serialize_element(v)?;

components/layout/flexbox/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ impl FlexContainer {
10011001
}
10021002

10031003
#[inline]
1004-
pub(crate) fn layout_style(&self) -> LayoutStyle {
1004+
pub(crate) fn layout_style(&self) -> LayoutStyle<'_> {
10051005
LayoutStyle::Default(&self.style)
10061006
}
10071007
}
@@ -2046,7 +2046,7 @@ impl FlexItemBox {
20462046
content_box_sizes_and_pbm: &ContentBoxSizesAndPBM,
20472047
config: &FlexContainerConfig,
20482048
flex_context_getter: &impl Fn() -> &'a FlexContext<'a>,
2049-
) -> FlexItem {
2049+
) -> FlexItem<'_> {
20502050
let flex_axis = config.flex_axis;
20512051
let style = self.style();
20522052
let cross_axis_is_item_block_axis = cross_axis_is_item_block_axis(

components/layout/flexbox/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ impl FlexContainer {
151151
}
152152
}
153153

154+
#[allow(clippy::large_enum_variant)]
154155
#[derive(Debug, MallocSizeOf)]
155156
pub(crate) enum FlexLevelBox {
156157
FlexItem(FlexItemBox),

0 commit comments

Comments
 (0)