mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-07 12:48:30 +00:00
Rollup merge of #82236 - matthiaskrgr:useless_conv, r=jyn514
avoid converting types into themselves (clippy::useless_conversion)
This commit is contained in:
commit
04df75a429
@ -513,7 +513,7 @@ impl<'a> Parser<'a> {
|
|||||||
token::Ident(..) if this.is_mistaken_not_ident_negation() => {
|
token::Ident(..) if this.is_mistaken_not_ident_negation() => {
|
||||||
make_it!(this, attrs, |this, _| this.recover_not_expr(lo))
|
make_it!(this, attrs, |this, _| this.recover_not_expr(lo))
|
||||||
}
|
}
|
||||||
_ => return this.parse_dot_or_call_expr(Some(attrs.into())),
|
_ => return this.parse_dot_or_call_expr(Some(attrs)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ impl<'a> Parser<'a> {
|
|||||||
self.mk_stmt(lo, StmtKind::Empty)
|
self.mk_stmt(lo, StmtKind::Empty)
|
||||||
} else if self.token != token::CloseDelim(token::Brace) {
|
} else if self.token != token::CloseDelim(token::Brace) {
|
||||||
// Remainder are line-expr stmts.
|
// Remainder are line-expr stmts.
|
||||||
let e = self.parse_expr_res(Restrictions::STMT_EXPR, Some(attrs.into()))?;
|
let e = self.parse_expr_res(Restrictions::STMT_EXPR, Some(attrs))?;
|
||||||
self.mk_stmt(lo.to(e.span), StmtKind::Expr(e))
|
self.mk_stmt(lo.to(e.span), StmtKind::Expr(e))
|
||||||
} else {
|
} else {
|
||||||
self.error_outer_attrs(&attrs.take_for_recovery());
|
self.error_outer_attrs(&attrs.take_for_recovery());
|
||||||
@ -131,7 +131,7 @@ impl<'a> Parser<'a> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let expr = this.with_res(Restrictions::STMT_EXPR, |this| {
|
let expr = this.with_res(Restrictions::STMT_EXPR, |this| {
|
||||||
let expr = this.parse_dot_or_call_expr_with(expr, lo, attrs.into())?;
|
let expr = this.parse_dot_or_call_expr_with(expr, lo, attrs)?;
|
||||||
this.parse_assoc_expr_with(0, LhsExpr::AlreadyParsed(expr))
|
this.parse_assoc_expr_with(0, LhsExpr::AlreadyParsed(expr))
|
||||||
})?;
|
})?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -213,7 +213,7 @@ impl<'a> Parser<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn recover_local_after_let(&mut self, lo: Span, attrs: AttrVec) -> PResult<'a, Stmt> {
|
fn recover_local_after_let(&mut self, lo: Span, attrs: AttrVec) -> PResult<'a, Stmt> {
|
||||||
let local = self.parse_local(attrs.into())?;
|
let local = self.parse_local(attrs)?;
|
||||||
Ok(self.mk_stmt(lo.to(self.prev_token.span), StmtKind::Local(local)))
|
Ok(self.mk_stmt(lo.to(self.prev_token.span), StmtKind::Local(local)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1468,7 +1468,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||||||
}),
|
}),
|
||||||
assoc_name,
|
assoc_name,
|
||||||
)
|
)
|
||||||
.into_iter()
|
|
||||||
},
|
},
|
||||||
|| param_name.to_string(),
|
|| param_name.to_string(),
|
||||||
assoc_name,
|
assoc_name,
|
||||||
|
@ -53,7 +53,7 @@ fn install_sh(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn default_path(config: &Option<PathBuf>, default: &str) -> PathBuf {
|
fn default_path(config: &Option<PathBuf>, default: &str) -> PathBuf {
|
||||||
PathBuf::from(config.as_ref().cloned().unwrap_or_else(|| PathBuf::from(default)))
|
config.as_ref().cloned().unwrap_or_else(|| PathBuf::from(default))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prepare_dir(mut path: PathBuf) -> String {
|
fn prepare_dir(mut path: PathBuf) -> String {
|
||||||
|
@ -161,7 +161,7 @@ impl<'tcx> DocContext<'tcx> {
|
|||||||
}
|
}
|
||||||
Entry::Occupied(e) => e.into_mut(),
|
Entry::Occupied(e) => e.into_mut(),
|
||||||
};
|
};
|
||||||
*def_index = DefIndex::from(*def_index + 1);
|
*def_index = *def_index + 1;
|
||||||
|
|
||||||
DefId { krate: crate_num, index: *def_index }
|
DefId { krate: crate_num, index: *def_index }
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ fn from_clean_item_kind(item: clean::ItemKind, tcx: TyCtxt<'_>) -> ItemEnum {
|
|||||||
bounds: g.into_iter().map(Into::into).collect(),
|
bounds: g.into_iter().map(Into::into).collect(),
|
||||||
default: t.map(Into::into),
|
default: t.map(Into::into),
|
||||||
},
|
},
|
||||||
StrippedItem(inner) => from_clean_item_kind(*inner, tcx).into(),
|
StrippedItem(inner) => from_clean_item_kind(*inner, tcx),
|
||||||
PrimitiveItem(_) | KeywordItem(_) => {
|
PrimitiveItem(_) | KeywordItem(_) => {
|
||||||
panic!("{:?} is not supported for JSON output", item)
|
panic!("{:?} is not supported for JSON output", item)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user