fix clippy::{filter_map_identiy, map_identity, manual_flatten}
This commit is contained in:
parent
2816486986
commit
d666f6bf22
3 changed files with 14 additions and 18 deletions
|
@ -164,24 +164,20 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
{
|
{
|
||||||
for param in
|
for param in
|
||||||
[param_to_point_at, fallback_param_to_point_at, self_param_to_point_at]
|
[param_to_point_at, fallback_param_to_point_at, self_param_to_point_at]
|
||||||
|
.into_iter()
|
||||||
|
.flatten()
|
||||||
{
|
{
|
||||||
if let Some(param) = param {
|
let refined_expr =
|
||||||
let refined_expr = self.point_at_field_if_possible(
|
self.point_at_field_if_possible(def_id, param, variant_def_id, fields);
|
||||||
def_id,
|
|
||||||
param,
|
|
||||||
variant_def_id,
|
|
||||||
fields,
|
|
||||||
);
|
|
||||||
|
|
||||||
match refined_expr {
|
match refined_expr {
|
||||||
None => {}
|
None => {}
|
||||||
Some((refined_expr, _)) => {
|
Some((refined_expr, _)) => {
|
||||||
error.obligation.cause.span = refined_expr
|
error.obligation.cause.span = refined_expr
|
||||||
.span
|
.span
|
||||||
.find_ancestor_in_same_ctxt(error.obligation.cause.span)
|
.find_ancestor_in_same_ctxt(error.obligation.cause.span)
|
||||||
.unwrap_or(refined_expr.span);
|
.unwrap_or(refined_expr.span);
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ impl<'tcx> Partitioner<'tcx> for DefaultPartitioning {
|
||||||
}
|
}
|
||||||
|
|
||||||
PreInliningPartitioning {
|
PreInliningPartitioning {
|
||||||
codegen_units: codegen_units.into_values().map(|codegen_unit| codegen_unit).collect(),
|
codegen_units: codegen_units.into_values().collect(),
|
||||||
roots,
|
roots,
|
||||||
internalization_candidates,
|
internalization_candidates,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1349,7 +1349,7 @@ impl LinkCollector<'_, '_> {
|
||||||
if has_derive_trait_collision {
|
if has_derive_trait_collision {
|
||||||
candidates.macro_ns = None;
|
candidates.macro_ns = None;
|
||||||
}
|
}
|
||||||
candidates.into_iter().filter_map(|res| res).flatten().collect::<Vec<_>>()
|
candidates.into_iter().flatten().flatten().collect::<Vec<_>>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue