diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2014-01-01 04:09:50 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2014-01-11 16:40:23 +0200 |
| commit | 5ad2a7825bd9821b8ef554046c8d81eb94ab7dfe (patch) | |
| tree | e32969e0b4ada5b6696348cd1bc5bcadbfeea177 | |
| parent | e19b1b129b266900f832a50f0ea50342471e414c (diff) | |
| download | rust-5ad2a7825bd9821b8ef554046c8d81eb94ab7dfe.tar.gz rust-5ad2a7825bd9821b8ef554046c8d81eb94ab7dfe.zip | |
Removed obsolete 'e' prefix on ty_evec and ty_estr.
33 files changed, 234 insertions, 235 deletions
diff --git a/src/librustc/metadata/tydecode.rs b/src/librustc/metadata/tydecode.rs index 5f57aef2b16..1057340cf58 100644 --- a/src/librustc/metadata/tydecode.rs +++ b/src/librustc/metadata/tydecode.rs @@ -354,11 +354,11 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t { 'V' => { let mt = parse_mt(st, |x,y| conv(x,y)); let v = parse_vstore(st, |x,y| conv(x,y)); - return ty::mk_evec(st.tcx, mt, v); + return ty::mk_vec(st.tcx, mt, v); } 'v' => { let v = parse_vstore(st, |x,y| conv(x,y)); - return ty::mk_estr(st.tcx, v); + return ty::mk_str(st.tcx, v); } 'T' => { assert_eq!(next(st), '['); diff --git a/src/librustc/metadata/tyencode.rs b/src/librustc/metadata/tyencode.rs index 8929859b2d6..dc61c6d4391 100644 --- a/src/librustc/metadata/tyencode.rs +++ b/src/librustc/metadata/tyencode.rs @@ -299,12 +299,12 @@ fn enc_sty(w: &mut MemWriter, cx: @ctxt, st: &ty::sty) { enc_region(w, cx, r); enc_mt(w, cx, mt); } - ty::ty_evec(mt, v) => { + ty::ty_vec(mt, v) => { mywrite!(w, "V"); enc_mt(w, cx, mt); enc_vstore(w, cx, v); } - ty::ty_estr(v) => { + ty::ty_str(v) => { mywrite!(w, "v"); enc_vstore(w, cx, v); } diff --git a/src/librustc/middle/borrowck/gather_loans/mod.rs b/src/librustc/middle/borrowck/gather_loans/mod.rs index e35bafd6ebf..b1337fca0c8 100644 --- a/src/librustc/middle/borrowck/gather_loans/mod.rs +++ b/src/librustc/middle/borrowck/gather_loans/mod.rs @@ -808,7 +808,7 @@ impl<'a> GatherLoanCtxt<'a> { */ match ty::get(slice_ty).sty { - ty::ty_evec(slice_mt, ty::vstore_slice(slice_r)) => { + ty::ty_vec(slice_mt, ty::vstore_slice(slice_r)) => { (slice_mt.mutbl, slice_r) } diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index 47a90311c31..79cb1c779a0 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -195,7 +195,7 @@ fn check_exhaustive(cx: &MatchCheckCtxt, sp: Span, pats: ~[@Pat]) { } } } - ty::ty_unboxed_vec(..) | ty::ty_evec(..) => { + ty::ty_unboxed_vec(..) | ty::ty_vec(..) => { match *ctor { vec(n) => Some(format!("vectors of length {}", n).to_managed()), _ => None @@ -274,10 +274,10 @@ fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful { } not_useful } - ty::ty_evec(_, ty::vstore_fixed(n)) => { + ty::ty_vec(_, ty::vstore_fixed(n)) => { is_useful_specialized(cx, m, v, vec(n), n, left_ty) } - ty::ty_unboxed_vec(..) | ty::ty_evec(..) => { + ty::ty_unboxed_vec(..) | ty::ty_vec(..) => { let max_len = m.rev_iter().fold(0, |max_len, r| { match r[0].node { PatVec(ref before, _, ref after) => { @@ -437,7 +437,7 @@ fn missing_ctor(cx: &MatchCheckCtxt, else if true_found { Some(val(const_bool(false))) } else { Some(val(const_bool(true))) } } - ty::ty_evec(_, ty::vstore_fixed(n)) => { + ty::ty_vec(_, ty::vstore_fixed(n)) => { let mut missing = true; let mut wrong = false; for r in m.iter() { @@ -460,7 +460,7 @@ fn missing_ctor(cx: &MatchCheckCtxt, _ => None } } - ty::ty_unboxed_vec(..) | ty::ty_evec(..) => { + ty::ty_unboxed_vec(..) | ty::ty_vec(..) => { // Find the lengths and slices of all vector patterns. let mut vec_pat_lens = m.iter().filter_map(|r| { @@ -525,7 +525,7 @@ fn ctor_arity(cx: &MatchCheckCtxt, ctor: &ctor, ty: ty::t) -> uint { } } ty::ty_struct(cid, _) => ty::lookup_struct_fields(cx.tcx, cid).len(), - ty::ty_unboxed_vec(..) | ty::ty_evec(..) => { + ty::ty_unboxed_vec(..) | ty::ty_vec(..) => { match *ctor { vec(n) => n, _ => 0u diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index f46e570bb9d..e291d2595a0 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -71,7 +71,7 @@ impl EffectCheckVisitor { debug!("effect: checking index with base type {}", ppaux::ty_to_str(self.tcx, base_type)); match ty::get(base_type).sty { - ty::ty_estr(..) => { + ty::ty_str(..) => { self.tcx.sess.span_err(e.span, "modification of string types is not allowed"); } diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 91eeb7f2aaf..55cb9f87bcd 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -819,13 +819,13 @@ fn check_heap_type(cx: &Context, span: Span, ty: ty::t) { let mut n_uniq = 0; ty::fold_ty(cx.tcx, ty, |t| { match ty::get(t).sty { - ty::ty_box(_) | ty::ty_estr(ty::vstore_box) | - ty::ty_evec(_, ty::vstore_box) | + ty::ty_box(_) | ty::ty_str(ty::vstore_box) | + ty::ty_vec(_, ty::vstore_box) | ty::ty_trait(_, _, ty::BoxTraitStore, _, _) => { n_box += 1; } - ty::ty_uniq(_) | ty::ty_estr(ty::vstore_uniq) | - ty::ty_evec(_, ty::vstore_uniq) | + ty::ty_uniq(_) | ty::ty_str(ty::vstore_uniq) | + ty::ty_vec(_, ty::vstore_uniq) | ty::ty_trait(_, _, ty::UniqTraitStore, _, _) => { n_uniq += 1; } diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 14eb5643147..a00b01d54ce 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -157,14 +157,14 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> { match ty::get(t).sty { ty::ty_uniq(_) | ty::ty_trait(_, _, ty::UniqTraitStore, _, _) | - ty::ty_evec(_, ty::vstore_uniq) | - ty::ty_estr(ty::vstore_uniq) | + ty::ty_vec(_, ty::vstore_uniq) | + ty::ty_str(ty::vstore_uniq) | ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, ..}) => { Some(deref_ptr(uniq_ptr)) } ty::ty_rptr(r, mt) | - ty::ty_evec(mt, ty::vstore_slice(r)) => { + ty::ty_vec(mt, ty::vstore_slice(r)) => { Some(deref_ptr(region_ptr(mt.mutbl, r))) } @@ -172,16 +172,16 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> { Some(deref_ptr(region_ptr(m, r))) } - ty::ty_estr(ty::vstore_slice(r)) | + ty::ty_str(ty::vstore_slice(r)) | ty::ty_closure(ty::ClosureTy {sigil: ast::BorrowedSigil, region: r, ..}) => { Some(deref_ptr(region_ptr(ast::MutImmutable, r))) } ty::ty_box(_) | - ty::ty_evec(_, ty::vstore_box) | + ty::ty_vec(_, ty::vstore_box) | ty::ty_trait(_, _, ty::BoxTraitStore, _, _) | - ty::ty_estr(ty::vstore_box) => { + ty::ty_str(ty::vstore_box) => { Some(deref_ptr(gc_ptr)) } @@ -194,8 +194,8 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> { Some(deref_interior(InteriorField(PositionalField(0)))) } - ty::ty_evec(_, ty::vstore_fixed(_)) | - ty::ty_estr(ty::vstore_fixed(_)) => { + ty::ty_vec(_, ty::vstore_fixed(_)) | + ty::ty_str(ty::vstore_fixed(_)) => { Some(deref_interior(InteriorElement(element_kind(t)))) } @@ -1247,8 +1247,8 @@ impl Repr for InteriorKind { fn element_kind(t: ty::t) -> ElementKind { match ty::get(t).sty { - ty::ty_evec(..) => VecElement, - ty::ty_estr(..) => StrElement, + ty::ty_vec(..) => VecElement, + ty::ty_str(..) => StrElement, _ => OtherElement } } diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs index c6f375bbc1b..07f8bba4464 100644 --- a/src/librustc/middle/trans/_match.rs +++ b/src/librustc/middle/trans/_match.rs @@ -1078,7 +1078,7 @@ fn extract_vec_elems<'a>( let slice_begin = tvec::pointer_add_byte(bcx, base, slice_byte_offset); let slice_len_offset = C_uint(bcx.ccx(), elem_count - 1u); let slice_len = Sub(bcx, len, slice_len_offset); - let slice_ty = ty::mk_evec(bcx.tcx(), + let slice_ty = ty::mk_vec(bcx.tcx(), ty::mt {ty: vt.unit_ty, mutbl: ast::MutImmutable}, ty::vstore_slice(ty::ReStatic) ); @@ -1312,7 +1312,7 @@ fn compare_values<'a>( } match ty::get(rhs_t).sty { - ty::ty_estr(ty::vstore_uniq) => { + ty::ty_str(ty::vstore_uniq) => { let scratch_lhs = alloca(cx, val_ty(lhs), "__lhs"); Store(cx, lhs, scratch_lhs); let scratch_rhs = alloca(cx, val_ty(rhs), "__rhs"); @@ -1326,7 +1326,7 @@ fn compare_values<'a>( val: bool_to_i1(result.bcx, result.val) } } - ty::ty_estr(_) => { + ty::ty_str(_) => { let did = langcall(cx, None, format!("comparison of `{}`", cx.ty_to_str(rhs_t)), StrEqFnLangItem); diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index dbe7a03ad0c..2b39cbf7477 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -241,7 +241,7 @@ fn decl_rust_fn(ccx: &CrateContext, inputs: &[ty::t], output: ty::t, name: &str) } // `~` pointer return values never alias because ownership is transferred ty::ty_uniq(..) | - ty::ty_evec(_, ty::vstore_uniq) => { + ty::ty_vec(_, ty::vstore_uniq) => { unsafe { llvm::LLVMAddReturnAttribute(llfn, lib::llvm::NoAliasAttribute as c_uint); } @@ -257,7 +257,7 @@ fn decl_rust_fn(ccx: &CrateContext, inputs: &[ty::t], output: ty::t, name: &str) match ty::get(arg_ty).sty { // `~` pointer parameters never alias because ownership is transferred ty::ty_uniq(..) | - ty::ty_evec(_, ty::vstore_uniq) | + ty::ty_vec(_, ty::vstore_uniq) | ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, ..}) => { unsafe { llvm::LLVMAddAttribute(llarg, lib::llvm::NoAliasAttribute as c_uint); @@ -758,8 +758,8 @@ pub fn iter_structural_ty<'r, } }) } - ty::ty_estr(ty::vstore_fixed(_)) | - ty::ty_evec(_, ty::vstore_fixed(_)) => { + ty::ty_str(ty::vstore_fixed(_)) | + ty::ty_vec(_, ty::vstore_fixed(_)) => { let (base, len) = tvec::get_base_and_byte_len(cx, av, t); cx = tvec::iter_vec_raw(cx, base, t, len, f); } @@ -3120,12 +3120,12 @@ pub fn create_module_map(ccx: &CrateContext) -> (ValueRef, uint) { }; for key in keys.iter() { - let llestrval = C_estr_slice(ccx, *key); + let llstrval = C_str_slice(ccx, *key); let module_data = ccx.module_data.borrow(); let val = *module_data.get().find_equiv(key).unwrap(); let v_ptr = p2i(ccx, val); let elt = C_struct([ - llestrval, + llstrval, v_ptr ], false); elts.push(elt); diff --git a/src/librustc/middle/trans/callee.rs b/src/librustc/middle/trans/callee.rs index 795ccb200a0..6ef90c57b27 100644 --- a/src/librustc/middle/trans/callee.rs +++ b/src/librustc/middle/trans/callee.rs @@ -704,7 +704,7 @@ pub fn trans_call_inner<'a>( match ty::get(ret_ty).sty { // `~` pointer return values never alias because ownership is transferred ty::ty_uniq(..) | - ty::ty_evec(_, ty::vstore_uniq) => { + ty::ty_vec(_, ty::vstore_uniq) => { attrs.push((0, NoAliasAttribute)); } _ => () diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs index dab701a0e1f..8636a87819c 100644 --- a/src/librustc/middle/trans/common.rs +++ b/src/librustc/middle/trans/common.rs @@ -906,7 +906,7 @@ pub fn C_cstr(cx: &CrateContext, s: @str) -> ValueRef { // NB: Do not use `do_spill_noroot` to make this into a constant string, or // you will be kicked off fast isel. See issue #4352 for an example of this. -pub fn C_estr_slice(cx: &CrateContext, s: @str) -> ValueRef { +pub fn C_str_slice(cx: &CrateContext, s: @str) -> ValueRef { unsafe { let len = s.len(); let cs = llvm::LLVMConstPointerCast(C_cstr(cx, s), Type::i8p().to_ref()); @@ -1045,8 +1045,8 @@ pub fn mono_data_classify(t: ty::t) -> MonoDataClass { ty::ty_float(_) => MonoFloat, ty::ty_rptr(..) | ty::ty_uniq(..) | ty::ty_box(..) | ty::ty_opaque_box(..) | - ty::ty_estr(ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_uniq) | - ty::ty_estr(ty::vstore_box) | ty::ty_evec(_, ty::vstore_box) | + ty::ty_str(ty::vstore_uniq) | ty::ty_vec(_, ty::vstore_uniq) | + ty::ty_str(ty::vstore_box) | ty::ty_vec(_, ty::vstore_box) | ty::ty_bare_fn(..) => MonoNonNull, // Is that everything? Would closures or slices qualify? _ => MonoBits diff --git a/src/librustc/middle/trans/consts.rs b/src/librustc/middle/trans/consts.rs index 8cde68225c9..1f8ac5b5aeb 100644 --- a/src/librustc/middle/trans/consts.rs +++ b/src/librustc/middle/trans/consts.rs @@ -71,7 +71,7 @@ pub fn const_lit(cx: &CrateContext, e: &ast::Expr, lit: ast::Lit) } ast::LitBool(b) => C_bool(b), ast::LitNil => C_nil(), - ast::LitStr(s, _) => C_estr_slice(cx, s), + ast::LitStr(s, _) => C_str_slice(cx, s), ast::LitBinary(data) => C_binary_slice(cx, data), } } @@ -241,7 +241,7 @@ pub fn const_expr(cx: @CrateContext, e: &ast::Expr) -> (ValueRef, bool) { assert_eq!(abi::slice_elt_len, 1); match ty::get(ty).sty { - ty::ty_evec(_, ty::vstore_fixed(len)) => { + ty::ty_vec(_, ty::vstore_fixed(len)) => { llconst = C_struct([llptr, C_uint(cx, len)], false); } _ => {} @@ -419,7 +419,7 @@ fn const_expr_unadjusted(cx: @CrateContext, "index is not an integer-constant expression") }; let (arr, len) = match ty::get(bt).sty { - ty::ty_evec(_, vstore) | ty::ty_estr(vstore) => + ty::ty_vec(_, vstore) | ty::ty_str(vstore) => match vstore { ty::vstore_fixed(u) => (bv, C_uint(cx, u)), @@ -437,7 +437,7 @@ fn const_expr_unadjusted(cx: @CrateContext, let len = llvm::LLVMConstIntGetZExtValue(len) as u64; let len = match ty::get(bt).sty { - ty::ty_estr(..) => {assert!(len > 0); len - 1}, + ty::ty_str(..) => {assert!(len > 0); len - 1}, _ => len }; if iv >= len { diff --git a/src/librustc/middle/trans/datum.rs b/src/librustc/middle/trans/datum.rs index b34e68d9a57..4f94668ebe3 100644 --- a/src/librustc/middle/trans/datum.rs +++ b/src/librustc/middle/trans/datum.rs @@ -571,7 +571,7 @@ impl Datum { let (content_ty, header) = match ty::get(self.ty).sty { ty::ty_box(typ) => (typ, true), ty::ty_uniq(mt) => (mt.ty, false), - ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) => { + ty::ty_vec(_, ty::vstore_uniq) | ty::ty_str(ty::vstore_uniq) => { let unit_ty = ty::sequence_element_type(bcx.tcx(), self.ty); let unboxed_vec_ty = ty::mk_mut_unboxed_vec(bcx.tcx(), unit_ty); (unboxed_vec_ty, true) diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index 11804369a58..88d41f9b1af 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -2115,7 +2115,7 @@ fn type_metadata(cx: &CrateContext, ty::ty_float(_) => { basic_type_metadata(cx, t) }, - ty::ty_estr(ref vstore) => { + ty::ty_str(ref vstore) => { let i8_t = ty::mk_i8(); match *vstore { ty::vstore_fixed(len) => { @@ -2140,7 +2140,7 @@ fn type_metadata(cx: &CrateContext, ty::ty_box(typ) => { create_pointer_to_box_metadata(cx, t, typ) }, - ty::ty_evec(ref mt, ref vstore) => { + ty::ty_vec(ref mt, ref vstore) => { match *vstore { ty::vstore_fixed(len) => { fixed_vec_metadata(cx, mt.ty, len, usage_site_span) diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs index 06a85d70284..689c1ab1e05 100644 --- a/src/librustc/middle/trans/expr.rs +++ b/src/librustc/middle/trans/expr.rs @@ -287,9 +287,9 @@ pub fn trans_to_datum<'a>(bcx: &'a Block<'a>, expr: &ast::Expr) // this type may have a different region/mutability than the // real one, but it will have the same runtime representation - let slice_ty = ty::mk_evec(tcx, - ty::mt { ty: unit_ty, mutbl: ast::MutImmutable }, - ty::vstore_slice(ty::ReStatic)); + let slice_ty = ty::mk_vec(tcx, + ty::mt { ty: unit_ty, mutbl: ast::MutImmutable }, + ty::vstore_slice(ty::ReStatic)); let scratch = scratch_datum(bcx, slice_ty, "__adjust", false); diff --git a/src/librustc/middle/trans/glue.rs b/src/librustc/middle/trans/glue.rs index c93c0db8c3f..5a7a2ba7ffd 100644 --- a/src/librustc/middle/trans/glue.rs +++ b/src/librustc/middle/trans/glue.rs @@ -101,11 +101,11 @@ pub fn free_ty_immediate<'a>(bcx: &'a Block<'a>, v: ValueRef, t: ty::t) let _icx = push_ctxt("free_ty_immediate"); match ty::get(t).sty { ty::ty_uniq(_) | - ty::ty_evec(_, ty::vstore_uniq) | - ty::ty_estr(ty::vstore_uniq) | + ty::ty_vec(_, ty::vstore_uniq) | + ty::ty_str(ty::vstore_uniq) | ty::ty_box(_) | ty::ty_opaque_box | - ty::ty_evec(_, ty::vstore_box) | - ty::ty_estr(ty::vstore_box) | + ty::ty_vec(_, ty::vstore_box) | + ty::ty_str(ty::vstore_box) | ty::ty_opaque_closure_ptr(_) => { let vp = alloca(bcx, type_of(bcx.ccx(), t), ""); Store(bcx, v, vp); @@ -135,8 +135,8 @@ pub fn simplified_glue_type(tcx: ty::ctxt, field: uint, t: ty::t) -> ty::t { match ty::get(t).sty { ty::ty_unboxed_vec(..) | ty::ty_uniq(..) | - ty::ty_estr(ty::vstore_uniq) | - ty::ty_evec(_, ty::vstore_uniq) => { return ty::mk_u32(); } + ty::ty_str(ty::vstore_uniq) | + ty::ty_vec(_, ty::vstore_uniq) => { return ty::mk_u32(); } _ => () } } @@ -153,8 +153,8 @@ pub fn simplified_glue_type(tcx: ty::ctxt, field: uint, t: ty::t) -> ty::t { ty::ty_box(..) | ty::ty_opaque_box | ty::ty_uniq(..) | - ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) | - ty::ty_evec(_, ty::vstore_box) | ty::ty_estr(ty::vstore_box) | + ty::ty_vec(_, ty::vstore_uniq) | ty::ty_str(ty::vstore_uniq) | + ty::ty_vec(_, ty::vstore_box) | ty::ty_str(ty::vstore_box) | ty::ty_opaque_closure_ptr(..) => (), _ => { return ty::mk_u32(); } } @@ -167,12 +167,12 @@ pub fn simplified_glue_type(tcx: ty::ctxt, field: uint, t: ty::t) -> ty::t { if ! ty::type_needs_drop(tcx, typ) => return ty::mk_imm_box(tcx, ty::mk_u32()), - ty::ty_evec(mt, ty::vstore_box) + ty::ty_vec(mt, ty::vstore_box) if ! ty::type_needs_drop(tcx, mt.ty) => return ty::mk_imm_box(tcx, ty::mk_u32()), ty::ty_uniq(mt) | - ty::ty_evec(mt, ty::vstore_uniq) + ty::ty_vec(mt, ty::vstore_uniq) if ! ty::type_needs_drop(tcx, mt.ty) => return ty::mk_imm_uniq(tcx, ty::mk_u32()), @@ -390,8 +390,8 @@ pub fn make_free_glue<'a>(bcx: &'a Block<'a>, v: ValueRef, t: ty::t) ty::ty_uniq(..) => { uniq::make_free_glue(bcx, v, t) } - ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) | - ty::ty_evec(_, ty::vstore_box) | ty::ty_estr(ty::vstore_box) => { + ty::ty_vec(_, ty::vstore_uniq) | ty::ty_str(ty::vstore_uniq) | + ty::ty_vec(_, ty::vstore_box) | ty::ty_str(ty::vstore_box) => { make_free_glue(bcx, v, tvec::expand_boxed_vec_ty(bcx.tcx(), t)) } ty::ty_closure(_) => { @@ -470,11 +470,11 @@ pub fn make_drop_glue<'a>(bcx: &'a Block<'a>, v0: ValueRef, t: ty::t) let ccx = bcx.ccx(); match ty::get(t).sty { ty::ty_box(_) | ty::ty_opaque_box | - ty::ty_estr(ty::vstore_box) | ty::ty_evec(_, ty::vstore_box) => { + ty::ty_str(ty::vstore_box) | ty::ty_vec(_, ty::vstore_box) => { decr_refcnt_maybe_free(bcx, Load(bcx, v0), Some(v0), t) } ty::ty_uniq(_) | - ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) => { + ty::ty_vec(_, ty::vstore_uniq) | ty::ty_str(ty::vstore_uniq) => { free_ty(bcx, v0, t) } ty::ty_unboxed_vec(_) => { @@ -572,11 +572,11 @@ pub fn make_take_glue<'a>(bcx: &'a Block<'a>, v: ValueRef, t: ty::t) // NB: v is a *pointer* to type t here, not a direct value. match ty::get(t).sty { ty::ty_box(_) | ty::ty_opaque_box | - ty::ty_evec(_, ty::vstore_box) | ty::ty_estr(ty::vstore_box) => { + ty::ty_vec(_, ty::vstore_box) | ty::ty_str(ty::vstore_box) => { incr_refcnt_of_boxed(bcx, Load(bcx, v)); bcx } - ty::ty_evec(_, ty::vstore_slice(_)) - | ty::ty_estr(ty::vstore_slice(_)) => { + ty::ty_vec(_, ty::vstore_slice(_)) + | ty::ty_str(ty::vstore_slice(_)) => { bcx } ty::ty_closure(_) => bcx, @@ -654,7 +654,7 @@ pub fn declare_tydesc(ccx: &CrateContext, t: ty::t) -> @tydesc_info { } }); - let ty_name = C_estr_slice(ccx, ppaux::ty_to_str(ccx.tcx, t).to_managed()); + let ty_name = C_str_slice(ccx, ppaux::ty_to_str(ccx.tcx, t).to_managed()); let inf = @tydesc_info { ty: t, diff --git a/src/librustc/middle/trans/reflect.rs b/src/librustc/middle/trans/reflect.rs index 7810a99b273..849fc18ac01 100644 --- a/src/librustc/middle/trans/reflect.rs +++ b/src/librustc/middle/trans/reflect.rs @@ -60,7 +60,7 @@ impl<'a> Reflector<'a> { // will kick us off fast isel. (Issue #4352.) let bcx = self.bcx; let str_vstore = ty::vstore_slice(ty::ReStatic); - let str_ty = ty::mk_estr(bcx.tcx(), str_vstore); + let str_ty = ty::mk_str(bcx.tcx(), str_vstore); let scratch = scratch_datum(bcx, str_ty, "", false); let len = C_uint(bcx.ccx(), s.len()); let c_str = PointerCast(bcx, C_cstr(bcx.ccx(), s), Type::i8p()); @@ -176,11 +176,11 @@ impl<'a> Reflector<'a> { self.visit("vec", values) } - ty::ty_estr(vst) => { + ty::ty_str(vst) => { let (name, extra) = self.vstore_name_and_extra(t, vst); self.visit(~"estr_" + name, extra) } - ty::ty_evec(ref mt, vst) => { + ty::ty_vec(ref mt, vst) => { let (name, extra) = self.vstore_name_and_extra(t, vst); let extra = extra + self.c_mt(mt); if "uniq" == name && ty::type_contents(bcx.tcx(), t).owns_managed() { diff --git a/src/librustc/middle/trans/tvec.rs b/src/librustc/middle/trans/tvec.rs index da7f3068fb9..e8d4381e9f7 100644 --- a/src/librustc/middle/trans/tvec.rs +++ b/src/librustc/middle/trans/tvec.rs @@ -40,10 +40,10 @@ pub fn expand_boxed_vec_ty(tcx: ty::ctxt, t: ty::t) -> ty::t { let unit_ty = ty::sequence_element_type(tcx, t); let unboxed_vec_ty = ty::mk_mut_unboxed_vec(tcx, unit_ty); match ty::get(t).sty { - ty::ty_estr(ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_uniq) => { + ty::ty_str(ty::vstore_uniq) | ty::ty_vec(_, ty::vstore_uniq) => { ty::mk_imm_uniq(tcx, unboxed_vec_ty) } - ty::ty_estr(ty::vstore_box) | ty::ty_evec(_, ty::vstore_box) => { + ty::ty_str(ty::vstore_box) | ty::ty_vec(_, ty::vstore_box) => { ty::mk_imm_box(tcx, unboxed_vec_ty) } _ => tcx.sess.bug("non boxed-vec type \ @@ -239,9 +239,9 @@ pub fn trans_slice_vstore<'a>( let llfixed = base::arrayalloca(bcx, vt.llunit_ty, llcount); // Arrange for the backing array to be cleaned up. - let fixed_ty = ty::mk_evec(bcx.tcx(), - ty::mt {ty: vt.unit_ty, mutbl: ast::MutMutable}, - ty::vstore_fixed(count)); + let fixed_ty = ty::mk_vec(bcx.tcx(), + ty::mt {ty: vt.unit_ty, mutbl: ast::MutMutable}, + ty::vstore_fixed(count)); let llfixed_ty = type_of::type_of(bcx.ccx(), fixed_ty).ptr_to(); let llfixed_casted = BitCast(bcx, llfixed, llfixed_ty); add_clean(bcx, llfixed_casted, fixed_ty); @@ -323,7 +323,7 @@ pub fn trans_uniq_or_managed_vstore<'a>( let llptrval = C_cstr(bcx.ccx(), s); let llptrval = PointerCast(bcx, llptrval, Type::i8p()); let llsizeval = C_uint(bcx.ccx(), s.len()); - let typ = ty::mk_estr(bcx.tcx(), ty::vstore_uniq); + let typ = ty::mk_str(bcx.tcx(), ty::vstore_uniq); let lldestval = scratch_datum(bcx, typ, "", false); let alloc_fn = langcall(bcx, Some(span), "", StrDupUniqFnLangItem); @@ -449,7 +449,7 @@ pub fn write_content<'a>( } _ => { bcx.tcx().sess.span_bug(content_expr.span, - "Unexpected evec content"); + "Unexpected vec content"); } } } @@ -485,7 +485,7 @@ pub fn elements_required(bcx: &Block, content_expr: &ast::Expr) -> uint { ty::eval_repeat_count(&bcx.tcx(), count_expr) } _ => bcx.tcx().sess.span_bug(content_expr.span, - "Unexpected evec content") + "Unexpected vec content") } } @@ -503,7 +503,7 @@ pub fn get_base_and_byte_len(bcx: &Block, llval: ValueRef, vec_ty: ty::t) let vt = vec_types(bcx, vec_ty); let vstore = match ty::get(vt.vec_ty).sty { - ty::ty_estr(vst) | ty::ty_evec(_, vst) => vst, + ty::ty_str(vst) | ty::ty_vec(_, vst) => vst, _ => ty::vstore_uniq }; @@ -540,7 +540,7 @@ pub fn get_base_and_len(bcx: &Block, llval: ValueRef, vec_ty: ty::t) let vt = vec_types(bcx, vec_ty); let vstore = match ty::get(vt.vec_ty).sty { - ty::ty_estr(vst) | ty::ty_evec(_, vst) => vst, + ty::ty_str(vst) | ty::ty_vec(_, vst) => vst, _ => ty::vstore_uniq }; diff --git a/src/librustc/middle/trans/type_of.rs b/src/librustc/middle/trans/type_of.rs index f6fb509e317..8ac35c9e04b 100644 --- a/src/librustc/middle/trans/type_of.rs +++ b/src/librustc/middle/trans/type_of.rs @@ -117,10 +117,10 @@ pub fn sizing_type_of(cx: &CrateContext, t: ty::t) -> Type { ty::ty_uint(t) => Type::uint_from_ty(cx, t), ty::ty_float(t) => Type::float_from_ty(t), - ty::ty_estr(ty::vstore_uniq) | - ty::ty_estr(ty::vstore_box) | - ty::ty_evec(_, ty::vstore_uniq) | - ty::ty_evec(_, ty::vstore_box) | + ty::ty_str(ty::vstore_uniq) | + ty::ty_str(ty::vstore_box) | + ty::ty_vec(_, ty::vstore_uniq) | + ty::ty_vec(_, ty::vstore_box) | ty::ty_box(..) | ty::ty_opaque_box | ty::ty_uniq(..) | @@ -129,8 +129,8 @@ pub fn sizing_type_of(cx: &CrateContext, t: ty::t) -> Type { ty::ty_type | ty::ty_opaque_closure_ptr(..) => Type::i8p(), - ty::ty_estr(ty::vstore_slice(..)) | - ty::ty_evec(_, ty::vstore_slice(..)) => { + ty::ty_str(ty::vstore_slice(..)) | + ty::ty_vec(_, ty::vstore_slice(..)) => { Type::struct_([Type::i8p(), Type::i8p()], false) } @@ -138,8 +138,8 @@ pub fn sizing_type_of(cx: &CrateContext, t: ty::t) -> Type { ty::ty_closure(..) => Type::struct_([Type::i8p(), Type::i8p()], false), ty::ty_trait(_, _, store, _, _) => Type::opaque_trait(cx, store), - ty::ty_estr(ty::vstore_fixed(size)) => Type::array(&Type::i8(), size as u64), - ty::ty_evec(mt, ty::vstore_fixed(size)) => { + ty::ty_str(ty::vstore_fixed(size)) => Type::array(&Type::i8(), size as u64), + ty::ty_vec(mt, ty::vstore_fixed(size)) => { Type::array(&sizing_type_of(cx, mt.ty), size as u64) } @@ -214,7 +214,7 @@ pub fn type_of(cx: &CrateContext, t: ty::t) -> Type { ty::ty_int(t) => Type::int_from_ty(cx, t), ty::ty_uint(t) => Type::uint_from_ty(cx, t), ty::ty_float(t) => Type::float_from_ty(t), - ty::ty_estr(ty::vstore_uniq) => { + ty::ty_str(ty::vstore_uniq) => { Type::vec(cx.sess.targ_cfg.arch, &Type::i8()).ptr_to() } ty::ty_enum(did, ref substs) => { @@ -226,12 +226,12 @@ pub fn type_of(cx: &CrateContext, t: ty::t) -> Type { let name = llvm_type_name(cx, an_enum, did, substs.tps); adt::incomplete_type_of(cx, repr, name) } - ty::ty_estr(ty::vstore_box) => { + ty::ty_str(ty::vstore_box) => { Type::smart_ptr(cx, &Type::vec(cx.sess.targ_cfg.arch, &Type::i8())).ptr_to() } - ty::ty_evec(ref mt, ty::vstore_box) => { + ty::ty_vec(ref mt, ty::vstore_box) => { let e_ty = type_of(cx, mt.ty); let v_ty = Type::vec(cx.sess.targ_cfg.arch, &e_ty); Type::smart_ptr(cx, &v_ty).ptr_to() @@ -249,7 +249,7 @@ pub fn type_of(cx: &CrateContext, t: ty::t) -> Type { ty.ptr_to() } } - ty::ty_evec(ref mt, ty::vstore_uniq) => { + ty::ty_vec(ref mt, ty::vstore_uniq) => { let ty = type_of(cx, mt.ty); let ty = Type::vec(cx.sess.targ_cfg.arch, &ty); if ty::type_contents(cx.tcx, mt.ty).owns_managed() { @@ -265,22 +265,22 @@ pub fn type_of(cx: &CrateContext, t: ty::t) -> Type { ty::ty_ptr(ref mt) => type_of(cx, mt.ty).ptr_to(), ty::ty_rptr(_, ref mt) => type_of(cx, mt.ty).ptr_to(), - ty::ty_evec(ref mt, ty::vstore_slice(_)) => { + ty::ty_vec(ref mt, ty::vstore_slice(_)) => { let p_ty = type_of(cx, mt.ty).ptr_to(); let u_ty = Type::uint_from_ty(cx, ast::TyU); Type::struct_([p_ty, u_ty], false) } - ty::ty_estr(ty::vstore_slice(_)) => { + ty::ty_str(ty::vstore_slice(_)) => { // This means we get a nicer name in the output cx.tn.find_type("str_slice").unwrap() } - ty::ty_estr(ty::vstore_fixed(n)) => { + ty::ty_str(ty::vstore_fixed(n)) => { Type::array(&Type::i8(), (n + 1u) as u64) } - ty::ty_evec(ref mt, ty::vstore_fixed(n)) => { + ty::ty_vec(ref mt, ty::vstore_fixed(n)) => { Type::array(&type_of(cx, mt.ty), n as u64) } diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 05b59baa49c..70abc13775f 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -635,11 +635,11 @@ pub enum sty { ty_int(ast::IntTy), ty_uint(ast::UintTy), ty_float(ast::FloatTy), - ty_estr(vstore), + ty_str(vstore), ty_enum(DefId, substs), ty_box(t), ty_uniq(mt), - ty_evec(mt, vstore), + ty_vec(mt, vstore), ty_ptr(mt), ty_rptr(Region, mt), ty_bare_fn(BareFnTy), @@ -1070,15 +1070,15 @@ pub fn mk_t(cx: ctxt, st: sty) -> t { return f; } match &st { - &ty_estr(vstore_slice(r)) => { + &ty_str(vstore_slice(r)) => { flags |= rflags(r); } - &ty_evec(ref mt, vstore_slice(r)) => { + &ty_vec(ref mt, vstore_slice(r)) => { flags |= rflags(r); flags |= get(mt.ty).flags; } &ty_nil | &ty_bool | &ty_char | &ty_int(_) | &ty_float(_) | &ty_uint(_) | - &ty_estr(_) | &ty_type | &ty_opaque_closure_ptr(_) | + &ty_str(_) | &ty_type | &ty_opaque_closure_ptr(_) | &ty_opaque_box => (), // You might think that we could just return ty_err for // any type containing ty_err as a component, and get @@ -1103,7 +1103,7 @@ pub fn mk_t(cx: ctxt, st: sty) -> t { } } &ty_box(ref tt) => flags |= get(*tt).flags, - &ty_uniq(ref m) | &ty_evec(ref m, _) | &ty_ptr(ref m) | + &ty_uniq(ref m) | &ty_vec(ref m, _) | &ty_ptr(ref m) | &ty_unboxed_vec(ref m) => { flags |= get(m.ty).flags; } @@ -1234,8 +1234,8 @@ pub fn mk_mach_float(tm: ast::FloatTy) -> t { #[inline] pub fn mk_char() -> t { mk_prim_t(&primitives::TY_CHAR) } -pub fn mk_estr(cx: ctxt, t: vstore) -> t { - mk_t(cx, ty_estr(t)) +pub fn mk_str(cx: ctxt, t: vstore) -> t { + mk_t(cx, ty_str(t)) } pub fn mk_enum(cx: ctxt, did: ast::DefId, substs: substs) -> t { @@ -1278,8 +1278,8 @@ pub fn mk_nil_ptr(cx: ctxt) -> t { mk_ptr(cx, mt {ty: mk_nil(), mutbl: ast::MutImmutable}) } -pub fn mk_evec(cx: ctxt, tm: mt, t: vstore) -> t { - mk_t(cx, ty_evec(tm, t)) +pub fn mk_vec(cx: ctxt, tm: mt, t: vstore) -> t { + mk_t(cx, ty_vec(tm, t)) } pub fn mk_unboxed_vec(cx: ctxt, tm: mt) -> t { @@ -1366,13 +1366,13 @@ pub fn maybe_walk_ty(ty: t, f: |t| -> bool) { } match get(ty).sty { ty_nil | ty_bot | ty_bool | ty_char | ty_int(_) | ty_uint(_) | ty_float(_) | - ty_estr(_) | ty_type | ty_opaque_box | ty_self(_) | + ty_str(_) | ty_type | ty_opaque_box | ty_self(_) | ty_opaque_closure_ptr(_) | ty_infer(_) | ty_param(_) | ty_err => { } ty_box(ref ty) => { maybe_walk_ty(*ty, f); } - ty_evec(ref tm, _) | ty_unboxed_vec(ref tm) | ty_ptr(ref tm) | + ty_vec(ref tm, _) | ty_unboxed_vec(ref tm) | ty_ptr(ref tm) | ty_rptr(_, ref tm) | ty_uniq(ref tm) => { maybe_walk_ty(tm.ty, f); } @@ -1520,8 +1520,8 @@ pub fn type_is_self(ty: t) -> bool { pub fn type_is_structural(ty: t) -> bool { match get(ty).sty { ty_struct(..) | ty_tup(_) | ty_enum(..) | ty_closure(_) | ty_trait(..) | - ty_evec(_, vstore_fixed(_)) | ty_estr(vstore_fixed(_)) | - ty_evec(_, vstore_slice(_)) | ty_estr(vstore_slice(_)) + ty_vec(_, vstore_fixed(_)) | ty_str(vstore_fixed(_)) | + ty_vec(_, vstore_slice(_)) | ty_str(vstore_slice(_)) => true, _ => false } @@ -1529,7 +1529,7 @@ pub fn type_is_structural(ty: t) -> bool { pub fn type_is_sequence(ty: t) -> bool { match get(ty).sty { - ty_estr(_) | ty_evec(_, _) => true, + ty_str(_) | ty_vec(_, _) => true, _ => false } } @@ -1543,15 +1543,15 @@ pub fn type_is_simd(cx: ctxt, ty: t) -> bool { pub fn type_is_str(ty: t) -> bool { match get(ty).sty { - ty_estr(_) => true, + ty_str(_) => true, _ => false } } pub fn sequence_element_type(cx: ctxt, ty: t) -> t { match get(ty).sty { - ty_estr(_) => return mk_mach_uint(ast::TyU8), - ty_evec(mt, _) | ty_unboxed_vec(mt) => return mt.ty, + ty_str(_) => return mk_mach_uint(ast::TyU8), + ty_vec(mt, _) | ty_unboxed_vec(mt) => return mt.ty, _ => cx.sess.bug("sequence_element_type called on non-sequence value"), } } @@ -1593,7 +1593,7 @@ pub fn type_is_box(ty: t) -> bool { pub fn type_is_boxed(ty: t) -> bool { match get(ty).sty { ty_box(_) | ty_opaque_box | - ty_evec(_, vstore_box) | ty_estr(vstore_box) => true, + ty_vec(_, vstore_box) | ty_str(vstore_box) => true, _ => false } } @@ -1607,7 +1607,7 @@ pub fn type_is_region_ptr(ty: t) -> bool { pub fn type_is_slice(ty: t) -> bool { match get(ty).sty { - ty_evec(_, vstore_slice(_)) | ty_estr(vstore_slice(_)) => true, + ty_vec(_, vstore_slice(_)) | ty_str(vstore_slice(_)) => true, _ => return false } } @@ -1628,8 +1628,8 @@ pub fn type_is_unsafe_ptr(ty: t) -> bool { pub fn type_is_vec(ty: t) -> bool { return match get(ty).sty { - ty_evec(_, _) | ty_unboxed_vec(_) => true, - ty_estr(_) => true, + ty_vec(_, _) | ty_unboxed_vec(_) => true, + ty_str(_) => true, _ => false }; } @@ -1637,8 +1637,8 @@ pub fn type_is_vec(ty: t) -> bool { pub fn type_is_unique(ty: t) -> bool { match get(ty).sty { ty_uniq(_) | - ty_evec(_, vstore_uniq) | - ty_estr(vstore_uniq) | + ty_vec(_, vstore_uniq) | + ty_str(vstore_uniq) | ty_opaque_closure_ptr(ast::OwnedSigil) => true, _ => return false } @@ -1719,10 +1719,10 @@ fn type_needs_unwind_cleanup_(cx: ctxt, ty: t, !needs_unwind_cleanup } ty_uniq(_) | - ty_estr(vstore_uniq) | - ty_estr(vstore_box) | - ty_evec(_, vstore_uniq) | - ty_evec(_, vstore_box) + ty_str(vstore_uniq) | + ty_str(vstore_box) | + ty_vec(_, vstore_uniq) | + ty_vec(_, vstore_box) => { // Once we're inside a box, the annihilator will find // it and destroy it. @@ -2031,7 +2031,7 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents { TC::None } - ty_estr(vstore_uniq) => { + ty_str(vstore_uniq) => { TC::OwnsOwned } @@ -2060,32 +2060,32 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents { tc_mt(cx, mt, cache).owned_pointer() } - ty_evec(mt, vstore_uniq) => { + ty_vec(mt, vstore_uniq) => { tc_mt(cx, mt, cache).owned_pointer() } - ty_evec(mt, vstore_box) => { + ty_vec(mt, vstore_box) => { tc_mt(cx, mt, cache).managed_pointer() } - ty_evec(ref mt, vstore_slice(r)) => { + ty_vec(ref mt, vstore_slice(r)) => { tc_ty(cx, mt.ty, cache).reference( borrowed_contents(r, mt.mutbl)) } - ty_evec(mt, vstore_fixed(_)) => { + ty_vec(mt, vstore_fixed(_)) => { tc_mt(cx, mt, cache) } - ty_estr(vstore_box) => { + ty_str(vstore_box) => { TC::Managed } - ty_estr(vstore_slice(r)) => { + ty_str(vstore_slice(r)) => { borrowed_contents(r, ast::MutImmutable) } - ty_estr(vstore_fixed(_)) => { + ty_str(vstore_fixed(_)) => { TC::None } @@ -2324,7 +2324,7 @@ pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool { ty_int(_) | ty_uint(_) | ty_float(_) | - ty_estr(_) | + ty_str(_) | ty_bare_fn(_) | ty_closure(_) | ty_infer(_) | @@ -2334,7 +2334,7 @@ pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool { ty_type | ty_opaque_box | ty_opaque_closure_ptr(_) | - ty_evec(_, _) | + ty_vec(_, _) | ty_unboxed_vec(_) => { false } @@ -2431,7 +2431,7 @@ pub fn type_structurally_contains(cx: ctxt, ty: t, test: |x: &sty| -> bool) } return false; } - ty_evec(ref mt, vstore_fixed(_)) => { + ty_vec(ref mt, vstore_fixed(_)) => { return type_structurally_contains(cx, mt.ty, test); } _ => return false @@ -2442,8 +2442,8 @@ pub fn type_structurally_contains_uniques(cx: ctxt, ty: t) -> bool { return type_structurally_contains(cx, ty, |sty| { match *sty { ty_uniq(_) | - ty_evec(_, vstore_uniq) | - ty_estr(vstore_uniq) => true, + ty_vec(_, vstore_uniq) | + ty_str(vstore_uniq) => true, _ => false, } }); @@ -2513,8 +2513,8 @@ pub fn type_is_pod(cx: ctxt, ty: t) -> bool { ty_type | ty_ptr(_) | ty_bare_fn(_) => result = true, // Boxed types ty_box(_) | ty_uniq(_) | ty_closure(_) | - ty_estr(vstore_uniq) | ty_estr(vstore_box) | - ty_evec(_, vstore_uniq) | ty_evec(_, vstore_box) | + ty_str(vstore_uniq) | ty_str(vstore_box) | + ty_vec(_, vstore_uniq) | ty_vec(_, vstore_box) | ty_trait(_, _, _, _, _) | ty_rptr(_,_) | ty_opaque_box => result = false, // Structural types ty_enum(did, ref substs) => { @@ -2532,8 +2532,8 @@ pub fn type_is_pod(cx: ctxt, ty: t) -> bool { ty_tup(ref elts) => { for elt in elts.iter() { if !type_is_pod(cx, *elt) { result = false; } } } - ty_estr(vstore_fixed(_)) => result = true, - ty_evec(ref mt, vstore_fixed(_)) | ty_unboxed_vec(ref mt) => { + ty_str(vstore_fixed(_)) => result = true, + ty_vec(ref mt, vstore_fixed(_)) | ty_unboxed_vec(ref mt) => { result = type_is_pod(cx, mt.ty); } ty_param(_) => result = false, @@ -2547,7 +2547,7 @@ pub fn type_is_pod(cx: ctxt, ty: t) -> bool { }); } - ty_estr(vstore_slice(..)) | ty_evec(_, vstore_slice(..)) => { + ty_str(vstore_slice(..)) | ty_vec(_, vstore_slice(..)) => { result = false; } @@ -2652,8 +2652,8 @@ pub fn index(t: t) -> Option<mt> { pub fn index_sty(sty: &sty) -> Option<mt> { match *sty { - ty_evec(mt, _) => Some(mt), - ty_estr(_) => Some(mt {ty: mk_u8(), mutbl: ast::MutImmutable}), + ty_vec(mt, _) => Some(mt), + ty_str(_) => Some(mt {ty: mk_u8(), mutbl: ast::MutImmutable}), _ => None } } @@ -2765,8 +2765,8 @@ pub fn is_fn_ty(fty: t) -> bool { pub fn ty_vstore(ty: t) -> vstore { match get(ty).sty { - ty_evec(_, vstore) => vstore, - ty_estr(vstore) => vstore, + ty_vec(_, vstore) => vstore, + ty_str(vstore) => vstore, ref s => fail!("ty_vstore() called on invalid sty: {:?}", s) } } @@ -2776,8 +2776,8 @@ pub fn ty_region(tcx: ctxt, ty: t) -> Region { match get(ty).sty { ty_rptr(r, _) => r, - ty_evec(_, vstore_slice(r)) => r, - ty_estr(vstore_slice(r)) => r, + ty_vec(_, vstore_slice(r)) => r, + ty_str(vstore_slice(r)) => r, ref s => { tcx.sess.span_bug( span, @@ -2962,12 +2962,12 @@ pub fn adjust_ty(cx: ctxt, r: Region, m: ast::Mutability, ty: ty::t) -> ty::t { match get(ty).sty { - ty_evec(mt, _) => { - ty::mk_evec(cx, mt {ty: mt.ty, mutbl: m}, vstore_slice(r)) + ty_vec(mt, _) => { + ty::mk_vec(cx, mt {ty: mt.ty, mutbl: m}, vstore_slice(r)) } - ty_estr(_) => { - ty::mk_estr(cx, vstore_slice(r)) + ty_str(_) => { + ty::mk_str(cx, vstore_slice(r)) } ref s => { @@ -3344,7 +3344,7 @@ pub fn occurs_check(tcx: ctxt, sp: Span, vid: TyVid, rt: t) { pub fn ty_sort_str(cx: ctxt, t: t) -> ~str { match get(t).sty { ty_nil | ty_bot | ty_bool | ty_char | ty_int(_) | - ty_uint(_) | ty_float(_) | ty_estr(_) | + ty_uint(_) | ty_float(_) | ty_str(_) | ty_type | ty_opaque_box | ty_opaque_closure_ptr(_) => { ::util::ppaux::ty_to_str(cx, t) } @@ -3352,7 +3352,7 @@ pub fn ty_sort_str(cx: ctxt, t: t) -> ~str { ty_enum(id, _) => format!("enum {}", item_path_str(cx, id)), ty_box(_) => ~"@-ptr", ty_uniq(_) => ~"~-ptr", - ty_evec(_, _) => ~"vector", + ty_vec(_, _) => ~"vector", ty_unboxed_vec(_) => ~"unboxed vector", ty_ptr(_) => ~"*-ptr", ty_rptr(_, _) => ~"&-ptr", @@ -4814,7 +4814,7 @@ pub fn hash_crate_independent(tcx: ctxt, t: t, local_hash: @str) -> u64 { hash.input([6]); iter(&mut hash, &f); } - ty_estr(v) => { + ty_str(v) => { hash.input([7]); vstore(&mut hash, v); } @@ -4829,7 +4829,7 @@ pub fn hash_crate_independent(tcx: ctxt, t: t, local_hash: @str) -> u64 { hash.input([10]); mt(&mut hash, m); } - ty_evec(m, v) => { + ty_vec(m, v) => { hash.input([11]); mt(&mut hash, m); vstore(&mut hash, v); diff --git a/src/librustc/middle/ty_fold.rs b/src/librustc/middle/ty_fold.rs index 06a3152056f..eb854adf4a8 100644 --- a/src/librustc/middle/ty_fold.rs +++ b/src/librustc/middle/ty_fold.rs @@ -152,9 +152,8 @@ pub fn super_fold_sty<T:TypeFolder>(this: &mut T, ty::ty_unboxed_vec(ref tm) => { ty::ty_unboxed_vec(this.fold_mt(tm)) } - ty::ty_evec(ref tm, vst) => { - ty::ty_evec(this.fold_mt(tm), - this.fold_vstore(vst)) + ty::ty_vec(ref tm, vst) => { + ty::ty_vec(this.fold_mt(tm), this.fold_vstore(vst)) } ty::ty_enum(tid, ref substs) => { ty::ty_enum(tid, this.fold_substs(substs)) @@ -184,8 +183,8 @@ pub fn super_fold_sty<T:TypeFolder>(this: &mut T, ty::ty_struct(did, this.fold_substs(substs)) } - ty::ty_estr(vst) => { - ty::ty_estr(this.fold_vstore(vst)) + ty::ty_str(vst) => { + ty::ty_str(this.fold_vstore(vst)) } ty::ty_nil | ty::ty_bot | ty::ty_bool | ty::ty_char | ty::ty_int(_) | ty::ty_uint(_) | diff --git a/src/librustc/middle/typeck/astconv.rs b/src/librustc/middle/typeck/astconv.rs index 882fb46e772..74e4c969292 100644 --- a/src/librustc/middle/typeck/astconv.rs +++ b/src/librustc/middle/typeck/astconv.rs @@ -293,8 +293,8 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>( ty::mt {ty: ast_ty_to_ty(this, rscope, mt.ty), mutbl: mt.mutbl} } - // Handle @, ~, and & being able to mean estrs and evecs. - // If a_seq_ty is a str or a vec, make it an estr/evec. + // Handle @, ~, and & being able to mean strs and vecs. + // If a_seq_ty is a str or a vec, make it an str/vec. // Also handle first-class trait types. fn mk_pointer<AC:AstConv, RS:RegionScope>( @@ -314,7 +314,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>( mt = ty::mt { ty: mt.ty, mutbl: a_seq_ty.mutbl }; } debug!("&[]: vst={:?}", vst); - return ty::mk_evec(tcx, mt, vst); + return ty::mk_vec(tcx, mt, vst); } ast::TyPath(ref path, ref bounds, id) => { // Note that the "bounds must be empty if path is not a trait" @@ -324,7 +324,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>( match def_map.get().find(&id) { Some(&ast::DefPrimTy(ast::TyStr)) if a_seq_ty.mutbl == ast::MutImmutable => { check_path_args(tcx, path, NO_TPS | NO_REGIONS); - return ty::mk_estr(tcx, vst); + return ty::mk_str(tcx, vst); } Some(&ast::DefTrait(trait_def_id)) => { let result = ast_path_to_trait_ref( @@ -415,7 +415,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>( ast::TyVec(ty) => { tcx.sess.span_err(ast_ty.span, "bare `[]` is not a type"); // return /something/ so they can at least get more errors - ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty), ty::vstore_uniq) + ty::mk_vec(tcx, ast_ty_to_mt(this, rscope, ty), ty::vstore_uniq) } ast::TyPtr(ref mt) => { ty::mk_ptr(tcx, ast_mt_to_mt(this, rscope, mt)) @@ -519,7 +519,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>( tcx.sess.span_err(ast_ty.span, "bare `str` is not a type"); // return /something/ so they can at least get more errors - ty::mk_estr(tcx, ty::vstore_uniq) + ty::mk_str(tcx, ty::vstore_uniq) } } } @@ -552,11 +552,11 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>( Ok(ref r) => { match *r { const_eval::const_int(i) => - ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty), - ty::vstore_fixed(i as uint)), + ty::mk_vec(tcx, ast_ty_to_mt(this, rscope, ty), + ty::vstore_fixed(i as uint)), const_eval::const_uint(i) => - ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty), - ty::vstore_fixed(i as uint)), + ty::mk_vec(tcx, ast_ty_to_mt(this, rscope, ty), + ty::vstore_fixed(i as uint)), _ => { tcx.sess.span_fatal( ast_ty.span, "expected constant expr for vector length"); diff --git a/src/librustc/middle/typeck/check/_match.rs b/src/librustc/middle/typeck/check/_match.rs index 8e0f2585d80..efd632dc80a 100644 --- a/src/librustc/middle/typeck/check/_match.rs +++ b/src/librustc/middle/typeck/check/_match.rs @@ -602,7 +602,7 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) { let (elt_type, region_var) = match *structure_of(fcx, pat.span, expected) { - ty::ty_evec(mt, vstore) => { + ty::ty_vec(mt, vstore) => { let region_var = match vstore { ty::vstore_slice(r) => r, ty::vstore_box | ty::vstore_uniq | ty::vstore_fixed(_) => { @@ -643,7 +643,7 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) { } match slice { Some(slice_pat) => { - let slice_ty = ty::mk_evec(tcx, + let slice_ty = ty::mk_vec(tcx, ty::mt {ty: elt_type.ty, mutbl: elt_type.mutbl}, ty::vstore_slice(region_var) ); diff --git a/src/librustc/middle/typeck/check/method.rs b/src/librustc/middle/typeck/check/method.rs index 4a9f7ea3624..f6ee7538b5b 100644 --- a/src/librustc/middle/typeck/check/method.rs +++ b/src/librustc/middle/typeck/check/method.rs @@ -648,11 +648,11 @@ impl<'a> LookupContext<'a> { autoderefs: autoderefs+1, autoref: Some(ty::AutoPtr(region, self_mt.mutbl))})) } - ty::ty_evec(self_mt, vstore_slice(_)) => { + ty::ty_vec(self_mt, vstore_slice(_)) => { let region = self.infcx().next_region_var( infer::Autoref(self.expr.span)); - (ty::mk_evec(tcx, self_mt, vstore_slice(region)), + (ty::mk_vec(tcx, self_mt, vstore_slice(region)), ty::AutoDerefRef(ty::AutoDerefRef { autoderefs: autoderefs, autoref: Some(ty::AutoBorrowVec(region, self_mt.mutbl))})) @@ -699,16 +699,16 @@ impl<'a> LookupContext<'a> { let tcx = self.tcx(); let sty = ty::get(self_ty).sty.clone(); match sty { - ty_evec(mt, vstore_box) | - ty_evec(mt, vstore_uniq) | - ty_evec(mt, vstore_slice(_)) | // NDM(#3148) - ty_evec(mt, vstore_fixed(_)) => { + ty_vec(mt, vstore_box) | + ty_vec(mt, vstore_uniq) | + ty_vec(mt, vstore_slice(_)) | // NDM(#3148) + ty_vec(mt, vstore_fixed(_)) => { // First try to borrow to a slice let entry = self.search_for_some_kind_of_autorefd_method( AutoBorrowVec, autoderefs, [MutImmutable, MutMutable], - |m,r| ty::mk_evec(tcx, - ty::mt {ty:mt.ty, mutbl:m}, - vstore_slice(r))); + |m,r| ty::mk_vec(tcx, + ty::mt {ty:mt.ty, mutbl:m}, + vstore_slice(r))); if entry.is_some() { return entry; } @@ -716,9 +716,9 @@ impl<'a> LookupContext<'a> { self.search_for_some_kind_of_autorefd_method( AutoBorrowVecRef, autoderefs, [MutImmutable, MutMutable], |m,r| { - let slice_ty = ty::mk_evec(tcx, - ty::mt {ty:mt.ty, mutbl:m}, - vstore_slice(r)); + let slice_ty = ty::mk_vec(tcx, + ty::mt {ty:mt.ty, mutbl:m}, + vstore_slice(r)); // NB: we do not try to autoref to a mutable // pointer. That would be creating a pointer // to a temporary pointer (the borrowed @@ -728,19 +728,19 @@ impl<'a> LookupContext<'a> { }) } - ty_estr(vstore_box) | - ty_estr(vstore_uniq) | - ty_estr(vstore_fixed(_)) => { + ty_str(vstore_box) | + ty_str(vstore_uniq) | + ty_str(vstore_fixed(_)) => { let entry = self.search_for_some_kind_of_autorefd_method( AutoBorrowVec, autoderefs, [MutImmutable], - |_m,r| ty::mk_estr(tcx, vstore_slice(r))); + |_m,r| ty::mk_str(tcx, vstore_slice(r))); if entry.is_some() { return entry; } self.search_for_some_kind_of_autorefd_method( AutoBorrowVecRef, autoderefs, [MutImmutable], |m,r| { - let slice_ty = ty::mk_estr(tcx, vstore_slice(r)); + let slice_ty = ty::mk_str(tcx, vstore_slice(r)); ty::mk_rptr(tcx, r, ty::mt {ty:slice_ty, mutbl:m}) }) } @@ -782,7 +782,7 @@ impl<'a> LookupContext<'a> { ty_self(_) | ty_param(..) | ty_nil | ty_bot | ty_bool | ty_char | ty_int(..) | ty_uint(..) | ty_float(..) | ty_enum(..) | ty_ptr(..) | ty_struct(..) | ty_tup(..) | - ty_estr(..) | ty_evec(..) | ty_trait(..) | ty_closure(..) => { + ty_str(..) | ty_vec(..) | ty_trait(..) | ty_closure(..) => { self.search_for_some_kind_of_autorefd_method( AutoPtr, autoderefs, [MutImmutable, MutMutable], |m,r| ty::mk_rptr(tcx, r, ty::mt {ty:self_ty, mutbl:m})) diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index 5acca083d79..242fa1faf97 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -1386,10 +1386,10 @@ pub fn check_lit(fcx: @FnCtxt, lit: &ast::Lit) -> ty::t { let tcx = fcx.ccx.tcx; match lit.node { - ast::LitStr(..) => ty::mk_estr(tcx, ty::vstore_slice(ty::ReStatic)), + ast::LitStr(..) => ty::mk_str(tcx, ty::vstore_slice(ty::ReStatic)), ast::LitBinary(..) => { - ty::mk_evec(tcx, ty::mt{ ty: ty::mk_u8(), mutbl: ast::MutImmutable }, - ty::vstore_slice(ty::ReStatic)) + ty::mk_vec(tcx, ty::mt{ ty: ty::mk_u8(), mutbl: ast::MutImmutable }, + ty::vstore_slice(ty::ReStatic)) } ast::LitChar(_) => ty::mk_char(), ast::LitInt(_, t) => ty::mk_mach_int(t), @@ -2629,7 +2629,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, let typ = match ev.node { ast::ExprLit(@codemap::Spanned { node: ast::LitStr(..), .. }) => { let tt = ast_expr_vstore_to_vstore(fcx, ev, vst); - ty::mk_estr(tcx, tt) + ty::mk_str(tcx, tt) } ast::ExprVec(ref args, mutbl) => { let tt = ast_expr_vstore_to_vstore(fcx, ev, vst); @@ -2655,7 +2655,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, } else if any_bot { ty::mk_bot() } else { - ty::mk_evec(tcx, ty::mt {ty: t, mutbl: mutability}, tt) + ty::mk_vec(tcx, ty::mt {ty: t, mutbl: mutability}, tt) } } ast::ExprRepeat(element, count_expr, mutbl) => { @@ -2674,7 +2674,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, } else if ty::type_is_bot(arg_t) { ty::mk_bot() } else { - ty::mk_evec(tcx, ty::mt {ty: t, mutbl: mutability}, tt) + ty::mk_vec(tcx, ty::mt {ty: t, mutbl: mutability}, tt) } } _ => @@ -3166,7 +3166,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, fn is_vec(t: ty::t) -> bool { match ty::get(t).sty { - ty::ty_evec(_,_) => true, + ty::ty_vec(..) => true, _ => false } } @@ -3223,8 +3223,8 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, for e in args.iter() { check_expr_has_type(fcx, *e, t); } - let typ = ty::mk_evec(tcx, ty::mt {ty: t, mutbl: mutbl}, - ty::vstore_fixed(args.len())); + let typ = ty::mk_vec(tcx, ty::mt {ty: t, mutbl: mutbl}, + ty::vstore_fixed(args.len())); fcx.write_ty(id, typ); } ast::ExprRepeat(element, count_expr, mutbl) => { @@ -3240,8 +3240,8 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, fcx.write_bot(id); } else { - let t = ty::mk_evec(tcx, ty::mt {ty: t, mutbl: mutbl}, - ty::vstore_fixed(count)); + let t = ty::mk_vec(tcx, ty::mt {ty: t, mutbl: mutbl}, + ty::vstore_fixed(count)); fcx.write_ty(id, t); } } diff --git a/src/librustc/middle/typeck/check/regionck.rs b/src/librustc/middle/typeck/check/regionck.rs index 7938bf3ffe2..032c8f45753 100644 --- a/src/librustc/middle/typeck/check/regionck.rs +++ b/src/librustc/middle/typeck/check/regionck.rs @@ -677,8 +677,8 @@ fn constrain_index(rcx: &mut Rcx, let r_index_expr = ty::ReScope(index_expr.id); match ty::get(indexed_ty).sty { - ty::ty_estr(ty::vstore_slice(r_ptr)) | - ty::ty_evec(_, ty::vstore_slice(r_ptr)) => { + ty::ty_str(ty::vstore_slice(r_ptr)) | + ty::ty_vec(_, ty::vstore_slice(r_ptr)) => { rcx.fcx.mk_subr(true, infer::IndexSlice(index_expr.span), r_index_expr, r_ptr); } @@ -1215,22 +1215,22 @@ pub mod guarantor { fn pointer_categorize(ty: ty::t) -> PointerCategorization { match ty::get(ty).sty { ty::ty_rptr(r, _) | - ty::ty_evec(_, ty::vstore_slice(r)) | + ty::ty_vec(_, ty::vstore_slice(r)) | ty::ty_trait(_, _, ty::RegionTraitStore(r), _, _) | - ty::ty_estr(ty::vstore_slice(r)) => { + ty::ty_str(ty::vstore_slice(r)) => { BorrowedPointer(r) } ty::ty_uniq(..) | - ty::ty_estr(ty::vstore_uniq) | + ty::ty_str(ty::vstore_uniq) | ty::ty_trait(_, _, ty::UniqTraitStore, _, _) | - ty::ty_evec(_, ty::vstore_uniq) => { + ty::ty_vec(_, ty::vstore_uniq) => { OwnedPointer } ty::ty_box(..) | ty::ty_ptr(..) | - ty::ty_evec(_, ty::vstore_box) | + ty::ty_vec(_, ty::vstore_box) | ty::ty_trait(_, _, ty::BoxTraitStore, _, _) | - ty::ty_estr(ty::vstore_box) => { + ty::ty_str(ty::vstore_box) => { OtherPointer } ty::ty_closure(ref closure_ty) => { diff --git a/src/librustc/middle/typeck/check/regionmanip.rs b/src/librustc/middle/typeck/check/regionmanip.rs index cc145e9a52c..c8fde97e4d6 100644 --- a/src/librustc/middle/typeck/check/regionmanip.rs +++ b/src/librustc/middle/typeck/check/regionmanip.rs @@ -103,7 +103,7 @@ pub fn relate_nested_regions(tcx: ty::ctxt, fn fold_ty(&mut self, ty: ty::t) -> ty::t { match ty::get(ty).sty { ty::ty_rptr(r, ref mt) | - ty::ty_evec(ref mt, ty::vstore_slice(r)) => { + ty::ty_vec(ref mt, ty::vstore_slice(r)) => { self.relate(r); self.stack.push(r); ty_fold::super_fold_ty(self, mt.ty); diff --git a/src/librustc/middle/typeck/coherence.rs b/src/librustc/middle/typeck/coherence.rs index 9466792c62e..342e5a1ad2a 100644 --- a/src/librustc/middle/typeck/coherence.rs +++ b/src/librustc/middle/typeck/coherence.rs @@ -20,7 +20,7 @@ use metadata::csearch; use middle::ty::get; use middle::ty::{ImplContainer, lookup_item_type, subst}; use middle::ty::{substs, t, ty_bool, ty_char, ty_bot, ty_box, ty_enum, ty_err}; -use middle::ty::{ty_estr, ty_evec, ty_float, ty_infer, ty_int, ty_nil}; +use middle::ty::{ty_str, ty_vec, ty_float, ty_infer, ty_int, ty_nil}; use middle::ty::{ty_opaque_box, ty_param, ty_param_bounds_and_ty, ty_ptr}; use middle::ty::{ty_rptr, ty_self, ty_struct, ty_trait, ty_tup}; use middle::ty::{ty_type, ty_uint, ty_uniq, ty_bare_fn, ty_closure}; @@ -82,7 +82,7 @@ pub fn get_base_type(inference_context: @InferCtxt, } ty_nil | ty_bot | ty_bool | ty_char | ty_int(..) | ty_uint(..) | ty_float(..) | - ty_estr(..) | ty_evec(..) | ty_bare_fn(..) | ty_closure(..) | ty_tup(..) | + ty_str(..) | ty_vec(..) | ty_bare_fn(..) | ty_closure(..) | ty_tup(..) | ty_infer(..) | ty_param(..) | ty_self(..) | ty_type | ty_opaque_box | ty_opaque_closure_ptr(..) | ty_unboxed_vec(..) | ty_err | ty_box(_) | ty_uniq(_) | ty_ptr(_) | ty_rptr(_, _) => { diff --git a/src/librustc/middle/typeck/infer/coercion.rs b/src/librustc/middle/typeck/infer/coercion.rs index 5971a6b7943..6c4a82c628a 100644 --- a/src/librustc/middle/typeck/infer/coercion.rs +++ b/src/librustc/middle/typeck/infer/coercion.rs @@ -107,13 +107,13 @@ impl Coerce { }); } - ty::ty_estr(vstore_slice(_)) => { + ty::ty_str(vstore_slice(_)) => { return self.unpack_actual_value(a, |sty_a| { self.coerce_borrowed_string(a, sty_a, b) }); } - ty::ty_evec(mt_b, vstore_slice(_)) => { + ty::ty_vec(mt_b, vstore_slice(_)) => { return self.unpack_actual_value(a, |sty_a| { self.coerce_borrowed_vector(a, sty_a, b, mt_b) }); @@ -273,15 +273,15 @@ impl Coerce { b.inf_str(self.get_ref().infcx)); match *sty_a { - ty::ty_estr(vstore_box) | - ty::ty_estr(vstore_uniq) => {} + ty::ty_str(vstore_box) | + ty::ty_str(vstore_uniq) => {} _ => { return self.subtype(a, b); } }; let r_a = self.get_ref().infcx.next_region_var(Coercion(self.get_ref().trace)); - let a_borrowed = ty::mk_estr(self.get_ref().infcx.tcx, vstore_slice(r_a)); + let a_borrowed = ty::mk_str(self.get_ref().infcx.tcx, vstore_slice(r_a)); if_ok!(self.subtype(a_borrowed, b)); Ok(Some(@AutoDerefRef(AutoDerefRef { autoderefs: 0, @@ -302,15 +302,15 @@ impl Coerce { let sub = Sub(*self.get_ref()); let r_borrow = self.get_ref().infcx.next_region_var(Coercion(self.get_ref().trace)); let ty_inner = match *sty_a { - ty::ty_evec(mt, _) => mt.ty, + ty::ty_vec(mt, _) => mt.ty, _ => { return self.subtype(a, b); } }; - let a_borrowed = ty::mk_evec(self.get_ref().infcx.tcx, - mt {ty: ty_inner, mutbl: mt_b.mutbl}, - vstore_slice(r_borrow)); + let a_borrowed = ty::mk_vec(self.get_ref().infcx.tcx, + mt {ty: ty_inner, mutbl: mt_b.mutbl}, + vstore_slice(r_borrow)); if_ok!(sub.tys(a_borrowed, b)); Ok(Some(@AutoDerefRef(AutoDerefRef { autoderefs: 0, diff --git a/src/librustc/middle/typeck/infer/combine.rs b/src/librustc/middle/typeck/infer/combine.rs index 2b2115173ae..01e19f011aa 100644 --- a/src/librustc/middle/typeck/infer/combine.rs +++ b/src/librustc/middle/typeck/infer/combine.rs @@ -535,17 +535,17 @@ pub fn super_tys<C:Combine>(this: &C, a: ty::t, b: ty::t) -> cres<ty::t> { Ok(ty::mk_rptr(tcx, r, mt)) } - (&ty::ty_evec(ref a_mt, vs_a), &ty::ty_evec(ref b_mt, vs_b)) => { + (&ty::ty_vec(ref a_mt, vs_a), &ty::ty_vec(ref b_mt, vs_b)) => { this.mts(a_mt, b_mt).and_then(|mt| { this.vstores(ty::terr_vec, vs_a, vs_b).and_then(|vs| { - Ok(ty::mk_evec(tcx, mt, vs)) + Ok(ty::mk_vec(tcx, mt, vs)) }) }) } - (&ty::ty_estr(vs_a), &ty::ty_estr(vs_b)) => { + (&ty::ty_str(vs_a), &ty::ty_str(vs_b)) => { let vs = if_ok!(this.vstores(ty::terr_str, vs_a, vs_b)); - Ok(ty::mk_estr(tcx,vs)) + Ok(ty::mk_str(tcx,vs)) } (&ty::ty_tup(ref as_), &ty::ty_tup(ref bs)) => { diff --git a/src/librustc/middle/typeck/variance.rs b/src/librustc/middle/typeck/variance.rs index b5e5bdfd65b..cfad864323b 100644 --- a/src/librustc/middle/typeck/variance.rs +++ b/src/librustc/middle/typeck/variance.rs @@ -625,11 +625,11 @@ impl<'a> ConstraintContext<'a> { self.add_constraints_from_mt(mt, variance); } - ty::ty_estr(vstore) => { + ty::ty_str(vstore) => { self.add_constraints_from_vstore(vstore, variance); } - ty::ty_evec(ref mt, vstore) => { + ty::ty_vec(ref mt, vstore) => { self.add_constraints_from_vstore(vstore, variance); self.add_constraints_from_mt(mt, variance); } diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 6ef00fa9d00..08b38c5b50f 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -17,7 +17,7 @@ use middle::ty::{mt, t, param_ty}; use middle::ty::{ReFree, ReScope, ReInfer, ReStatic, Region, ReEmpty}; use middle::ty::{ty_bool, ty_char, ty_bot, ty_box, ty_struct, ty_enum}; -use middle::ty::{ty_err, ty_estr, ty_evec, ty_float, ty_bare_fn, ty_closure}; +use middle::ty::{ty_err, ty_str, ty_vec, ty_float, ty_bare_fn, ty_closure}; use middle::ty::{ty_nil, ty_opaque_box, ty_opaque_closure_ptr, ty_param}; use middle::ty::{ty_ptr, ty_rptr, ty_self, ty_tup, ty_type, ty_uniq}; use middle::ty::{ty_trait, ty_int}; @@ -501,10 +501,10 @@ pub fn ty_to_str(cx: ctxt, typ: t) -> ~str { format!("{}{}{}{}{}", trait_store_to_str(cx, s), mutability_to_str(mutbl), ty, bound_sep, bound_str) } - ty_evec(ref mt, vs) => { + ty_vec(ref mt, vs) => { vstore_ty_to_str(cx, mt, vs) } - ty_estr(vs) => format!("{}{}", vstore_to_str(cx, vs), "str"), + ty_str(vs) => format!("{}{}", vstore_to_str(cx, vs), "str"), ty_opaque_box => ~"@?", ty_opaque_closure_ptr(ast::BorrowedSigil) => ~"&closure", ty_opaque_closure_ptr(ast::ManagedSigil) => ~"@closure", diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 0424c71dd59..b783ea6da3c 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2276,7 +2276,7 @@ impl Parser { let m = self.parse_mutability(); let e = self.parse_prefix_expr(); hi = e.span.hi; - // HACK: turn &[...] into a &-evec + // HACK: turn &[...] into a &-vec ex = match e.node { ExprVec(..) | ExprLit(@codemap::Spanned { node: LitStr(..), span: _ @@ -2297,7 +2297,7 @@ impl Parser { self.bump(); let e = self.parse_prefix_expr(); hi = e.span.hi; - // HACK: turn @[...] into a @-evec + // HACK: turn @[...] into a @-vec ex = match e.node { ExprVec(..) | ExprLit(@codemap::Spanned { node: LitStr(..), span: _}) | @@ -2310,7 +2310,7 @@ impl Parser { let e = self.parse_prefix_expr(); hi = e.span.hi; - // HACK: turn ~[...] into a ~-evec + // HACK: turn ~[...] into a ~-vec ex = match e.node { ExprVec(..) | ExprLit(@codemap::Spanned { node: LitStr(..), span: _}) | @@ -2337,7 +2337,7 @@ impl Parser { // Otherwise, we use the unique pointer default. let subexpression = self.parse_prefix_expr(); hi = subexpression.span.hi; - // HACK: turn `box [...]` into a boxed-evec + // HACK: turn `box [...]` into a boxed-vec ex = match subexpression.node { ExprVec(..) | ExprLit(@codemap::Spanned { |
