@@ -27,6 +27,7 @@ use metadata::tydecode;
2727use metadata:: tydecode:: { DefIdSource , NominalType , TypeWithId } ;
2828use metadata:: tydecode:: { RegionParameter , ClosureSource } ;
2929use metadata:: tyencode;
30+ use middle:: ty:: adjustment;
3031use middle:: ty:: cast;
3132use middle:: check_const:: ConstQualif ;
3233use middle:: def;
@@ -646,11 +647,11 @@ trait rbml_writer_helpers<'tcx> {
646647 fn emit_builtin_bounds ( & mut self , ecx : & e:: EncodeContext , bounds : & ty:: BuiltinBounds ) ;
647648 fn emit_upvar_capture ( & mut self , ecx : & e:: EncodeContext , capture : & ty:: UpvarCapture ) ;
648649 fn emit_auto_adjustment < ' a > ( & mut self , ecx : & e:: EncodeContext < ' a , ' tcx > ,
649- adj : & ty :: AutoAdjustment < ' tcx > ) ;
650+ adj : & adjustment :: AutoAdjustment < ' tcx > ) ;
650651 fn emit_autoref < ' a > ( & mut self , ecx : & e:: EncodeContext < ' a , ' tcx > ,
651- autoref : & ty :: AutoRef < ' tcx > ) ;
652+ autoref : & adjustment :: AutoRef < ' tcx > ) ;
652653 fn emit_auto_deref_ref < ' a > ( & mut self , ecx : & e:: EncodeContext < ' a , ' tcx > ,
653- auto_deref_ref : & ty :: AutoDerefRef < ' tcx > ) ;
654+ auto_deref_ref : & adjustment :: AutoDerefRef < ' tcx > ) ;
654655}
655656
656657impl < ' a , ' tcx > rbml_writer_helpers < ' tcx > for Encoder < ' a > {
@@ -771,22 +772,22 @@ impl<'a, 'tcx> rbml_writer_helpers<'tcx> for Encoder<'a> {
771772 }
772773
773774 fn emit_auto_adjustment < ' b > ( & mut self , ecx : & e:: EncodeContext < ' b , ' tcx > ,
774- adj : & ty :: AutoAdjustment < ' tcx > ) {
775+ adj : & adjustment :: AutoAdjustment < ' tcx > ) {
775776 use serialize:: Encoder ;
776777
777778 self . emit_enum ( "AutoAdjustment" , |this| {
778779 match * adj {
779- ty :: AdjustReifyFnPointer => {
780+ adjustment :: AdjustReifyFnPointer => {
780781 this. emit_enum_variant ( "AdjustReifyFnPointer" , 1 , 0 , |_| Ok ( ( ) ) )
781782 }
782783
783- ty :: AdjustUnsafeFnPointer => {
784+ adjustment :: AdjustUnsafeFnPointer => {
784785 this. emit_enum_variant ( "AdjustUnsafeFnPointer" , 2 , 0 , |_| {
785786 Ok ( ( ) )
786787 } )
787788 }
788789
789- ty :: AdjustDerefRef ( ref auto_deref_ref) => {
790+ adjustment :: AdjustDerefRef ( ref auto_deref_ref) => {
790791 this. emit_enum_variant ( "AdjustDerefRef" , 3 , 2 , |this| {
791792 this. emit_enum_variant_arg ( 0 ,
792793 |this| Ok ( this. emit_auto_deref_ref ( ecx, auto_deref_ref) ) )
@@ -797,19 +798,19 @@ impl<'a, 'tcx> rbml_writer_helpers<'tcx> for Encoder<'a> {
797798 }
798799
799800 fn emit_autoref < ' b > ( & mut self , ecx : & e:: EncodeContext < ' b , ' tcx > ,
800- autoref : & ty :: AutoRef < ' tcx > ) {
801+ autoref : & adjustment :: AutoRef < ' tcx > ) {
801802 use serialize:: Encoder ;
802803
803804 self . emit_enum ( "AutoRef" , |this| {
804805 match autoref {
805- & ty :: AutoPtr ( r, m) => {
806+ & adjustment :: AutoPtr ( r, m) => {
806807 this. emit_enum_variant ( "AutoPtr" , 0 , 2 , |this| {
807808 this. emit_enum_variant_arg ( 0 ,
808809 |this| Ok ( this. emit_region ( ecx, * r) ) ) ;
809810 this. emit_enum_variant_arg ( 1 , |this| m. encode ( this) )
810811 } )
811812 }
812- & ty :: AutoUnsafe ( m) => {
813+ & adjustment :: AutoUnsafe ( m) => {
813814 this. emit_enum_variant ( "AutoUnsafe" , 1 , 1 , |this| {
814815 this. emit_enum_variant_arg ( 0 , |this| m. encode ( this) )
815816 } )
@@ -819,7 +820,7 @@ impl<'a, 'tcx> rbml_writer_helpers<'tcx> for Encoder<'a> {
819820 }
820821
821822 fn emit_auto_deref_ref < ' b > ( & mut self , ecx : & e:: EncodeContext < ' b , ' tcx > ,
822- auto_deref_ref : & ty :: AutoDerefRef < ' tcx > ) {
823+ auto_deref_ref : & adjustment :: AutoDerefRef < ' tcx > ) {
823824 use serialize:: Encoder ;
824825
825826 self . emit_struct ( "AutoDerefRef" , 2 , |this| {
@@ -974,7 +975,7 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
974975
975976 if let Some ( adjustment) = tcx. tables . borrow ( ) . adjustments . get ( & id) {
976977 match * adjustment {
977- ty :: AdjustDerefRef ( ref adj) => {
978+ adjustment :: AdjustDerefRef ( ref adj) => {
978979 for autoderef in 0 ..adj. autoderefs {
979980 let method_call = ty:: MethodCall :: autoderef ( id, autoderef as u32 ) ;
980981 if let Some ( method) = tcx. tables . borrow ( ) . method_map . get ( & method_call) {
@@ -1063,17 +1064,17 @@ trait rbml_decoder_decoder_helpers<'tcx> {
10631064 fn read_upvar_capture ( & mut self , dcx : & DecodeContext )
10641065 -> ty:: UpvarCapture ;
10651066 fn read_auto_adjustment < ' a , ' b > ( & mut self , dcx : & DecodeContext < ' a , ' b , ' tcx > )
1066- -> ty :: AutoAdjustment < ' tcx > ;
1067+ -> adjustment :: AutoAdjustment < ' tcx > ;
10671068 fn read_cast_kind < ' a , ' b > ( & mut self , dcx : & DecodeContext < ' a , ' b , ' tcx > )
10681069 -> cast:: CastKind ;
10691070 fn read_closure_kind < ' a , ' b > ( & mut self , dcx : & DecodeContext < ' a , ' b , ' tcx > )
10701071 -> ty:: ClosureKind ;
10711072 fn read_closure_ty < ' a , ' b > ( & mut self , dcx : & DecodeContext < ' a , ' b , ' tcx > )
10721073 -> ty:: ClosureTy < ' tcx > ;
10731074 fn read_auto_deref_ref < ' a , ' b > ( & mut self , dcx : & DecodeContext < ' a , ' b , ' tcx > )
1074- -> ty :: AutoDerefRef < ' tcx > ;
1075+ -> adjustment :: AutoDerefRef < ' tcx > ;
10751076 fn read_autoref < ' a , ' b > ( & mut self , dcx : & DecodeContext < ' a , ' b , ' tcx > )
1076- -> ty :: AutoRef < ' tcx > ;
1077+ -> adjustment :: AutoRef < ' tcx > ;
10771078 fn convert_def_id ( & mut self ,
10781079 dcx : & DecodeContext ,
10791080 source : DefIdSource ,
@@ -1246,30 +1247,30 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
12461247 } ) . unwrap ( )
12471248 }
12481249 fn read_auto_adjustment < ' b , ' c > ( & mut self , dcx : & DecodeContext < ' b , ' c , ' tcx > )
1249- -> ty :: AutoAdjustment < ' tcx > {
1250+ -> adjustment :: AutoAdjustment < ' tcx > {
12501251 self . read_enum ( "AutoAdjustment" , |this| {
12511252 let variants = [ "AdjustReifyFnPointer" , "AdjustUnsafeFnPointer" , "AdjustDerefRef" ] ;
12521253 this. read_enum_variant ( & variants, |this, i| {
12531254 Ok ( match i {
1254- 1 => ty :: AdjustReifyFnPointer ,
1255- 2 => ty :: AdjustUnsafeFnPointer ,
1255+ 1 => adjustment :: AdjustReifyFnPointer ,
1256+ 2 => adjustment :: AdjustUnsafeFnPointer ,
12561257 3 => {
1257- let auto_deref_ref: ty :: AutoDerefRef =
1258+ let auto_deref_ref: adjustment :: AutoDerefRef =
12581259 this. read_enum_variant_arg ( 0 ,
12591260 |this| Ok ( this. read_auto_deref_ref ( dcx) ) ) . unwrap ( ) ;
12601261
1261- ty :: AdjustDerefRef ( auto_deref_ref)
1262+ adjustment :: AdjustDerefRef ( auto_deref_ref)
12621263 }
1263- _ => panic ! ( "bad enum variant for ty ::AutoAdjustment" )
1264+ _ => panic ! ( "bad enum variant for adjustment ::AutoAdjustment" )
12641265 } )
12651266 } )
12661267 } ) . unwrap ( )
12671268 }
12681269
12691270 fn read_auto_deref_ref < ' b , ' c > ( & mut self , dcx : & DecodeContext < ' b , ' c , ' tcx > )
1270- -> ty :: AutoDerefRef < ' tcx > {
1271+ -> adjustment :: AutoDerefRef < ' tcx > {
12711272 self . read_struct ( "AutoDerefRef" , 2 , |this| {
1272- Ok ( ty :: AutoDerefRef {
1273+ Ok ( adjustment :: AutoDerefRef {
12731274 autoderefs : this. read_struct_field ( "autoderefs" , 0 , |this| {
12741275 Decodable :: decode ( this)
12751276 } ) . unwrap ( ) ,
@@ -1296,7 +1297,7 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
12961297 }
12971298
12981299 fn read_autoref < ' b , ' c > ( & mut self , dcx : & DecodeContext < ' b , ' c , ' tcx > )
1299- -> ty :: AutoRef < ' tcx > {
1300+ -> adjustment :: AutoRef < ' tcx > {
13001301 self . read_enum ( "AutoRef" , |this| {
13011302 let variants = [ "AutoPtr" , "AutoUnsafe" ] ;
13021303 this. read_enum_variant ( & variants, |this, i| {
@@ -1311,15 +1312,15 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
13111312 Decodable :: decode ( this)
13121313 } ) . unwrap ( ) ;
13131314
1314- ty :: AutoPtr ( dcx. tcx . mk_region ( r) , m)
1315+ adjustment :: AutoPtr ( dcx. tcx . mk_region ( r) , m)
13151316 }
13161317 1 => {
13171318 let m: hir:: Mutability =
13181319 this. read_enum_variant_arg ( 0 , |this| Decodable :: decode ( this) ) . unwrap ( ) ;
13191320
1320- ty :: AutoUnsafe ( m)
1321+ adjustment :: AutoUnsafe ( m)
13211322 }
1322- _ => panic ! ( "bad enum variant for ty ::AutoRef" )
1323+ _ => panic ! ( "bad enum variant for adjustment ::AutoRef" )
13231324 } )
13241325 } )
13251326 } ) . unwrap ( )
@@ -1467,7 +1468,8 @@ fn decode_side_tables(dcx: &DecodeContext,
14671468 dcx. tcx . tables . borrow_mut ( ) . method_map . insert ( method_call, method) ;
14681469 }
14691470 c:: tag_table_adjustments => {
1470- let adj: ty:: AutoAdjustment = val_dsr. read_auto_adjustment ( dcx) ;
1471+ let adj =
1472+ val_dsr. read_auto_adjustment ( dcx) ;
14711473 dcx. tcx . tables . borrow_mut ( ) . adjustments . insert ( id, adj) ;
14721474 }
14731475 c:: tag_table_closure_tys => {
0 commit comments