@@ -229,8 +229,8 @@ impl Module {
229229 }
230230 }
231231
232- for impl_block in self . impl_blocks ( db) {
233- for item in impl_block . items ( db) {
232+ for impl_def in self . impl_defs ( db) {
233+ for item in impl_def . items ( db) {
234234 if let AssocItem :: Function ( f) = item {
235235 f. diagnostics ( db, sink) ;
236236 }
@@ -243,9 +243,9 @@ impl Module {
243243 def_map[ self . id . local_id ] . scope . declarations ( ) . map ( ModuleDef :: from) . collect ( )
244244 }
245245
246- pub fn impl_blocks ( self , db : & impl DefDatabase ) -> Vec < ImplBlock > {
246+ pub fn impl_defs ( self , db : & impl DefDatabase ) -> Vec < ImplDef > {
247247 let def_map = db. crate_def_map ( self . id . krate ) ;
248- def_map[ self . id . local_id ] . scope . impls ( ) . map ( ImplBlock :: from) . collect ( )
248+ def_map[ self . id . local_id ] . scope . impls ( ) . map ( ImplDef :: from) . collect ( )
249249 }
250250
251251 pub ( crate ) fn with_module_id ( self , module_id : LocalModuleId ) -> Module {
@@ -686,7 +686,7 @@ pub enum AssocItem {
686686}
687687pub enum AssocItemContainer {
688688 Trait ( Trait ) ,
689- ImplBlock ( ImplBlock ) ,
689+ ImplDef ( ImplDef ) ,
690690}
691691pub trait AsAssocItem {
692692 fn as_assoc_item ( self , db : & impl DefDatabase ) -> Option < AssocItem > ;
@@ -736,7 +736,7 @@ impl AssocItem {
736736 } ;
737737 match container {
738738 AssocContainerId :: TraitId ( id) => AssocItemContainer :: Trait ( id. into ( ) ) ,
739- AssocContainerId :: ImplId ( id) => AssocItemContainer :: ImplBlock ( id. into ( ) ) ,
739+ AssocContainerId :: ImplId ( id) => AssocItemContainer :: ImplDef ( id. into ( ) ) ,
740740 AssocContainerId :: ContainerId ( _) => panic ! ( "invalid AssocItem" ) ,
741741 }
742742 }
@@ -748,7 +748,7 @@ pub enum GenericDef {
748748 Adt ( Adt ) ,
749749 Trait ( Trait ) ,
750750 TypeAlias ( TypeAlias ) ,
751- ImplBlock ( ImplBlock ) ,
751+ ImplDef ( ImplDef ) ,
752752 // enum variants cannot have generics themselves, but their parent enums
753753 // can, and this makes some code easier to write
754754 EnumVariant ( EnumVariant ) ,
@@ -760,7 +760,7 @@ impl_froms!(
760760 Adt ( Struct , Enum , Union ) ,
761761 Trait ,
762762 TypeAlias ,
763- ImplBlock ,
763+ ImplDef ,
764764 EnumVariant ,
765765 Const
766766) ;
@@ -850,20 +850,20 @@ impl TypeParam {
850850 }
851851}
852852
853- // FIXME: rename from `ImplBlock ` to `Impl`
853+ // FIXME: rename from `ImplDef ` to `Impl`
854854#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
855- pub struct ImplBlock {
855+ pub struct ImplDef {
856856 pub ( crate ) id : ImplId ,
857857}
858858
859- impl ImplBlock {
860- pub fn all_in_crate ( db : & impl HirDatabase , krate : Crate ) -> Vec < ImplBlock > {
859+ impl ImplDef {
860+ pub fn all_in_crate ( db : & impl HirDatabase , krate : Crate ) -> Vec < ImplDef > {
861861 let impls = db. impls_in_crate ( krate. id ) ;
862862 impls. all_impls ( ) . map ( Self :: from) . collect ( )
863863 }
864- pub fn for_trait ( db : & impl HirDatabase , krate : Crate , trait_ : Trait ) -> Vec < ImplBlock > {
864+ pub fn for_trait ( db : & impl HirDatabase , krate : Crate , trait_ : Trait ) -> Vec < ImplDef > {
865865 let impls = db. impls_in_crate ( krate. id ) ;
866- impls. lookup_impl_blocks_for_trait ( trait_. id ) . map ( Self :: from) . collect ( )
866+ impls. lookup_impl_defs_for_trait ( trait_. id ) . map ( Self :: from) . collect ( )
867867 }
868868
869869 pub fn target_trait ( & self , db : & impl DefDatabase ) -> Option < TypeRef > {
@@ -1077,7 +1077,7 @@ impl Type {
10771077 }
10781078
10791079 // This would be nicer if it just returned an iterator, but that runs into
1080- // lifetime problems, because we need to borrow temp `CrateImplBlocks `.
1080+ // lifetime problems, because we need to borrow temp `CrateImplDefs `.
10811081 pub fn iterate_impl_items < T > (
10821082 self ,
10831083 db : & impl HirDatabase ,
@@ -1087,8 +1087,8 @@ impl Type {
10871087 for krate in self . ty . value . def_crates ( db, krate. id ) ? {
10881088 let impls = db. impls_in_crate ( krate) ;
10891089
1090- for impl_block in impls. lookup_impl_blocks ( & self . ty . value ) {
1091- for & item in db. impl_data ( impl_block ) . items . iter ( ) {
1090+ for impl_def in impls. lookup_impl_defs ( & self . ty . value ) {
1091+ for & item in db. impl_data ( impl_def ) . items . iter ( ) {
10921092 if let Some ( result) = callback ( item. into ( ) ) {
10931093 return Some ( result) ;
10941094 }
@@ -1196,7 +1196,7 @@ pub enum ScopeDef {
11961196 ModuleDef ( ModuleDef ) ,
11971197 MacroDef ( MacroDef ) ,
11981198 GenericParam ( TypeParam ) ,
1199- ImplSelfType ( ImplBlock ) ,
1199+ ImplSelfType ( ImplDef ) ,
12001200 AdtSelfType ( Adt ) ,
12011201 Local ( Local ) ,
12021202 Unknown ,
0 commit comments