7
7
//!
8
8
//! For now, we are developing everything inside `rustc`, thus, we keep this module private.
9
9
10
- use crate :: rustc_internal:: { self , opaque} ;
10
+ use crate :: rustc_internal:: opaque;
11
11
use crate :: stable_mir:: mir:: { CopyNonOverlapping , UserTypeProjection , VariantIdx } ;
12
12
use crate :: stable_mir:: ty:: {
13
13
FloatTy , GenericParamDef , IntTy , Movability , RigidTy , Span , TyKind , UintTy ,
@@ -276,7 +276,7 @@ impl<'tcx> Stable<'tcx> for mir::Rvalue<'tcx> {
276
276
place. stable ( tables) ,
277
277
) ,
278
278
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) )
280
280
}
281
281
AddressOf ( mutability, place) => {
282
282
stable_mir:: mir:: Rvalue :: AddressOf ( mutability. stable ( tables) , place. stable ( tables) )
@@ -739,7 +739,7 @@ impl<'tcx> Stable<'tcx> for mir::AggregateKind<'tcx> {
739
739
mir:: AggregateKind :: Tuple => stable_mir:: mir:: AggregateKind :: Tuple ,
740
740
mir:: AggregateKind :: Adt ( def_id, var_idx, generic_arg, user_ty_index, field_idx) => {
741
741
stable_mir:: mir:: AggregateKind :: Adt (
742
- rustc_internal :: adt_def ( * def_id) ,
742
+ tables . adt_def ( * def_id) ,
743
743
var_idx. index ( ) ,
744
744
generic_arg. stable ( tables) ,
745
745
user_ty_index. map ( |idx| idx. index ( ) ) ,
@@ -748,13 +748,13 @@ impl<'tcx> Stable<'tcx> for mir::AggregateKind<'tcx> {
748
748
}
749
749
mir:: AggregateKind :: Closure ( def_id, generic_arg) => {
750
750
stable_mir:: mir:: AggregateKind :: Closure (
751
- rustc_internal :: closure_def ( * def_id) ,
751
+ tables . closure_def ( * def_id) ,
752
752
generic_arg. stable ( tables) ,
753
753
)
754
754
}
755
755
mir:: AggregateKind :: Generator ( def_id, generic_arg, movability) => {
756
756
stable_mir:: mir:: AggregateKind :: Generator (
757
- rustc_internal :: generator_def ( * def_id) ,
757
+ tables . generator_def ( * def_id) ,
758
758
generic_arg. stable ( tables) ,
759
759
movability. stable ( tables) ,
760
760
)
@@ -964,13 +964,13 @@ impl<'tcx> Stable<'tcx> for ty::FnSig<'tcx> {
964
964
impl < ' tcx > Stable < ' tcx > for ty:: BoundTyKind {
965
965
type T = stable_mir:: ty:: BoundTyKind ;
966
966
967
- fn stable ( & self , _ : & mut Tables < ' tcx > ) -> Self :: T {
967
+ fn stable ( & self , tables : & mut Tables < ' tcx > ) -> Self :: T {
968
968
use stable_mir:: ty:: BoundTyKind ;
969
969
970
970
match self {
971
971
ty:: BoundTyKind :: Anon => BoundTyKind :: Anon ,
972
972
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 ( ) )
974
974
}
975
975
}
976
976
}
@@ -987,7 +987,7 @@ impl<'tcx> Stable<'tcx> for ty::BoundRegionKind {
987
987
BoundRegionKind :: BrAnon ( option_span. map ( |span| span. stable ( tables) ) )
988
988
}
989
989
ty:: BoundRegionKind :: BrNamed ( def_id, symbol) => {
990
- BoundRegionKind :: BrNamed ( rustc_internal :: br_named_def ( * def_id) , symbol. to_string ( ) )
990
+ BoundRegionKind :: BrNamed ( tables . br_named_def ( * def_id) , symbol. to_string ( ) )
991
991
}
992
992
ty:: BoundRegionKind :: BrEnv => BoundRegionKind :: BrEnv ,
993
993
}
@@ -1074,12 +1074,10 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
1074
1074
ty:: Uint ( uint_ty) => TyKind :: RigidTy ( RigidTy :: Uint ( uint_ty. stable ( tables) ) ) ,
1075
1075
ty:: Float ( float_ty) => TyKind :: RigidTy ( RigidTy :: Float ( float_ty. stable ( tables) ) ) ,
1076
1076
ty:: Adt ( adt_def, generic_args) => TyKind :: RigidTy ( RigidTy :: Adt (
1077
- rustc_internal :: adt_def ( adt_def. did ( ) ) ,
1077
+ tables . adt_def ( adt_def. did ( ) ) ,
1078
1078
generic_args. stable ( tables) ,
1079
1079
) ) ,
1080
- ty:: Foreign ( def_id) => {
1081
- TyKind :: RigidTy ( RigidTy :: Foreign ( rustc_internal:: foreign_def ( * def_id) ) )
1082
- }
1080
+ ty:: Foreign ( def_id) => TyKind :: RigidTy ( RigidTy :: Foreign ( tables. foreign_def ( * def_id) ) ) ,
1083
1081
ty:: Str => TyKind :: RigidTy ( RigidTy :: Str ) ,
1084
1082
ty:: Array ( ty, constant) => {
1085
1083
TyKind :: RigidTy ( RigidTy :: Array ( tables. intern_ty ( * ty) , constant. stable ( tables) ) )
@@ -1093,10 +1091,9 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
1093
1091
tables. intern_ty ( * ty) ,
1094
1092
mutbl. stable ( tables) ,
1095
1093
) ) ,
1096
- ty:: FnDef ( def_id, generic_args) => TyKind :: RigidTy ( RigidTy :: FnDef (
1097
- rustc_internal:: fn_def ( * def_id) ,
1098
- generic_args. stable ( tables) ,
1099
- ) ) ,
1094
+ ty:: FnDef ( def_id, generic_args) => {
1095
+ TyKind :: RigidTy ( RigidTy :: FnDef ( tables. fn_def ( * def_id) , generic_args. stable ( tables) ) )
1096
+ }
1100
1097
ty:: FnPtr ( poly_fn_sig) => TyKind :: RigidTy ( RigidTy :: FnPtr ( poly_fn_sig. stable ( tables) ) ) ,
1101
1098
ty:: Dynamic ( existential_predicates, region, dyn_kind) => {
1102
1099
TyKind :: RigidTy ( RigidTy :: Dynamic (
@@ -1109,11 +1106,11 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
1109
1106
) )
1110
1107
}
1111
1108
ty:: Closure ( def_id, generic_args) => TyKind :: RigidTy ( RigidTy :: Closure (
1112
- rustc_internal :: closure_def ( * def_id) ,
1109
+ tables . closure_def ( * def_id) ,
1113
1110
generic_args. stable ( tables) ,
1114
1111
) ) ,
1115
1112
ty:: Generator ( def_id, generic_args, movability) => TyKind :: RigidTy ( RigidTy :: Generator (
1116
- rustc_internal :: generator_def ( * def_id) ,
1113
+ tables . generator_def ( * def_id) ,
1117
1114
generic_args. stable ( tables) ,
1118
1115
movability. stable ( tables) ,
1119
1116
) ) ,
@@ -1229,7 +1226,7 @@ impl<'tcx> Stable<'tcx> for ty::TraitDef {
1229
1226
use stable_mir:: ty:: TraitDecl ;
1230
1227
1231
1228
TraitDecl {
1232
- def_id : rustc_internal :: trait_def ( self . def_id ) ,
1229
+ def_id : tables . trait_def ( self . def_id ) ,
1233
1230
unsafety : self . unsafety . stable ( tables) ,
1234
1231
paren_sugar : self . paren_sugar ,
1235
1232
has_auto_impl : self . has_auto_impl ,
@@ -1278,7 +1275,7 @@ impl<'tcx> Stable<'tcx> for ty::TraitRef<'tcx> {
1278
1275
fn stable ( & self , tables : & mut Tables < ' tcx > ) -> Self :: T {
1279
1276
use stable_mir:: ty:: TraitRef ;
1280
1277
1281
- TraitRef { def_id : rustc_internal :: trait_def ( self . def_id ) , args : self . args . stable ( tables) }
1278
+ TraitRef { def_id : tables . trait_def ( self . def_id ) , args : self . args . stable ( tables) }
1282
1279
}
1283
1280
}
1284
1281
0 commit comments