@@ -249,12 +249,12 @@ pub fn trans_method_callee(bcx: block,
249249 None => fail!(~" trans_method_callee: missing param_substs")
250250 }
251251 }
252- typeck::method_trait(_, off, vstore ) => {
252+ typeck::method_trait(_, off, store ) => {
253253 trans_trait_callee(bcx,
254254 callee_id,
255255 off,
256256 self,
257- vstore ,
257+ store ,
258258 mentry.explicit_self)
259259 }
260260 typeck::method_self(*) | typeck::method_super(*) => {
@@ -570,7 +570,7 @@ pub fn trans_trait_callee(bcx: block,
570570 callee_id: ast::node_id,
571571 n_method: uint,
572572 self_expr: @ast::expr,
573- vstore : ty::vstore ,
573+ store : ty::TraitStore ,
574574 explicit_self: ast::self_ty_)
575575 -> Callee {
576576 //!
@@ -599,15 +599,15 @@ pub fn trans_trait_callee(bcx: block,
599599 callee_ty,
600600 n_method,
601601 llpair,
602- vstore ,
602+ store ,
603603 explicit_self)
604604}
605605
606606pub fn trans_trait_callee_from_llval(bcx: block,
607607 callee_ty: ty::t,
608608 n_method: uint,
609609 llpair: ValueRef,
610- vstore : ty::vstore ,
610+ store : ty::TraitStore ,
611611 explicit_self: ast::self_ty_)
612612 -> Callee {
613613 //!
@@ -641,16 +641,15 @@ pub fn trans_trait_callee_from_llval(bcx: block,
641641 }
642642 ast::sty_by_ref => {
643643 // We need to pass a pointer to a pointer to the payload.
644- match vstore {
645- ty::vstore_box | ty::vstore_uniq => {
644+ match store {
645+ ty::BoxTraitStore |
646+ ty::BareTraitStore |
647+ ty::UniqTraitStore => {
646648 llself = GEPi(bcx, llbox, [0u, abi::box_field_body]);
647649 }
648- ty::vstore_slice (_) => {
650+ ty::RegionTraitStore (_) => {
649651 llself = llbox;
650652 }
651- ty::vstore_fixed(*) => {
652- bcx.tcx().sess.bug(~" vstore_fixed trait ");
653- }
654653 }
655654
656655 self_mode = ast::by_ref;
@@ -662,16 +661,15 @@ pub fn trans_trait_callee_from_llval(bcx: block,
662661 ast::sty_region(_) => {
663662 // As before, we need to pass a pointer to a pointer to the
664663 // payload.
665- match vstore {
666- ty::vstore_box | ty::vstore_uniq => {
664+ match store {
665+ ty::BoxTraitStore |
666+ ty::BareTraitStore |
667+ ty::UniqTraitStore => {
667668 llself = GEPi(bcx, llbox, [0u, abi::box_field_body]);
668669 }
669- ty::vstore_slice (_) => {
670+ ty::RegionTraitStore (_) => {
670671 llself = llbox;
671672 }
672- ty::vstore_fixed(*) => {
673- bcx.tcx().sess.bug(~" vstore_fixed trait ");
674- }
675673 }
676674
677675 let llscratch = alloca(bcx, val_ty(llself));
@@ -687,8 +685,8 @@ pub fn trans_trait_callee_from_llval(bcx: block,
687685 bcx = glue:: take_ty( bcx, llbox, callee_ty) ;
688686
689687 // Pass a pointer to the box.
690- match vstore {
691- ty:: vstore_box => llself = llbox,
688+ match store {
689+ ty:: BoxTraitStore | ty :: BareTraitStore => llself = llbox,
692690 _ => bcx. tcx( ) . sess. bug( ~"@self receiver with non-@Trait ")
693691 }
694692
@@ -700,8 +698,8 @@ pub fn trans_trait_callee_from_llval(bcx: block,
700698 }
701699 ast::sty_uniq(_) => {
702700 // Pass the unique pointer.
703- match vstore {
704- ty::vstore_uniq => llself = llbox,
701+ match store {
702+ ty::UniqTraitStore => llself = llbox,
705703 _ => bcx.tcx().sess.bug(~" ~self receiver with non-~Trait ")
706704 }
707705
@@ -796,7 +794,9 @@ pub fn make_impl_vtable(ccx: @CrateContext,
796794 // XXX: This should support multiple traits.
797795 let trt_id = driver::session::expect(
798796 tcx.sess,
799- ty::ty_to_def_id(ty::impl_traits(tcx, impl_id, ty::vstore_box)[0]),
797+ ty::ty_to_def_id(ty::impl_traits(tcx,
798+ impl_id,
799+ ty::BoxTraitStore)[0]),
800800 || ~" make_impl_vtable: non-trait -type implemented");
801801
802802 let has_tps = (*ty::lookup_item_type(ccx.tcx, impl_id).bounds).len() > 0u;
@@ -834,7 +834,7 @@ pub fn trans_trait_cast(bcx: block,
834834 val: @ast::expr,
835835 id: ast::node_id,
836836 dest: expr::Dest,
837- vstore : ty::vstore )
837+ store : ty::TraitStore )
838838 -> block {
839839 let mut bcx = bcx;
840840 let _icx = bcx.insn_ctxt(" impl :: trans_cast" ) ;
@@ -849,16 +849,16 @@ pub fn trans_trait_cast(bcx: block,
849849 let ccx = bcx. ccx( ) ;
850850 let v_ty = expr_ty( bcx, val) ;
851851
852- match vstore {
853- ty::vstore_slice(* ) | ty::vstore_box => {
852+ match store {
853+ ty:: RegionTraitStore ( _ ) | ty:: BoxTraitStore | ty :: BareTraitStore => {
854854 let mut llboxdest = GEPi ( bcx, lldest, [ 0 u, 1 u] ) ;
855855 // Just store the pointer into the pair.
856856 llboxdest = PointerCast ( bcx,
857857 llboxdest,
858858 T_ptr ( type_of( bcx. ccx( ) , v_ty) ) ) ;
859859 bcx = expr:: trans_into( bcx, val, SaveIn ( llboxdest) ) ;
860860 }
861- ty::vstore_uniq => {
861+ ty:: UniqTraitStore => {
862862 // Translate the uniquely-owned value into the second element of
863863 // the triple. (The first element is the vtable.)
864864 let mut llvaldest = GEPi ( bcx, lldest, [ 0 , 1 ] ) ;
@@ -874,10 +874,6 @@ pub fn trans_trait_cast(bcx: block,
874874 let lltydescdest = GEPi ( bcx, lldest, [ 0 , 2 ] ) ;
875875 Store ( bcx, tydesc. tydesc, lltydescdest) ;
876876 }
877- _ => {
878- bcx.tcx().sess.span_bug(val.span, ~" unexpected vstore in \
879- trans_trait_cast" ) ;
880- }
881877 }
882878
883879 // Store the vtable into the pair or triple.
0 commit comments