mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
cargo clippy --fix
This commit is contained in:
parent
1ab8c7fd27
commit
fad4fa163c
178 changed files with 595 additions and 738 deletions
|
@ -276,7 +276,7 @@ impl InferenceContext<'_> {
|
|||
|
||||
// Now go through the argument patterns
|
||||
for (arg_pat, arg_ty) in args.iter().zip(&sig_tys) {
|
||||
self.infer_top_pat(*arg_pat, &arg_ty);
|
||||
self.infer_top_pat(*arg_pat, arg_ty);
|
||||
}
|
||||
|
||||
// FIXME: lift these out into a struct
|
||||
|
@ -1081,8 +1081,7 @@ impl InferenceContext<'_> {
|
|||
let inner_exp = expected
|
||||
.to_option(table)
|
||||
.as_ref()
|
||||
.map(|e| e.as_adt())
|
||||
.flatten()
|
||||
.and_then(|e| e.as_adt())
|
||||
.filter(|(e_adt, _)| e_adt == &box_id)
|
||||
.map(|(_, subts)| {
|
||||
let g = subts.at(Interner, 0);
|
||||
|
@ -1320,7 +1319,7 @@ impl InferenceContext<'_> {
|
|||
.unwrap_or_else(|| this.table.new_type_var());
|
||||
|
||||
let ty = if let Some(expr) = initializer {
|
||||
let ty = if contains_explicit_ref_binding(&this.body, *pat) {
|
||||
let ty = if contains_explicit_ref_binding(this.body, *pat) {
|
||||
this.infer_expr(*expr, &Expectation::has_type(decl_ty.clone()))
|
||||
} else {
|
||||
this.infer_expr_coerce(
|
||||
|
@ -1716,7 +1715,7 @@ impl InferenceContext<'_> {
|
|||
// that we have more information about the types of arguments when we
|
||||
// type-check the functions. This isn't really the right way to do this.
|
||||
for check_closures in [false, true] {
|
||||
let mut skip_indices = skip_indices.into_iter().copied().fuse().peekable();
|
||||
let mut skip_indices = skip_indices.iter().copied().fuse().peekable();
|
||||
let param_iter = param_tys.iter().cloned().chain(repeat(self.err_ty()));
|
||||
let expected_iter = expected_inputs
|
||||
.iter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue