Update type visitor to use &Visitor and not @Visitor
This commit is contained in:
parent
66b8ad5867
commit
df016dc4bf
6 changed files with 37 additions and 12 deletions
|
|
@ -348,7 +348,8 @@ pub fn make_visit_glue(bcx: @mut Block, v: ValueRef, t: ty::t) -> @mut Block {
|
|||
let _icx = push_ctxt("make_visit_glue");
|
||||
do with_scope(bcx, None, "visitor cleanup") |bcx| {
|
||||
let mut bcx = bcx;
|
||||
let (visitor_trait, object_ty) = match ty::visitor_object_ty(bcx.tcx()){
|
||||
let (visitor_trait, object_ty) = match ty::visitor_object_ty(bcx.tcx(),
|
||||
ty::re_static) {
|
||||
Ok(pair) => pair,
|
||||
Err(s) => {
|
||||
bcx.tcx().sess.fatal(s);
|
||||
|
|
|
|||
|
|
@ -100,17 +100,13 @@ impl Reflector {
|
|||
debug!("arg %u: %s", i, bcx.val_to_str(*a));
|
||||
}
|
||||
let bool_ty = ty::mk_bool();
|
||||
// XXX: Should not be BoxTraitStore!
|
||||
let result = unpack_result!(bcx, callee::trans_call_inner(
|
||||
self.bcx, None, mth_ty, bool_ty,
|
||||
|bcx| meth::trans_trait_callee_from_llval(bcx,
|
||||
mth_ty,
|
||||
mth_idx,
|
||||
v,
|
||||
ty::BoxTraitStore,
|
||||
ast::sty_region(
|
||||
None,
|
||||
ast::m_imm)),
|
||||
None),
|
||||
ArgVals(args), None, DontAutorefArg));
|
||||
let result = bool_to_i1(bcx, result);
|
||||
let next_bcx = sub_block(bcx, "next");
|
||||
|
|
|
|||
|
|
@ -4487,7 +4487,8 @@ pub fn get_opaque_ty(tcx: ctxt) -> Result<t, ~str> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn visitor_object_ty(tcx: ctxt) -> Result<(@TraitRef, t), ~str> {
|
||||
pub fn visitor_object_ty(tcx: ctxt,
|
||||
region: ty::Region) -> Result<(@TraitRef, t), ~str> {
|
||||
let trait_lang_item = match tcx.lang_items.require(TyVisitorTraitLangItem) {
|
||||
Ok(id) => id,
|
||||
Err(s) => { return Err(s); }
|
||||
|
|
@ -4498,13 +4499,11 @@ pub fn visitor_object_ty(tcx: ctxt) -> Result<(@TraitRef, t), ~str> {
|
|||
tps: ~[]
|
||||
};
|
||||
let trait_ref = @TraitRef { def_id: trait_lang_item, substs: substs };
|
||||
let mut static_trait_bound = EmptyBuiltinBounds();
|
||||
static_trait_bound.add(BoundStatic);
|
||||
Ok((trait_ref,
|
||||
mk_trait(tcx,
|
||||
trait_ref.def_id,
|
||||
trait_ref.substs.clone(),
|
||||
BoxTraitStore,
|
||||
RegionTraitStore(region),
|
||||
ast::m_imm,
|
||||
static_trait_bound)))
|
||||
EmptyBuiltinBounds())))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3437,7 +3437,8 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
|
|||
Ok(t) => t,
|
||||
Err(s) => { tcx.sess.span_fatal(it.span, s); }
|
||||
};
|
||||
let visitor_object_ty = match ty::visitor_object_ty(tcx) {
|
||||
let region = ty::re_bound(ty::br_anon(0));
|
||||
let visitor_object_ty = match ty::visitor_object_ty(tcx, region) {
|
||||
Ok((_, vot)) => vot,
|
||||
Err(s) => { tcx.sess.span_fatal(it.span, s); }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue