Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/body/lower.rs')
-rw-r--r--crates/hir-def/src/body/lower.rs32
1 files changed, 15 insertions, 17 deletions
diff --git a/crates/hir-def/src/body/lower.rs b/crates/hir-def/src/body/lower.rs
index b375ec63a6..152c02743f 100644
--- a/crates/hir-def/src/body/lower.rs
+++ b/crates/hir-def/src/body/lower.rs
@@ -297,11 +297,11 @@ impl ExprCollector<'_> {
let (result_expr_id, prev_binding_owner) =
this.initialize_binding_owner(syntax_ptr);
let inner_expr = this.collect_block(e);
- let x = this.db.intern_anonymous_const(ConstBlockLoc {
+ let it = this.db.intern_anonymous_const(ConstBlockLoc {
parent: this.owner,
root: inner_expr,
});
- this.body.exprs[result_expr_id] = Expr::Const(x);
+ this.body.exprs[result_expr_id] = Expr::Const(it);
this.current_binding_owner = prev_binding_owner;
result_expr_id
})
@@ -324,10 +324,10 @@ impl ExprCollector<'_> {
ast::Expr::CallExpr(e) => {
let is_rustc_box = {
let attrs = e.attrs();
- attrs.filter_map(|x| x.as_simple_atom()).any(|x| x == "rustc_box")
+ attrs.filter_map(|it| it.as_simple_atom()).any(|it| it == "rustc_box")
};
if is_rustc_box {
- let expr = self.collect_expr_opt(e.arg_list().and_then(|x| x.args().next()));
+ let expr = self.collect_expr_opt(e.arg_list().and_then(|it| it.args().next()));
self.alloc_expr(Expr::Box { expr }, syntax_ptr)
} else {
let callee = self.collect_expr_opt(e.expr());
@@ -781,7 +781,7 @@ impl ExprCollector<'_> {
pat: self.alloc_pat_desugared(some_pat),
guard: None,
expr: self.with_opt_labeled_rib(label, |this| {
- this.collect_expr_opt(e.loop_body().map(|x| x.into()))
+ this.collect_expr_opt(e.loop_body().map(|it| it.into()))
}),
};
let iter_name = Name::generate_new_name();
@@ -874,10 +874,10 @@ impl ExprCollector<'_> {
}),
guard: None,
expr: {
- let x = self.alloc_expr(Expr::Path(Path::from(break_name)), syntax_ptr.clone());
+ let it = self.alloc_expr(Expr::Path(Path::from(break_name)), syntax_ptr.clone());
let callee = self.alloc_expr(Expr::Path(try_from_residual), syntax_ptr.clone());
let result = self.alloc_expr(
- Expr::Call { callee, args: Box::new([x]), is_assignee_expr: false },
+ Expr::Call { callee, args: Box::new([it]), is_assignee_expr: false },
syntax_ptr.clone(),
);
self.alloc_expr(
@@ -1240,12 +1240,12 @@ impl ExprCollector<'_> {
pats.push(self.collect_pat(first, binding_list));
binding_list.reject_new = true;
for rest in it {
- for (_, x) in binding_list.is_used.iter_mut() {
- *x = false;
+ for (_, it) in binding_list.is_used.iter_mut() {
+ *it = false;
}
pats.push(self.collect_pat(rest, binding_list));
- for (&id, &x) in binding_list.is_used.iter() {
- if !x {
+ for (&id, &is_used) in binding_list.is_used.iter() {
+ if !is_used {
self.body.bindings[id].problems =
Some(BindingProblems::NotBoundAcrossAll);
}
@@ -1352,9 +1352,9 @@ impl ExprCollector<'_> {
// FIXME: implement in a way that also builds source map and calculates assoc resolutions in type inference.
ast::Pat::RangePat(p) => {
let mut range_part_lower = |p: Option<ast::Pat>| {
- p.and_then(|x| match &x {
- ast::Pat::LiteralPat(x) => {
- Some(Box::new(LiteralOrConst::Literal(pat_literal_to_hir(x)?.0)))
+ p.and_then(|it| match &it {
+ ast::Pat::LiteralPat(it) => {
+ Some(Box::new(LiteralOrConst::Literal(pat_literal_to_hir(it)?.0)))
}
ast::Pat::IdentPat(p) => {
let name =
@@ -1451,9 +1451,7 @@ impl ExprCollector<'_> {
&self,
lifetime: Option<ast::Lifetime>,
) -> Result<Option<LabelId>, BodyDiagnostic> {
- let Some(lifetime) = lifetime else {
- return Ok(None)
- };
+ let Some(lifetime) = lifetime else { return Ok(None) };
let name = Name::new_lifetime(&lifetime);
for (rib_idx, rib) in self.label_ribs.iter().enumerate().rev() {