Update rustc_driver tests.

This commit is contained in:
Huon Wilson 2014-12-26 17:52:57 +11:00
parent d442f77561
commit 7c21a0ff69

View File

@ -295,13 +295,13 @@ impl<'a, 'tcx> Env<'a, 'tcx> {
}) })
} }
pub fn t_param(&self, space: subst::ParamSpace, index: uint) -> Ty<'tcx> { pub fn t_param(&self, space: subst::ParamSpace, index: u32) -> Ty<'tcx> {
ty::mk_param(self.infcx.tcx, space, index, ast_util::local_def(ast::DUMMY_NODE_ID)) ty::mk_param(self.infcx.tcx, space, index, ast_util::local_def(ast::DUMMY_NODE_ID))
} }
pub fn re_early_bound(&self, pub fn re_early_bound(&self,
space: subst::ParamSpace, space: subst::ParamSpace,
index: uint, index: u32,
name: &'static str) name: &'static str)
-> ty::Region -> ty::Region
{ {
@ -309,44 +309,48 @@ impl<'a, 'tcx> Env<'a, 'tcx> {
ty::ReEarlyBound(ast::DUMMY_NODE_ID, space, index, name) ty::ReEarlyBound(ast::DUMMY_NODE_ID, space, index, name)
} }
pub fn re_late_bound_with_debruijn(&self, id: uint, debruijn: ty::DebruijnIndex) -> ty::Region { pub fn re_late_bound_with_debruijn(&self, id: u32, debruijn: ty::DebruijnIndex) -> ty::Region {
ty::ReLateBound(debruijn, ty::BrAnon(id)) ty::ReLateBound(debruijn, ty::BrAnon(id))
} }
pub fn t_rptr(&self, r: ty::Region) -> Ty<'tcx> { pub fn t_rptr(&self, r: ty::Region) -> Ty<'tcx> {
ty::mk_imm_rptr(self.infcx.tcx, r, ty::mk_int()) ty::mk_imm_rptr(self.infcx.tcx, self.infcx.tcx.mk_region(r), ty::mk_int())
} }
pub fn t_rptr_late_bound(&self, id: uint) -> Ty<'tcx> { pub fn t_rptr_late_bound(&self, id: u32) -> Ty<'tcx> {
let r = self.re_late_bound_with_debruijn(id, ty::DebruijnIndex::new(1));
ty::mk_imm_rptr(self.infcx.tcx, ty::mk_imm_rptr(self.infcx.tcx,
self.re_late_bound_with_debruijn(id, ty::DebruijnIndex::new(1)), self.infcx.tcx.mk_region(r),
ty::mk_int()) ty::mk_int())
} }
pub fn t_rptr_late_bound_with_debruijn(&self, pub fn t_rptr_late_bound_with_debruijn(&self,
id: uint, id: u32,
debruijn: ty::DebruijnIndex) debruijn: ty::DebruijnIndex)
-> Ty<'tcx> { -> Ty<'tcx> {
let r = self.re_late_bound_with_debruijn(id, debruijn);
ty::mk_imm_rptr(self.infcx.tcx, ty::mk_imm_rptr(self.infcx.tcx,
self.re_late_bound_with_debruijn(id, debruijn), self.infcx.tcx.mk_region(r),
ty::mk_int()) ty::mk_int())
} }
pub fn t_rptr_scope(&self, id: ast::NodeId) -> Ty<'tcx> { pub fn t_rptr_scope(&self, id: ast::NodeId) -> Ty<'tcx> {
ty::mk_imm_rptr(self.infcx.tcx, ty::ReScope(CodeExtent::from_node_id(id)), ty::mk_int()) let r = ty::ReScope(CodeExtent::from_node_id(id));
ty::mk_imm_rptr(self.infcx.tcx, self.infcx.tcx.mk_region(r), ty::mk_int())
} }
pub fn re_free(&self, nid: ast::NodeId, id: uint) -> ty::Region { pub fn re_free(&self, nid: ast::NodeId, id: u32) -> ty::Region {
ty::ReFree(ty::FreeRegion { scope: CodeExtent::from_node_id(nid), ty::ReFree(ty::FreeRegion { scope: CodeExtent::from_node_id(nid),
bound_region: ty::BrAnon(id)}) bound_region: ty::BrAnon(id)})
} }
pub fn t_rptr_free(&self, nid: ast::NodeId, id: uint) -> Ty<'tcx> { pub fn t_rptr_free(&self, nid: ast::NodeId, id: u32) -> Ty<'tcx> {
ty::mk_imm_rptr(self.infcx.tcx, self.re_free(nid, id), ty::mk_int()) let r = self.re_free(nid, id);
ty::mk_imm_rptr(self.infcx.tcx, self.infcx.tcx.mk_region(r), ty::mk_int())
} }
pub fn t_rptr_static(&self) -> Ty<'tcx> { pub fn t_rptr_static(&self) -> Ty<'tcx> {
ty::mk_imm_rptr(self.infcx.tcx, ty::ReStatic, ty::mk_int()) ty::mk_imm_rptr(self.infcx.tcx, self.infcx.tcx.mk_region(ty::ReStatic), ty::mk_int())
} }
pub fn dummy_type_trace(&self) -> infer::TypeTrace<'tcx> { pub fn dummy_type_trace(&self) -> infer::TypeTrace<'tcx> {