@@ -410,21 +410,18 @@ impl PartialEq<CrateRootModuleId> for ModuleId {
410
410
}
411
411
412
412
impl From < CrateRootModuleId > for ModuleId {
413
- /// Make a `ModuleId` with a krate, no block, and local_id of `ROOT`
414
413
fn from ( CrateRootModuleId { krate } : CrateRootModuleId ) -> Self {
415
414
ModuleId { krate, block : None , local_id : DefMap :: ROOT }
416
415
}
417
416
}
418
417
419
418
impl From < CrateRootModuleId > for ModuleDefId {
420
- /// Make a `ModuleId` with `CrateRootModuleId` as inner
421
419
fn from ( value : CrateRootModuleId ) -> Self {
422
420
ModuleDefId :: ModuleId ( value. into ( ) )
423
421
}
424
422
}
425
423
426
424
impl From < CrateId > for CrateRootModuleId {
427
- /// Create a `CrateRootModuleId` with `CrateId` as inner
428
425
fn from ( krate : CrateId ) -> Self {
429
426
CrateRootModuleId { krate }
430
427
}
@@ -567,7 +564,6 @@ impl TypeParamId {
567
564
}
568
565
569
566
impl From < TypeParamId > for TypeOrConstParamId {
570
- /// Get the inner `TypeOrConstParamId` of `TypeParamId`
571
567
fn from ( it : TypeParamId ) -> Self {
572
568
it. 0
573
569
}
@@ -594,7 +590,6 @@ impl ConstParamId {
594
590
}
595
591
596
592
impl From < ConstParamId > for TypeOrConstParamId {
597
- /// Get the inner `TypeOrConstParamId` of `ConstParamId`
598
593
fn from ( it : ConstParamId ) -> Self {
599
594
it. 0
600
595
}
@@ -734,7 +729,6 @@ impl_from!(
734
729
735
730
// Every `DefWithBodyId` is a type owner, since bodies can contain type (e.g. `{ let it: Type = _; }`)
736
731
impl From < DefWithBodyId > for TypeOwnerId {
737
- /// Convert `DefWithBodyId` inner into `TypeOwnerId`
738
732
fn from ( value : DefWithBodyId ) -> Self {
739
733
match value {
740
734
DefWithBodyId :: FunctionId ( it) => it. into ( ) ,
@@ -747,7 +741,6 @@ impl From<DefWithBodyId> for TypeOwnerId {
747
741
}
748
742
749
743
impl From < GenericDefId > for TypeOwnerId {
750
- /// Convert `GenericDefId` inner into `TypeOwnerId`
751
744
fn from ( value : GenericDefId ) -> Self {
752
745
match value {
753
746
GenericDefId :: FunctionId ( it) => it. into ( ) ,
@@ -903,7 +896,6 @@ pub enum DefWithBodyId {
903
896
impl_from ! ( FunctionId , ConstId , StaticId , InTypeConstId for DefWithBodyId ) ;
904
897
905
898
impl From < EnumVariantId > for DefWithBodyId {
906
- /// Make a `VariantId` with `EnumVariantId`, as inner
907
899
fn from ( id : EnumVariantId ) -> Self {
908
900
DefWithBodyId :: VariantId ( id)
909
901
}
@@ -1016,7 +1008,6 @@ impl GenericDefId {
1016
1008
}
1017
1009
1018
1010
impl From < AssocItemId > for GenericDefId {
1019
- /// Convert `AssocItemId` inner to `GenericDefId`
1020
1011
fn from ( item : AssocItemId ) -> Self {
1021
1012
match item {
1022
1013
AssocItemId :: FunctionId ( f) => f. into ( ) ,
@@ -1037,7 +1028,6 @@ impl InternValueTrivial for CallableDefId {}
1037
1028
1038
1029
impl_from ! ( FunctionId , StructId , EnumVariantId for CallableDefId ) ;
1039
1030
impl From < CallableDefId > for ModuleDefId {
1040
- /// Match `CallableDefId` to `ModuleDefId`
1041
1031
fn from ( def : CallableDefId ) -> ModuleDefId {
1042
1032
match def {
1043
1033
CallableDefId :: FunctionId ( f) => ModuleDefId :: FunctionId ( f) ,
@@ -1099,10 +1089,6 @@ impl_from!(
1099
1089
impl TryFrom < ModuleDefId > for AttrDefId {
1100
1090
type Error = ( ) ;
1101
1091
1102
- /// Convert the inner of `ModuleDefId` into `Ok(AttrDefId)`
1103
- ///
1104
- /// # Errors
1105
- /// `BuiltinType` results in `Err`
1106
1092
fn try_from ( value : ModuleDefId ) -> Result < Self , Self :: Error > {
1107
1093
match value {
1108
1094
ModuleDefId :: ModuleId ( it) => Ok ( it. into ( ) ) ,
@@ -1121,7 +1107,6 @@ impl TryFrom<ModuleDefId> for AttrDefId {
1121
1107
}
1122
1108
1123
1109
impl From < ItemContainerId > for AttrDefId {
1124
- /// Match `ItemContainerId` to the `AttrDefId` variant of the same name
1125
1110
fn from ( acid : ItemContainerId ) -> Self {
1126
1111
match acid {
1127
1112
ItemContainerId :: ModuleId ( mid) => AttrDefId :: ModuleId ( mid) ,
@@ -1132,7 +1117,6 @@ impl From<ItemContainerId> for AttrDefId {
1132
1117
}
1133
1118
}
1134
1119
impl From < AssocItemId > for AttrDefId {
1135
- /// Match `AssocItemId` to the `AttrDefId` variant of the same name
1136
1120
fn from ( assoc : AssocItemId ) -> Self {
1137
1121
match assoc {
1138
1122
AssocItemId :: FunctionId ( it) => AttrDefId :: FunctionId ( it) ,
@@ -1142,7 +1126,6 @@ impl From<AssocItemId> for AttrDefId {
1142
1126
}
1143
1127
}
1144
1128
impl From < VariantId > for AttrDefId {
1145
- /// Convert the inner of `VariantId` into `AttrDefId`
1146
1129
fn from ( vid : VariantId ) -> Self {
1147
1130
match vid {
1148
1131
VariantId :: EnumVariantId ( id) => id. into ( ) ,
0 commit comments