@@ -86,7 +86,7 @@ impl<'tcx, 'interner> Visitor<'tcx> for ItemLowerer<'tcx, 'interner> {
86
86
}
87
87
}
88
88
89
- fn visit_trait_item ( & mut self , item : & ' tcx TraitItem ) {
89
+ fn visit_trait_item ( & mut self , item : & ' tcx AssocItem ) {
90
90
self . lctx . with_hir_id_owner ( item. id , |lctx| {
91
91
let hir_item = lctx. lower_trait_item ( item) ;
92
92
let id = hir:: TraitItemId { hir_id : hir_item. hir_id } ;
@@ -97,7 +97,7 @@ impl<'tcx, 'interner> Visitor<'tcx> for ItemLowerer<'tcx, 'interner> {
97
97
visit:: walk_assoc_item ( self , item) ;
98
98
}
99
99
100
- fn visit_impl_item ( & mut self , item : & ' tcx ImplItem ) {
100
+ fn visit_impl_item ( & mut self , item : & ' tcx AssocItem ) {
101
101
self . lctx . with_hir_id_owner ( item. id , |lctx| {
102
102
let hir_item = lctx. lower_impl_item ( item) ;
103
103
let id = hir:: ImplItemId { hir_id : hir_item. hir_id } ;
@@ -813,11 +813,11 @@ impl LoweringContext<'_> {
813
813
}
814
814
}
815
815
816
- fn lower_trait_item ( & mut self , i : & TraitItem ) -> hir:: TraitItem {
816
+ fn lower_trait_item ( & mut self , i : & AssocItem ) -> hir:: TraitItem {
817
817
let trait_item_def_id = self . resolver . definitions ( ) . local_def_id ( i. id ) ;
818
818
819
819
let ( generics, kind) = match i. kind {
820
- TraitItemKind :: Const ( ref ty, ref default) => (
820
+ AssocItemKind :: Const ( ref ty, ref default) => (
821
821
self . lower_generics ( & i. generics , ImplTraitContext :: disallowed ( ) ) ,
822
822
hir:: TraitItemKind :: Const (
823
823
self . lower_ty ( ty, ImplTraitContext :: disallowed ( ) ) ,
@@ -826,7 +826,7 @@ impl LoweringContext<'_> {
826
826
. map ( |x| self . lower_const_body ( i. span , Some ( x) ) ) ,
827
827
) ,
828
828
) ,
829
- TraitItemKind :: Method ( ref sig, None ) => {
829
+ AssocItemKind :: Method ( ref sig, None ) => {
830
830
let names = self . lower_fn_params_to_names ( & sig. decl ) ;
831
831
let ( generics, sig) = self . lower_method_sig (
832
832
& i. generics ,
@@ -837,7 +837,7 @@ impl LoweringContext<'_> {
837
837
) ;
838
838
( generics, hir:: TraitItemKind :: Method ( sig, hir:: TraitMethod :: Required ( names) ) )
839
839
}
840
- TraitItemKind :: Method ( ref sig, Some ( ref body) ) => {
840
+ AssocItemKind :: Method ( ref sig, Some ( ref body) ) => {
841
841
let body_id = self . lower_fn_body_block ( i. span , & sig. decl , Some ( body) ) ;
842
842
let ( generics, sig) = self . lower_method_sig (
843
843
& i. generics ,
@@ -848,7 +848,7 @@ impl LoweringContext<'_> {
848
848
) ;
849
849
( generics, hir:: TraitItemKind :: Method ( sig, hir:: TraitMethod :: Provided ( body_id) ) )
850
850
}
851
- TraitItemKind :: TyAlias ( ref bounds, ref default) => {
851
+ AssocItemKind :: TyAlias ( ref bounds, ref default) => {
852
852
let generics = self . lower_generics ( & i. generics , ImplTraitContext :: disallowed ( ) ) ;
853
853
let kind = hir:: TraitItemKind :: Type (
854
854
self . lower_param_bounds ( bounds, ImplTraitContext :: disallowed ( ) ) ,
@@ -859,7 +859,7 @@ impl LoweringContext<'_> {
859
859
860
860
( generics, kind)
861
861
} ,
862
- TraitItemKind :: Macro ( ..) => bug ! ( "macro item shouldn't exist at this point" ) ,
862
+ AssocItemKind :: Macro ( ..) => bug ! ( "macro item shouldn't exist at this point" ) ,
863
863
} ;
864
864
865
865
hir:: TraitItem {
@@ -872,21 +872,21 @@ impl LoweringContext<'_> {
872
872
}
873
873
}
874
874
875
- fn lower_trait_item_ref ( & mut self , i : & TraitItem ) -> hir:: TraitItemRef {
875
+ fn lower_trait_item_ref ( & mut self , i : & AssocItem ) -> hir:: TraitItemRef {
876
876
let ( kind, has_default) = match i. kind {
877
- TraitItemKind :: Const ( _, ref default) => {
877
+ AssocItemKind :: Const ( _, ref default) => {
878
878
( hir:: AssocItemKind :: Const , default. is_some ( ) )
879
879
}
880
- TraitItemKind :: TyAlias ( _, ref default) => {
880
+ AssocItemKind :: TyAlias ( _, ref default) => {
881
881
( hir:: AssocItemKind :: Type , default. is_some ( ) )
882
882
}
883
- TraitItemKind :: Method ( ref sig, ref default) => (
883
+ AssocItemKind :: Method ( ref sig, ref default) => (
884
884
hir:: AssocItemKind :: Method {
885
885
has_self : sig. decl . has_self ( ) ,
886
886
} ,
887
887
default. is_some ( ) ,
888
888
) ,
889
- TraitItemKind :: Macro ( ..) => unimplemented ! ( ) ,
889
+ AssocItemKind :: Macro ( ..) => unimplemented ! ( ) ,
890
890
} ;
891
891
hir:: TraitItemRef {
892
892
id : hir:: TraitItemId { hir_id : self . lower_node_id ( i. id ) } ,
@@ -902,18 +902,18 @@ impl LoweringContext<'_> {
902
902
self . expr ( span, hir:: ExprKind :: Err , ThinVec :: new ( ) )
903
903
}
904
904
905
- fn lower_impl_item ( & mut self , i : & ImplItem ) -> hir:: ImplItem {
905
+ fn lower_impl_item ( & mut self , i : & AssocItem ) -> hir:: ImplItem {
906
906
let impl_item_def_id = self . resolver . definitions ( ) . local_def_id ( i. id ) ;
907
907
908
908
let ( generics, kind) = match i. kind {
909
- ImplItemKind :: Const ( ref ty, ref expr) => (
909
+ AssocItemKind :: Const ( ref ty, ref expr) => (
910
910
self . lower_generics ( & i. generics , ImplTraitContext :: disallowed ( ) ) ,
911
911
hir:: ImplItemKind :: Const (
912
912
self . lower_ty ( ty, ImplTraitContext :: disallowed ( ) ) ,
913
913
self . lower_const_body ( i. span , expr. as_deref ( ) ) ,
914
914
) ,
915
915
) ,
916
- ImplItemKind :: Method ( ref sig, ref body) => {
916
+ AssocItemKind :: Method ( ref sig, ref body) => {
917
917
self . current_item = Some ( i. span ) ;
918
918
let body_id = self . lower_maybe_async_body (
919
919
i. span ,
@@ -932,7 +932,7 @@ impl LoweringContext<'_> {
932
932
933
933
( generics, hir:: ImplItemKind :: Method ( sig, body_id) )
934
934
}
935
- ImplItemKind :: TyAlias ( _, ref ty) => {
935
+ AssocItemKind :: TyAlias ( _, ref ty) => {
936
936
let generics = self . lower_generics ( & i. generics , ImplTraitContext :: disallowed ( ) ) ;
937
937
let kind = match ty {
938
938
None => {
@@ -951,7 +951,7 @@ impl LoweringContext<'_> {
951
951
} ;
952
952
( generics, kind)
953
953
} ,
954
- ImplItemKind :: Macro ( ..) => bug ! ( "`TyMac` should have been expanded by now" ) ,
954
+ AssocItemKind :: Macro ( ..) => bug ! ( "`TyMac` should have been expanded by now" ) ,
955
955
} ;
956
956
957
957
hir:: ImplItem {
@@ -968,26 +968,26 @@ impl LoweringContext<'_> {
968
968
// [1] since `default impl` is not yet implemented, this is always true in impls
969
969
}
970
970
971
- fn lower_impl_item_ref ( & mut self , i : & ImplItem ) -> hir:: ImplItemRef {
971
+ fn lower_impl_item_ref ( & mut self , i : & AssocItem ) -> hir:: ImplItemRef {
972
972
hir:: ImplItemRef {
973
973
id : hir:: ImplItemId { hir_id : self . lower_node_id ( i. id ) } ,
974
974
ident : i. ident ,
975
975
span : i. span ,
976
976
vis : self . lower_visibility ( & i. vis , Some ( i. id ) ) ,
977
977
defaultness : self . lower_defaultness ( i. defaultness , true /* [1] */ ) ,
978
978
kind : match & i. kind {
979
- ImplItemKind :: Const ( ..) => hir:: AssocItemKind :: Const ,
980
- ImplItemKind :: TyAlias ( _, ty) => match ty
979
+ AssocItemKind :: Const ( ..) => hir:: AssocItemKind :: Const ,
980
+ AssocItemKind :: TyAlias ( _, ty) => match ty
981
981
. as_deref ( )
982
982
. and_then ( |ty| ty. kind . opaque_top_hack ( ) )
983
983
{
984
984
None => hir:: AssocItemKind :: Type ,
985
985
Some ( _) => hir:: AssocItemKind :: OpaqueTy ,
986
986
} ,
987
- ImplItemKind :: Method ( sig, _) => hir:: AssocItemKind :: Method {
987
+ AssocItemKind :: Method ( sig, _) => hir:: AssocItemKind :: Method {
988
988
has_self : sig. decl . has_self ( ) ,
989
989
} ,
990
- ImplItemKind :: Macro ( ..) => unimplemented ! ( ) ,
990
+ AssocItemKind :: Macro ( ..) => unimplemented ! ( ) ,
991
991
} ,
992
992
}
993
993
0 commit comments