@@ -406,14 +406,14 @@ impl TypeParamId {
406
406
407
407
impl TypeParamId {
408
408
/// Caller should check if this toc id really belongs to a type
409
- pub fn from_unchecked ( x : TypeOrConstParamId ) -> Self {
410
- Self ( x )
409
+ pub fn from_unchecked ( it : TypeOrConstParamId ) -> Self {
410
+ Self ( it )
411
411
}
412
412
}
413
413
414
414
impl From < TypeParamId > for TypeOrConstParamId {
415
- fn from ( x : TypeParamId ) -> Self {
416
- x . 0
415
+ fn from ( it : TypeParamId ) -> Self {
416
+ it . 0
417
417
}
418
418
}
419
419
@@ -432,14 +432,14 @@ impl ConstParamId {
432
432
433
433
impl ConstParamId {
434
434
/// Caller should check if this toc id really belongs to a const
435
- pub fn from_unchecked ( x : TypeOrConstParamId ) -> Self {
436
- Self ( x )
435
+ pub fn from_unchecked ( it : TypeOrConstParamId ) -> Self {
436
+ Self ( it )
437
437
}
438
438
}
439
439
440
440
impl From < ConstParamId > for TypeOrConstParamId {
441
- fn from ( x : ConstParamId ) -> Self {
442
- x . 0
441
+ fn from ( it : ConstParamId ) -> Self {
442
+ it . 0
443
443
}
444
444
}
445
445
@@ -562,14 +562,14 @@ pub enum TypeOwnerId {
562
562
impl TypeOwnerId {
563
563
fn as_generic_def_id ( self ) -> Option < GenericDefId > {
564
564
Some ( match self {
565
- TypeOwnerId :: FunctionId ( x ) => GenericDefId :: FunctionId ( x ) ,
566
- TypeOwnerId :: ConstId ( x ) => GenericDefId :: ConstId ( x ) ,
567
- TypeOwnerId :: AdtId ( x ) => GenericDefId :: AdtId ( x ) ,
568
- TypeOwnerId :: TraitId ( x ) => GenericDefId :: TraitId ( x ) ,
569
- TypeOwnerId :: TraitAliasId ( x ) => GenericDefId :: TraitAliasId ( x ) ,
570
- TypeOwnerId :: TypeAliasId ( x ) => GenericDefId :: TypeAliasId ( x ) ,
571
- TypeOwnerId :: ImplId ( x ) => GenericDefId :: ImplId ( x ) ,
572
- TypeOwnerId :: EnumVariantId ( x ) => GenericDefId :: EnumVariantId ( x ) ,
565
+ TypeOwnerId :: FunctionId ( it ) => GenericDefId :: FunctionId ( it ) ,
566
+ TypeOwnerId :: ConstId ( it ) => GenericDefId :: ConstId ( it ) ,
567
+ TypeOwnerId :: AdtId ( it ) => GenericDefId :: AdtId ( it ) ,
568
+ TypeOwnerId :: TraitId ( it ) => GenericDefId :: TraitId ( it ) ,
569
+ TypeOwnerId :: TraitAliasId ( it ) => GenericDefId :: TraitAliasId ( it ) ,
570
+ TypeOwnerId :: TypeAliasId ( it ) => GenericDefId :: TypeAliasId ( it ) ,
571
+ TypeOwnerId :: ImplId ( it ) => GenericDefId :: ImplId ( it ) ,
572
+ TypeOwnerId :: EnumVariantId ( it ) => GenericDefId :: EnumVariantId ( it ) ,
573
573
TypeOwnerId :: InTypeConstId ( _) | TypeOwnerId :: ModuleId ( _) | TypeOwnerId :: StaticId ( _) => {
574
574
return None
575
575
}
@@ -592,30 +592,30 @@ impl_from!(
592
592
for TypeOwnerId
593
593
) ;
594
594
595
- // Every `DefWithBodyId` is a type owner, since bodies can contain type (e.g. `{ let x : Type = _; }`)
595
+ // Every `DefWithBodyId` is a type owner, since bodies can contain type (e.g. `{ let it : Type = _; }`)
596
596
impl From < DefWithBodyId > for TypeOwnerId {
597
597
fn from ( value : DefWithBodyId ) -> Self {
598
598
match value {
599
- DefWithBodyId :: FunctionId ( x ) => x . into ( ) ,
600
- DefWithBodyId :: StaticId ( x ) => x . into ( ) ,
601
- DefWithBodyId :: ConstId ( x ) => x . into ( ) ,
602
- DefWithBodyId :: InTypeConstId ( x ) => x . into ( ) ,
603
- DefWithBodyId :: VariantId ( x ) => x . into ( ) ,
599
+ DefWithBodyId :: FunctionId ( it ) => it . into ( ) ,
600
+ DefWithBodyId :: StaticId ( it ) => it . into ( ) ,
601
+ DefWithBodyId :: ConstId ( it ) => it . into ( ) ,
602
+ DefWithBodyId :: InTypeConstId ( it ) => it . into ( ) ,
603
+ DefWithBodyId :: VariantId ( it ) => it . into ( ) ,
604
604
}
605
605
}
606
606
}
607
607
608
608
impl From < GenericDefId > for TypeOwnerId {
609
609
fn from ( value : GenericDefId ) -> Self {
610
610
match value {
611
- GenericDefId :: FunctionId ( x ) => x . into ( ) ,
612
- GenericDefId :: AdtId ( x ) => x . into ( ) ,
613
- GenericDefId :: TraitId ( x ) => x . into ( ) ,
614
- GenericDefId :: TraitAliasId ( x ) => x . into ( ) ,
615
- GenericDefId :: TypeAliasId ( x ) => x . into ( ) ,
616
- GenericDefId :: ImplId ( x ) => x . into ( ) ,
617
- GenericDefId :: EnumVariantId ( x ) => x . into ( ) ,
618
- GenericDefId :: ConstId ( x ) => x . into ( ) ,
611
+ GenericDefId :: FunctionId ( it ) => it . into ( ) ,
612
+ GenericDefId :: AdtId ( it ) => it . into ( ) ,
613
+ GenericDefId :: TraitId ( it ) => it . into ( ) ,
614
+ GenericDefId :: TraitAliasId ( it ) => it . into ( ) ,
615
+ GenericDefId :: TypeAliasId ( it ) => it . into ( ) ,
616
+ GenericDefId :: ImplId ( it ) => it . into ( ) ,
617
+ GenericDefId :: EnumVariantId ( it ) => it . into ( ) ,
618
+ GenericDefId :: ConstId ( it ) => it . into ( ) ,
619
619
}
620
620
}
621
621
}
@@ -730,7 +730,7 @@ impl GeneralConstId {
730
730
. const_data ( const_id)
731
731
. name
732
732
. as_ref ( )
733
- . and_then ( |x| x . as_str ( ) )
733
+ . and_then ( |it| it . as_str ( ) )
734
734
. unwrap_or ( "_" )
735
735
. to_owned ( ) ,
736
736
GeneralConstId :: ConstBlockId ( id) => format ! ( "{{anonymous const {id:?}}}" ) ,
@@ -972,17 +972,17 @@ impl HasModule for MacroId {
972
972
impl HasModule for TypeOwnerId {
973
973
fn module ( & self , db : & dyn db:: DefDatabase ) -> ModuleId {
974
974
match self {
975
- TypeOwnerId :: FunctionId ( x ) => x . lookup ( db) . module ( db) ,
976
- TypeOwnerId :: StaticId ( x ) => x . lookup ( db) . module ( db) ,
977
- TypeOwnerId :: ConstId ( x ) => x . lookup ( db) . module ( db) ,
978
- TypeOwnerId :: InTypeConstId ( x ) => x . lookup ( db) . owner . module ( db) ,
979
- TypeOwnerId :: AdtId ( x ) => x . module ( db) ,
980
- TypeOwnerId :: TraitId ( x ) => x . lookup ( db) . container ,
981
- TypeOwnerId :: TraitAliasId ( x ) => x . lookup ( db) . container ,
982
- TypeOwnerId :: TypeAliasId ( x ) => x . lookup ( db) . module ( db) ,
983
- TypeOwnerId :: ImplId ( x ) => x . lookup ( db) . container ,
984
- TypeOwnerId :: EnumVariantId ( x ) => x . parent . lookup ( db) . container ,
985
- TypeOwnerId :: ModuleId ( x ) => * x ,
975
+ TypeOwnerId :: FunctionId ( it ) => it . lookup ( db) . module ( db) ,
976
+ TypeOwnerId :: StaticId ( it ) => it . lookup ( db) . module ( db) ,
977
+ TypeOwnerId :: ConstId ( it ) => it . lookup ( db) . module ( db) ,
978
+ TypeOwnerId :: InTypeConstId ( it ) => it . lookup ( db) . owner . module ( db) ,
979
+ TypeOwnerId :: AdtId ( it ) => it . module ( db) ,
980
+ TypeOwnerId :: TraitId ( it ) => it . lookup ( db) . container ,
981
+ TypeOwnerId :: TraitAliasId ( it ) => it . lookup ( db) . container ,
982
+ TypeOwnerId :: TypeAliasId ( it ) => it . lookup ( db) . module ( db) ,
983
+ TypeOwnerId :: ImplId ( it ) => it . lookup ( db) . container ,
984
+ TypeOwnerId :: EnumVariantId ( it ) => it . parent . lookup ( db) . container ,
985
+ TypeOwnerId :: ModuleId ( it ) => * it ,
986
986
}
987
987
}
988
988
}
0 commit comments