@@ -797,7 +797,7 @@ impl<'db> Inference<'db> {
797797 let impl_ty = self
798798 . db
799799 . impl_type_concrete_implized ( ImplTypeId :: new ( impl_id, trait_type_id, self . db ) )
800- . map_err ( |_| ErrorSet ) ?;
800+ . map_err ( |diag_added| self . set_error ( InferenceError :: Reported ( diag_added ) ) ) ?;
801801 if let Err ( err_set) = self . conform_ty ( ty, impl_ty) {
802802 // Override the error with ImplTypeMismatch.
803803 let ty0 = self . rewrite ( ty) . no_err ( ) ;
@@ -809,24 +809,22 @@ impl<'db> Inference<'db> {
809809 }
810810 }
811811 for ( trait_constant, constant_id) in mappings. constants {
812- self . conform_const (
813- constant_id,
814- self . db
815- . impl_constant_concrete_implized_value ( ImplConstantId :: new (
816- impl_id,
817- trait_constant,
818- self . db ,
819- ) )
820- . map_err ( |_| ErrorSet ) ?,
821- ) ?;
812+ let concrete_impl_constant = self
813+ . db
814+ . impl_constant_concrete_implized_value ( ImplConstantId :: new (
815+ impl_id,
816+ trait_constant,
817+ self . db ,
818+ ) )
819+ . map_err ( |diag_added| self . set_error ( InferenceError :: Reported ( diag_added) ) ) ?;
820+ self . conform_const ( constant_id, concrete_impl_constant) ?;
822821 }
823822 for ( trait_impl, inner_impl_id) in mappings. impls {
824- self . conform_impl (
825- inner_impl_id,
826- self . db
827- . impl_impl_concrete_implized ( ImplImplId :: new ( impl_id, trait_impl, self . db ) )
828- . map_err ( |_| ErrorSet ) ?,
829- ) ?;
823+ let concrete_impl_impl = self
824+ . db
825+ . impl_impl_concrete_implized ( ImplImplId :: new ( impl_id, trait_impl, self . db ) )
826+ . map_err ( |diag_added| self . set_error ( InferenceError :: Reported ( diag_added) ) ) ?;
827+ self . conform_impl ( inner_impl_id, concrete_impl_impl) ?;
830828 }
831829 }
832830 Ok ( impl_id)
0 commit comments