diff options
author | Kirill Bulatov <[email protected]> | 2020-02-18 12:53:02 +0000 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2020-02-18 14:03:08 +0000 |
commit | b8ddcb0652f3ec8683023afc1e1f5166d6a712f4 (patch) | |
tree | ea95a1e2083280d84e99f274e5b2b8b269545297 /crates/ra_hir_ty/src/traits | |
parent | eab80cd961919b9321e1d34343ae3f3adb0502e5 (diff) |
Run cargo +nightly fix --clippy -Z unstable-options
Diffstat (limited to 'crates/ra_hir_ty/src/traits')
-rw-r--r-- | crates/ra_hir_ty/src/traits/builtin.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk.rs | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir_ty/src/traits/builtin.rs b/crates/ra_hir_ty/src/traits/builtin.rs index dd41176f0..67120abf6 100644 --- a/crates/ra_hir_ty/src/traits/builtin.rs +++ b/crates/ra_hir_ty/src/traits/builtin.rs | |||
@@ -98,7 +98,7 @@ fn closure_fn_trait_impl_datum( | |||
98 | // the existence of the Fn trait has been checked before | 98 | // the existence of the Fn trait has been checked before |
99 | .expect("fn trait for closure impl missing"); | 99 | .expect("fn trait for closure impl missing"); |
100 | 100 | ||
101 | let num_args: u16 = match &db.body(data.def.into())[data.expr] { | 101 | let num_args: u16 = match &db.body(data.def)[data.expr] { |
102 | Expr::Lambda { args, .. } => args.len() as u16, | 102 | Expr::Lambda { args, .. } => args.len() as u16, |
103 | _ => { | 103 | _ => { |
104 | log::warn!("closure for closure type {:?} not found", data); | 104 | log::warn!("closure for closure type {:?} not found", data); |
@@ -118,7 +118,7 @@ fn closure_fn_trait_impl_datum( | |||
118 | let self_ty = Ty::apply_one(TypeCtor::Closure { def: data.def, expr: data.expr }, sig_ty); | 118 | let self_ty = Ty::apply_one(TypeCtor::Closure { def: data.def, expr: data.expr }, sig_ty); |
119 | 119 | ||
120 | let trait_ref = TraitRef { | 120 | let trait_ref = TraitRef { |
121 | trait_: trait_.into(), | 121 | trait_, |
122 | substs: Substs::build_for_def(db, trait_).push(self_ty).push(arg_ty).build(), | 122 | substs: Substs::build_for_def(db, trait_).push(self_ty).push(arg_ty).build(), |
123 | }; | 123 | }; |
124 | 124 | ||
@@ -139,7 +139,7 @@ fn closure_fn_trait_output_assoc_ty_value( | |||
139 | ) -> BuiltinImplAssocTyValueData { | 139 | ) -> BuiltinImplAssocTyValueData { |
140 | let impl_ = Impl::ClosureFnTraitImpl(data.clone()); | 140 | let impl_ = Impl::ClosureFnTraitImpl(data.clone()); |
141 | 141 | ||
142 | let num_args: u16 = match &db.body(data.def.into())[data.expr] { | 142 | let num_args: u16 = match &db.body(data.def)[data.expr] { |
143 | Expr::Lambda { args, .. } => args.len() as u16, | 143 | Expr::Lambda { args, .. } => args.len() as u16, |
144 | _ => { | 144 | _ => { |
145 | log::warn!("closure for closure type {:?} not found", data); | 145 | log::warn!("closure for closure type {:?} not found", data); |
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs index 882160fa8..306909ec2 100644 --- a/crates/ra_hir_ty/src/traits/chalk.rs +++ b/crates/ra_hir_ty/src/traits/chalk.rs | |||
@@ -565,10 +565,10 @@ where | |||
565 | // and will panic if the trait can't be resolved. | 565 | // and will panic if the trait can't be resolved. |
566 | let mut result: Vec<_> = self | 566 | let mut result: Vec<_> = self |
567 | .db | 567 | .db |
568 | .impls_for_trait(self.krate, trait_.into()) | 568 | .impls_for_trait(self.krate, trait_) |
569 | .iter() | 569 | .iter() |
570 | .copied() | 570 | .copied() |
571 | .map(|it| Impl::ImplBlock(it.into())) | 571 | .map(Impl::ImplBlock) |
572 | .map(|impl_| impl_.to_chalk(self.db)) | 572 | .map(|impl_| impl_.to_chalk(self.db)) |
573 | .collect(); | 573 | .collect(); |
574 | 574 | ||
@@ -586,7 +586,7 @@ where | |||
586 | false // FIXME | 586 | false // FIXME |
587 | } | 587 | } |
588 | fn associated_ty_value(&self, id: AssociatedTyValueId) -> Arc<AssociatedTyValue> { | 588 | fn associated_ty_value(&self, id: AssociatedTyValueId) -> Arc<AssociatedTyValue> { |
589 | self.db.associated_ty_value(self.krate.into(), id) | 589 | self.db.associated_ty_value(self.krate, id) |
590 | } | 590 | } |
591 | fn custom_clauses(&self) -> Vec<chalk_ir::ProgramClause<TypeFamily>> { | 591 | fn custom_clauses(&self) -> Vec<chalk_ir::ProgramClause<TypeFamily>> { |
592 | vec![] | 592 | vec![] |
@@ -674,7 +674,7 @@ pub(crate) fn struct_datum_query( | |||
674 | let where_clauses = type_ctor | 674 | let where_clauses = type_ctor |
675 | .as_generic_def() | 675 | .as_generic_def() |
676 | .map(|generic_def| { | 676 | .map(|generic_def| { |
677 | let generic_params = generics(db, generic_def.into()); | 677 | let generic_params = generics(db, generic_def); |
678 | let bound_vars = Substs::bound_vars(&generic_params); | 678 | let bound_vars = Substs::bound_vars(&generic_params); |
679 | convert_where_clauses(db, generic_def, &bound_vars) | 679 | convert_where_clauses(db, generic_def, &bound_vars) |
680 | }) | 680 | }) |
@@ -805,7 +805,7 @@ fn type_alias_associated_ty_value( | |||
805 | let ty = db.ty(type_alias.into()); | 805 | let ty = db.ty(type_alias.into()); |
806 | let value_bound = chalk_rust_ir::AssociatedTyValueBound { ty: ty.value.to_chalk(db) }; | 806 | let value_bound = chalk_rust_ir::AssociatedTyValueBound { ty: ty.value.to_chalk(db) }; |
807 | let value = chalk_rust_ir::AssociatedTyValue { | 807 | let value = chalk_rust_ir::AssociatedTyValue { |
808 | impl_id: Impl::ImplBlock(impl_id.into()).to_chalk(db), | 808 | impl_id: Impl::ImplBlock(impl_id).to_chalk(db), |
809 | associated_ty_id: assoc_ty.to_chalk(db), | 809 | associated_ty_id: assoc_ty.to_chalk(db), |
810 | value: make_binders(value_bound, ty.num_binders), | 810 | value: make_binders(value_bound, ty.num_binders), |
811 | }; | 811 | }; |