@@ -22,7 +22,6 @@ use middle::cfg;
2222use middle:: def;
2323use middle:: infer;
2424use middle:: lang_items:: LangItem ;
25- use middle:: mem_categorization as mc;
2625use middle:: mem_categorization:: Typer ;
2726use middle:: ty:: ClosureTyper ;
2827use middle:: region;
@@ -48,7 +47,7 @@ use util::nodemap::{FnvHashMap, NodeMap};
4847use arena:: TypedArena ;
4948use libc:: { c_uint, c_char} ;
5049use std:: ffi:: CString ;
51- use std:: cell:: { Cell , RefCell , Ref } ;
50+ use std:: cell:: { Cell , RefCell } ;
5251use std:: result:: Result as StdResult ;
5352use std:: vec:: Vec ;
5453use syntax:: ast;
@@ -577,95 +576,6 @@ impl<'blk, 'tcx> BlockS<'blk, 'tcx> {
577576 }
578577}
579578
580- impl < ' blk , ' tcx > mc:: Typer < ' tcx > for BlockS < ' blk , ' tcx > {
581- fn node_ty ( & self , id : ast:: NodeId ) -> mc:: McResult < Ty < ' tcx > > {
582- Ok ( node_id_type ( self , id) )
583- }
584-
585- fn expr_ty_adjusted ( & self , expr : & ast:: Expr ) -> mc:: McResult < Ty < ' tcx > > {
586- Ok ( expr_ty_adjusted ( self , expr) )
587- }
588-
589- fn node_method_ty ( & self , method_call : ty:: MethodCall ) -> Option < Ty < ' tcx > > {
590- self . tcx ( )
591- . tables
592- . borrow ( )
593- . method_map
594- . get ( & method_call)
595- . map ( |method| monomorphize_type ( self , method. ty ) )
596- }
597-
598- fn node_method_origin ( & self , method_call : ty:: MethodCall )
599- -> Option < ty:: MethodOrigin < ' tcx > >
600- {
601- self . tcx ( )
602- . tables
603- . borrow ( )
604- . method_map
605- . get ( & method_call)
606- . map ( |method| method. origin . clone ( ) )
607- }
608-
609- fn adjustments < ' a > ( & ' a self ) -> Ref < NodeMap < ty:: AutoAdjustment < ' tcx > > > {
610- // FIXME (@jroesch): this is becuase we currently have a HR inference problem
611- // in the snapshot that causes this code not to work.
612- fn project_adjustments < ' a , ' tcx > ( tables : & ' a ty:: Tables < ' tcx > ) ->
613- & ' a NodeMap < ty:: AutoAdjustment < ' tcx > > {
614- & tables. adjustments
615- }
616-
617- Ref :: map ( self . tcx ( ) . tables . borrow ( ) , project_adjustments)
618- }
619-
620- fn is_method_call ( & self , id : ast:: NodeId ) -> bool {
621- self . tcx ( ) . tables . borrow ( ) . method_map . contains_key ( & ty:: MethodCall :: expr ( id) )
622- }
623-
624- fn temporary_scope ( & self , rvalue_id : ast:: NodeId ) -> Option < region:: CodeExtent > {
625- self . tcx ( ) . region_maps . temporary_scope ( rvalue_id)
626- }
627-
628- fn upvar_capture ( & self , upvar_id : ty:: UpvarId ) -> Option < ty:: UpvarCapture > {
629- Some ( self . tcx ( ) . tables . borrow ( ) . upvar_capture_map . get ( & upvar_id) . unwrap ( ) . clone ( ) )
630- }
631-
632- fn type_moves_by_default ( & self , ty : Ty < ' tcx > , span : Span ) -> bool {
633- ty. moves_by_default ( & self . fcx . param_env , span)
634- }
635- }
636-
637- impl < ' blk , ' tcx > ty:: ClosureTyper < ' tcx > for BlockS < ' blk , ' tcx > {
638- fn param_env < ' a > ( & ' a self ) -> & ' a ty:: ParameterEnvironment < ' a , ' tcx > {
639- & self . fcx . param_env
640- }
641-
642- fn closure_kind ( & self ,
643- def_id : ast:: DefId )
644- -> Option < ty:: ClosureKind >
645- {
646- let infcx = infer:: normalizing_infer_ctxt ( self . tcx ( ) , & self . tcx ( ) . tables ) ;
647- infcx. closure_kind ( def_id)
648- }
649-
650- fn closure_type ( & self ,
651- def_id : ast:: DefId ,
652- substs : & subst:: Substs < ' tcx > )
653- -> ty:: ClosureTy < ' tcx >
654- {
655- let infcx = infer:: normalizing_infer_ctxt ( self . tcx ( ) , & self . tcx ( ) . tables ) ;
656- infcx. closure_type ( def_id, substs)
657- }
658-
659- fn closure_upvars ( & self ,
660- def_id : ast:: DefId ,
661- substs : & Substs < ' tcx > )
662- -> Option < Vec < ty:: ClosureUpvar < ' tcx > > >
663- {
664- let infcx = infer:: new_infer_ctxt ( self . tcx ( ) , & self . tcx ( ) . tables , None , true ) ;
665- infcx. closure_upvars ( def_id, substs)
666- }
667- }
668-
669579pub struct Result < ' blk , ' tcx : ' blk > {
670580 pub bcx : Block < ' blk , ' tcx > ,
671581 pub val : ValueRef
0 commit comments