@@ -55,7 +55,6 @@ pub mod visibility;
55
55
56
56
use intern:: Interned ;
57
57
pub use rustc_abi as layout;
58
- use src:: HasSource ;
59
58
use triomphe:: Arc ;
60
59
61
60
#[ cfg( test) ]
@@ -78,7 +77,6 @@ use hir_expand::{
78
77
builtin:: { BuiltinAttrExpander , BuiltinDeriveExpander , BuiltinFnLikeExpander , EagerExpander } ,
79
78
db:: ExpandDatabase ,
80
79
eager:: expand_eager_macro_input,
81
- files:: InFileWrapper ,
82
80
impl_intern_lookup,
83
81
name:: Name ,
84
82
proc_macro:: { CustomProcMacroExpander , ProcMacroKind } ,
@@ -521,41 +519,6 @@ pub struct FieldId {
521
519
pub local_id : LocalFieldId ,
522
520
}
523
521
524
- impl FieldId {
525
- pub fn record_field_source (
526
- & self ,
527
- db : & dyn DefDatabase ,
528
- ) -> InFileWrapper < HirFileId , Option < ast:: RecordField > > {
529
- let field_list = match self . parent {
530
- crate :: VariantId :: EnumVariantId ( it) => {
531
- let s = it. lookup ( db) ;
532
- s. source ( db) . map ( |it| {
533
- it. field_list ( ) . and_then ( |it| match it {
534
- ast:: FieldList :: RecordFieldList ( it) => Some ( it) ,
535
- _ => None ,
536
- } )
537
- } )
538
- }
539
- crate :: VariantId :: StructId ( it) => {
540
- let s = it. lookup ( db) ;
541
- s. source ( db) . map ( |it| {
542
- it. field_list ( ) . and_then ( |it| match it {
543
- ast:: FieldList :: RecordFieldList ( it) => Some ( it) ,
544
- _ => None ,
545
- } )
546
- } )
547
- }
548
- crate :: VariantId :: UnionId ( it) => {
549
- let s = it. lookup ( db) ;
550
- s. source ( db) . map ( |it| it. record_field_list ( ) )
551
- }
552
- } ;
553
- field_list. map ( |it| {
554
- it. and_then ( |it| it. fields ( ) . nth ( self . local_id . into_raw ( ) . into_u32 ( ) as usize ) )
555
- } )
556
- }
557
- }
558
-
559
522
pub type LocalFieldId = Idx < data:: adt:: FieldData > ;
560
523
561
524
#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
@@ -723,7 +686,6 @@ pub enum TypeOwnerId {
723
686
TypeAliasId ( TypeAliasId ) ,
724
687
ImplId ( ImplId ) ,
725
688
EnumVariantId ( EnumVariantId ) ,
726
- FieldId ( FieldId ) ,
727
689
}
728
690
729
691
impl TypeOwnerId {
@@ -741,11 +703,6 @@ impl TypeOwnerId {
741
703
GenericDefId :: AdtId ( AdtId :: EnumId ( it. lookup ( db) . parent ) )
742
704
}
743
705
TypeOwnerId :: InTypeConstId ( _) => return None ,
744
- TypeOwnerId :: FieldId ( it) => GenericDefId :: AdtId ( match it. parent {
745
- VariantId :: EnumVariantId ( it) => AdtId :: EnumId ( it. lookup ( db) . parent ) ,
746
- VariantId :: StructId ( it) => it. into ( ) ,
747
- VariantId :: UnionId ( it) => it. into ( ) ,
748
- } ) ,
749
706
} )
750
707
}
751
708
}
@@ -760,8 +717,7 @@ impl_from!(
760
717
TraitAliasId ,
761
718
TypeAliasId ,
762
719
ImplId ,
763
- EnumVariantId ,
764
- FieldId
720
+ EnumVariantId
765
721
for TypeOwnerId
766
722
) ;
767
723
@@ -774,7 +730,6 @@ impl From<DefWithBodyId> for TypeOwnerId {
774
730
DefWithBodyId :: ConstId ( it) => it. into ( ) ,
775
731
DefWithBodyId :: InTypeConstId ( it) => it. into ( ) ,
776
732
DefWithBodyId :: VariantId ( it) => it. into ( ) ,
777
- DefWithBodyId :: FieldId ( it) => it. into ( ) ,
778
733
}
779
734
}
780
735
}
@@ -930,7 +885,6 @@ pub enum DefWithBodyId {
930
885
ConstId ( ConstId ) ,
931
886
InTypeConstId ( InTypeConstId ) ,
932
887
VariantId ( EnumVariantId ) ,
933
- FieldId ( FieldId ) ,
934
888
}
935
889
936
890
impl_from ! ( FunctionId , ConstId , StaticId , InTypeConstId for DefWithBodyId ) ;
@@ -951,7 +905,6 @@ impl DefWithBodyId {
951
905
// FIXME: stable rust doesn't allow generics in constants, but we should
952
906
// use `TypeOwnerId::as_generic_def_id` when it does.
953
907
DefWithBodyId :: InTypeConstId ( _) => None ,
954
- DefWithBodyId :: FieldId ( _) => None ,
955
908
}
956
909
}
957
910
}
@@ -1379,11 +1332,6 @@ impl HasModule for TypeOwnerId {
1379
1332
TypeOwnerId :: ImplId ( it) => it. module ( db) ,
1380
1333
TypeOwnerId :: EnumVariantId ( it) => it. module ( db) ,
1381
1334
TypeOwnerId :: InTypeConstId ( it) => it. lookup ( db) . owner . module ( db) ,
1382
- TypeOwnerId :: FieldId ( it) => match it. parent {
1383
- VariantId :: EnumVariantId ( it) => it. module ( db) ,
1384
- VariantId :: StructId ( it) => it. module ( db) ,
1385
- VariantId :: UnionId ( it) => it. module ( db) ,
1386
- } ,
1387
1335
}
1388
1336
}
1389
1337
}
@@ -1396,11 +1344,6 @@ impl HasModule for DefWithBodyId {
1396
1344
DefWithBodyId :: ConstId ( it) => it. module ( db) ,
1397
1345
DefWithBodyId :: VariantId ( it) => it. module ( db) ,
1398
1346
DefWithBodyId :: InTypeConstId ( it) => it. lookup ( db) . owner . module ( db) ,
1399
- DefWithBodyId :: FieldId ( it) => match it. parent {
1400
- VariantId :: EnumVariantId ( it) => it. module ( db) ,
1401
- VariantId :: StructId ( it) => it. module ( db) ,
1402
- VariantId :: UnionId ( it) => it. module ( db) ,
1403
- } ,
1404
1347
}
1405
1348
}
1406
1349
}
0 commit comments