77//!
88//! For now, we are developing everything inside `rustc`, thus, we keep this module private.
99
10- use crate :: rustc_internal:: { self , opaque} ;
10+ use crate :: rustc_internal:: opaque;
1111use crate :: stable_mir:: mir:: { CopyNonOverlapping , UserTypeProjection , VariantIdx } ;
1212use crate :: stable_mir:: ty:: {
1313 FloatTy , GenericParamDef , IntTy , Movability , RigidTy , Span , TyKind , UintTy ,
@@ -276,7 +276,7 @@ impl<'tcx> Stable<'tcx> for mir::Rvalue<'tcx> {
276276 place. stable ( tables) ,
277277 ) ,
278278 ThreadLocalRef ( def_id) => {
279- stable_mir:: mir:: Rvalue :: ThreadLocalRef ( rustc_internal :: crate_item ( * def_id) )
279+ stable_mir:: mir:: Rvalue :: ThreadLocalRef ( tables . crate_item ( * def_id) )
280280 }
281281 AddressOf ( mutability, place) => {
282282 stable_mir:: mir:: Rvalue :: AddressOf ( mutability. stable ( tables) , place. stable ( tables) )
@@ -739,7 +739,7 @@ impl<'tcx> Stable<'tcx> for mir::AggregateKind<'tcx> {
739739 mir:: AggregateKind :: Tuple => stable_mir:: mir:: AggregateKind :: Tuple ,
740740 mir:: AggregateKind :: Adt ( def_id, var_idx, generic_arg, user_ty_index, field_idx) => {
741741 stable_mir:: mir:: AggregateKind :: Adt (
742- rustc_internal :: adt_def ( * def_id) ,
742+ tables . adt_def ( * def_id) ,
743743 var_idx. index ( ) ,
744744 generic_arg. stable ( tables) ,
745745 user_ty_index. map ( |idx| idx. index ( ) ) ,
@@ -748,13 +748,13 @@ impl<'tcx> Stable<'tcx> for mir::AggregateKind<'tcx> {
748748 }
749749 mir:: AggregateKind :: Closure ( def_id, generic_arg) => {
750750 stable_mir:: mir:: AggregateKind :: Closure (
751- rustc_internal :: closure_def ( * def_id) ,
751+ tables . closure_def ( * def_id) ,
752752 generic_arg. stable ( tables) ,
753753 )
754754 }
755755 mir:: AggregateKind :: Generator ( def_id, generic_arg, movability) => {
756756 stable_mir:: mir:: AggregateKind :: Generator (
757- rustc_internal :: generator_def ( * def_id) ,
757+ tables . generator_def ( * def_id) ,
758758 generic_arg. stable ( tables) ,
759759 movability. stable ( tables) ,
760760 )
@@ -964,13 +964,13 @@ impl<'tcx> Stable<'tcx> for ty::FnSig<'tcx> {
964964impl < ' tcx > Stable < ' tcx > for ty:: BoundTyKind {
965965 type T = stable_mir:: ty:: BoundTyKind ;
966966
967- fn stable ( & self , _ : & mut Tables < ' tcx > ) -> Self :: T {
967+ fn stable ( & self , tables : & mut Tables < ' tcx > ) -> Self :: T {
968968 use stable_mir:: ty:: BoundTyKind ;
969969
970970 match self {
971971 ty:: BoundTyKind :: Anon => BoundTyKind :: Anon ,
972972 ty:: BoundTyKind :: Param ( def_id, symbol) => {
973- BoundTyKind :: Param ( rustc_internal :: param_def ( * def_id) , symbol. to_string ( ) )
973+ BoundTyKind :: Param ( tables . param_def ( * def_id) , symbol. to_string ( ) )
974974 }
975975 }
976976 }
@@ -985,7 +985,7 @@ impl<'tcx> Stable<'tcx> for ty::BoundRegionKind {
985985 match self {
986986 ty:: BoundRegionKind :: BrAnon => BoundRegionKind :: BrAnon ,
987987 ty:: BoundRegionKind :: BrNamed ( def_id, symbol) => {
988- BoundRegionKind :: BrNamed ( rustc_internal :: br_named_def ( * def_id) , symbol. to_string ( ) )
988+ BoundRegionKind :: BrNamed ( tables . br_named_def ( * def_id) , symbol. to_string ( ) )
989989 }
990990 ty:: BoundRegionKind :: BrEnv => BoundRegionKind :: BrEnv ,
991991 }
@@ -1072,12 +1072,10 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
10721072 ty:: Uint ( uint_ty) => TyKind :: RigidTy ( RigidTy :: Uint ( uint_ty. stable ( tables) ) ) ,
10731073 ty:: Float ( float_ty) => TyKind :: RigidTy ( RigidTy :: Float ( float_ty. stable ( tables) ) ) ,
10741074 ty:: Adt ( adt_def, generic_args) => TyKind :: RigidTy ( RigidTy :: Adt (
1075- rustc_internal :: adt_def ( adt_def. did ( ) ) ,
1075+ tables . adt_def ( adt_def. did ( ) ) ,
10761076 generic_args. stable ( tables) ,
10771077 ) ) ,
1078- ty:: Foreign ( def_id) => {
1079- TyKind :: RigidTy ( RigidTy :: Foreign ( rustc_internal:: foreign_def ( * def_id) ) )
1080- }
1078+ ty:: Foreign ( def_id) => TyKind :: RigidTy ( RigidTy :: Foreign ( tables. foreign_def ( * def_id) ) ) ,
10811079 ty:: Str => TyKind :: RigidTy ( RigidTy :: Str ) ,
10821080 ty:: Array ( ty, constant) => {
10831081 TyKind :: RigidTy ( RigidTy :: Array ( tables. intern_ty ( * ty) , constant. stable ( tables) ) )
@@ -1091,10 +1089,9 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
10911089 tables. intern_ty ( * ty) ,
10921090 mutbl. stable ( tables) ,
10931091 ) ) ,
1094- ty:: FnDef ( def_id, generic_args) => TyKind :: RigidTy ( RigidTy :: FnDef (
1095- rustc_internal:: fn_def ( * def_id) ,
1096- generic_args. stable ( tables) ,
1097- ) ) ,
1092+ ty:: FnDef ( def_id, generic_args) => {
1093+ TyKind :: RigidTy ( RigidTy :: FnDef ( tables. fn_def ( * def_id) , generic_args. stable ( tables) ) )
1094+ }
10981095 ty:: FnPtr ( poly_fn_sig) => TyKind :: RigidTy ( RigidTy :: FnPtr ( poly_fn_sig. stable ( tables) ) ) ,
10991096 ty:: Dynamic ( existential_predicates, region, dyn_kind) => {
11001097 TyKind :: RigidTy ( RigidTy :: Dynamic (
@@ -1107,11 +1104,11 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
11071104 ) )
11081105 }
11091106 ty:: Closure ( def_id, generic_args) => TyKind :: RigidTy ( RigidTy :: Closure (
1110- rustc_internal :: closure_def ( * def_id) ,
1107+ tables . closure_def ( * def_id) ,
11111108 generic_args. stable ( tables) ,
11121109 ) ) ,
11131110 ty:: Generator ( def_id, generic_args, movability) => TyKind :: RigidTy ( RigidTy :: Generator (
1114- rustc_internal :: generator_def ( * def_id) ,
1111+ tables . generator_def ( * def_id) ,
11151112 generic_args. stable ( tables) ,
11161113 movability. stable ( tables) ,
11171114 ) ) ,
@@ -1223,7 +1220,7 @@ impl<'tcx> Stable<'tcx> for ty::TraitDef {
12231220 use stable_mir:: ty:: TraitDecl ;
12241221
12251222 TraitDecl {
1226- def_id : rustc_internal :: trait_def ( self . def_id ) ,
1223+ def_id : tables . trait_def ( self . def_id ) ,
12271224 unsafety : self . unsafety . stable ( tables) ,
12281225 paren_sugar : self . paren_sugar ,
12291226 has_auto_impl : self . has_auto_impl ,
@@ -1272,7 +1269,7 @@ impl<'tcx> Stable<'tcx> for ty::TraitRef<'tcx> {
12721269 fn stable ( & self , tables : & mut Tables < ' tcx > ) -> Self :: T {
12731270 use stable_mir:: ty:: TraitRef ;
12741271
1275- TraitRef { def_id : rustc_internal :: trait_def ( self . def_id ) , args : self . args . stable ( tables) }
1272+ TraitRef { def_id : tables . trait_def ( self . def_id ) , args : self . args . stable ( tables) }
12761273 }
12771274}
12781275
0 commit comments