@@ -20,7 +20,7 @@ use middle::def;
2020use metadata:: encoder as e;
2121use middle:: region;
2222use metadata:: tydecode;
23- use metadata:: tydecode:: { DefIdSource , NominalType , TypeWithId , TypeParameter } ;
23+ use metadata:: tydecode:: { DefIdSource , NominalType , TypeWithId } ;
2424use metadata:: tydecode:: { RegionParameter , ClosureSource } ;
2525use metadata:: tyencode;
2626use middle:: cast;
@@ -346,13 +346,6 @@ impl<D:serialize::Decoder> def_id_decoder_helpers for D
346346// ______________________________________________________________________
347347// Encoding and decoding the AST itself
348348//
349- // The hard work is done by an autogenerated module astencode_gen. To
350- // regenerate astencode_gen, run src/etc/gen-astencode. It will
351- // replace astencode_gen with a dummy file and regenerate its
352- // contents. If you get compile errors, the dummy file
353- // remains---resolve the errors and then rerun astencode_gen.
354- // Annoying, I know, but hopefully only temporary.
355- //
356349// When decoding, we have to renumber the AST so that the node ids that
357350// appear within are disjoint from the node ids in our existing ASTs.
358351// We also have to adjust the spans: for now we just insert a dummy span,
@@ -656,35 +649,6 @@ impl<'a, 'tcx> read_method_callee_helper<'tcx> for reader::Decoder<'a> {
656649 }
657650}
658651
659- impl < ' tcx > tr for MethodOrigin < ' tcx > {
660- fn tr ( & self , dcx : & DecodeContext ) -> MethodOrigin < ' tcx > {
661- match * self {
662- ty:: MethodStatic ( did) => ty:: MethodStatic ( did. tr ( dcx) ) ,
663- ty:: MethodStaticClosure ( did) => {
664- ty:: MethodStaticClosure ( did. tr ( dcx) )
665- }
666- ty:: MethodTypeParam ( ref mp) => {
667- ty:: MethodTypeParam (
668- ty:: MethodParam {
669- // def-id is already translated when we read it out
670- trait_ref : mp. trait_ref . clone ( ) ,
671- method_num : mp. method_num ,
672- impl_def_id : mp. impl_def_id . tr ( dcx) ,
673- }
674- )
675- }
676- ty:: MethodTraitObject ( ref mo) => {
677- ty:: MethodTraitObject (
678- ty:: MethodObject {
679- trait_ref : mo. trait_ref . clone ( ) ,
680- .. * mo
681- }
682- )
683- }
684- }
685- }
686- }
687-
688652pub fn encode_closure_kind ( ebml_w : & mut Encoder , kind : ty:: ClosureKind ) {
689653 kind. encode ( ebml_w) . unwrap ( ) ;
690654}
@@ -1473,10 +1437,10 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
14731437 -> subst:: Substs < ' tcx > {
14741438 self . read_opaque ( |this, doc| {
14751439 Ok ( tydecode:: parse_substs_data ( doc. data ,
1476- dcx. cdata . cnum ,
1477- doc. start ,
1478- dcx. tcx ,
1479- |s, a| this. convert_def_id ( dcx, s, a) ) )
1440+ dcx. cdata . cnum ,
1441+ doc. start ,
1442+ dcx. tcx ,
1443+ |s, a| this. convert_def_id ( dcx, s, a) ) )
14801444 } ) . unwrap ( )
14811445 }
14821446
@@ -1617,7 +1581,7 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
16171581 -> ast:: DefId {
16181582 let r = match source {
16191583 NominalType | TypeWithId | RegionParameter => dcx. tr_def_id ( did) ,
1620- TypeParameter | ClosureSource => dcx. tr_intern_def_id ( did)
1584+ ClosureSource => dcx. tr_intern_def_id ( did)
16211585 } ;
16221586 debug ! ( "convert_def_id(source={:?}, did={:?})={:?}" , source, did, r) ;
16231587 return r;
0 commit comments