Skip to content

Commit b61764b

Browse files
committed
rustc: rename ty::vstore and its variants to UpperCamelCase.
1 parent e263ef1 commit b61764b

30 files changed

+175
-176
lines changed

src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ pub fn write_type(ecx: &EncodeContext,
234234

235235
pub fn write_vstore(ecx: &EncodeContext,
236236
ebml_w: &mut Encoder,
237-
vstore: ty::vstore) {
237+
vstore: ty::Vstore) {
238238
let ty_str_ctxt = &tyencode::ctxt {
239239
diag: ecx.diag,
240240
ds: def_to_str,

src/librustc/metadata/tydecode.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,19 @@ fn parse_sigil(st: &mut PState) -> ast::Sigil {
145145
}
146146
}
147147

148-
fn parse_vstore(st: &mut PState, conv: conv_did) -> ty::vstore {
148+
fn parse_vstore(st: &mut PState, conv: conv_did) -> ty::Vstore {
149149
assert_eq!(next(st), '/');
150150

151151
let c = peek(st);
152152
if '0' <= c && c <= '9' {
153153
let n = parse_uint(st);
154154
assert_eq!(next(st), '|');
155-
return ty::vstore_fixed(n);
155+
return ty::VstoreFixed(n);
156156
}
157157

158158
match next(st) {
159-
'~' => ty::vstore_uniq,
160-
'&' => ty::vstore_slice(parse_region(st, conv)),
159+
'~' => ty::VstoreUniq,
160+
'&' => ty::VstoreSlice(parse_region(st, conv)),
161161
c => st.tcx.sess.bug(format!("parse_vstore(): bad input '{}'", c))
162162
}
163163
}

src/librustc/metadata/tyencode.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,12 @@ fn enc_bound_region(w: &mut MemWriter, cx: &ctxt, br: ty::BoundRegion) {
204204
}
205205
}
206206

207-
pub fn enc_vstore(w: &mut MemWriter, cx: &ctxt, v: ty::vstore) {
207+
pub fn enc_vstore(w: &mut MemWriter, cx: &ctxt, v: ty::Vstore) {
208208
mywrite!(w, "/");
209209
match v {
210-
ty::vstore_fixed(u) => mywrite!(w, "{}|", u),
211-
ty::vstore_uniq => mywrite!(w, "~"),
212-
ty::vstore_slice(r) => {
210+
ty::VstoreFixed(u) => mywrite!(w, "{}|", u),
211+
ty::VstoreUniq => mywrite!(w, "~"),
212+
ty::VstoreSlice(r) => {
213213
mywrite!(w, "&");
214214
enc_region(w, cx, r);
215215
}

src/librustc/middle/astencode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ impl<'a> get_ty_str_ctxt for e::EncodeContext<'a> {
823823

824824
trait ebml_writer_helpers {
825825
fn emit_ty(&mut self, ecx: &e::EncodeContext, ty: ty::t);
826-
fn emit_vstore(&mut self, ecx: &e::EncodeContext, vstore: ty::vstore);
826+
fn emit_vstore(&mut self, ecx: &e::EncodeContext, vstore: ty::Vstore);
827827
fn emit_tys(&mut self, ecx: &e::EncodeContext, tys: &[ty::t]);
828828
fn emit_type_param_def(&mut self,
829829
ecx: &e::EncodeContext,
@@ -840,7 +840,7 @@ impl<'a> ebml_writer_helpers for Encoder<'a> {
840840
self.emit_opaque(|this| Ok(e::write_type(ecx, this, ty)));
841841
}
842842

843-
fn emit_vstore(&mut self, ecx: &e::EncodeContext, vstore: ty::vstore) {
843+
fn emit_vstore(&mut self, ecx: &e::EncodeContext, vstore: ty::Vstore) {
844844
self.emit_opaque(|this| Ok(e::write_vstore(ecx, this, vstore)));
845845
}
846846

src/librustc/middle/check_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful {
279279
}
280280
not_useful
281281
}
282-
ty::ty_vec(_, ty::vstore_fixed(n)) => {
282+
ty::ty_vec(_, ty::VstoreFixed(n)) => {
283283
is_useful_specialized(cx, m, v, vec(n), n, left_ty)
284284
}
285285
ty::ty_vec(..) => {
@@ -441,7 +441,7 @@ fn missing_ctor(cx: &MatchCheckCtxt,
441441
else if true_found { Some(val(const_bool(false))) }
442442
else { Some(val(const_bool(true))) }
443443
}
444-
ty::ty_vec(_, ty::vstore_fixed(n)) => {
444+
ty::ty_vec(_, ty::VstoreFixed(n)) => {
445445
let mut missing = true;
446446
let mut wrong = false;
447447
for r in m.iter() {

src/librustc/middle/lint.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,8 @@ fn check_heap_type(cx: &Context, span: Span, ty: ty::t) {
917917
ty::ty_box(_) => {
918918
n_box += 1;
919919
}
920-
ty::ty_uniq(_) | ty::ty_str(ty::vstore_uniq) |
921-
ty::ty_vec(_, ty::vstore_uniq) |
920+
ty::ty_uniq(_) | ty::ty_str(ty::VstoreUniq) |
921+
ty::ty_vec(_, ty::VstoreUniq) |
922922
ty::ty_trait(~ty::TyTrait { store: ty::UniqTraitStore, .. }) => {
923923
n_uniq += 1;
924924
}
@@ -1158,7 +1158,7 @@ fn check_unused_result(cx: &Context, s: &ast::Stmt) {
11581158
fn check_deprecated_owned_vector(cx: &Context, e: &ast::Expr) {
11591159
let t = ty::expr_ty(cx.tcx, e);
11601160
match ty::get(t).sty {
1161-
ty::ty_vec(_, ty::vstore_uniq) => {
1161+
ty::ty_vec(_, ty::VstoreUniq) => {
11621162
cx.span_lint(DeprecatedOwnedVector, e.span,
11631163
"use of deprecated `~[]` vector; replaced by `std::vec::Vec`")
11641164
}

src/librustc/middle/mem_categorization.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,14 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> {
170170
match ty::get(t).sty {
171171
ty::ty_uniq(_) |
172172
ty::ty_trait(~ty::TyTrait { store: ty::UniqTraitStore, .. }) |
173-
ty::ty_vec(_, ty::vstore_uniq) |
174-
ty::ty_str(ty::vstore_uniq) |
173+
ty::ty_vec(_, ty::VstoreUniq) |
174+
ty::ty_str(ty::VstoreUniq) |
175175
ty::ty_closure(~ty::ClosureTy {sigil: ast::OwnedSigil, ..}) => {
176176
Some(deref_ptr(OwnedPtr))
177177
}
178178

179179
ty::ty_rptr(r, mt) |
180-
ty::ty_vec(mt, ty::vstore_slice(r)) => {
180+
ty::ty_vec(mt, ty::VstoreSlice(r)) => {
181181
let kind = ty::BorrowKind::from_mutbl(mt.mutbl);
182182
Some(deref_ptr(BorrowedPtr(kind, r)))
183183
}
@@ -187,7 +187,7 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> {
187187
Some(deref_ptr(BorrowedPtr(kind, r)))
188188
}
189189

190-
ty::ty_str(ty::vstore_slice(r)) |
190+
ty::ty_str(ty::VstoreSlice(r)) |
191191
ty::ty_closure(~ty::ClosureTy {sigil: ast::BorrowedSigil,
192192
region: r, ..}) => {
193193
Some(deref_ptr(BorrowedPtr(ty::ImmBorrow, r)))
@@ -206,8 +206,8 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> {
206206
Some(deref_interior(InteriorField(PositionalField(0))))
207207
}
208208

209-
ty::ty_vec(_, ty::vstore_fixed(_)) |
210-
ty::ty_str(ty::vstore_fixed(_)) => {
209+
ty::ty_vec(_, ty::VstoreFixed(_)) |
210+
ty::ty_str(ty::VstoreFixed(_)) => {
211211
Some(deref_interior(InteriorElement(element_kind(t))))
212212
}
213213

@@ -882,7 +882,7 @@ impl<TYPER:Typer> MemCategorizationContext<TYPER> {
882882
*/
883883

884884
match ty::get(slice_ty).sty {
885-
ty::ty_vec(slice_mt, ty::vstore_slice(slice_r)) => {
885+
ty::ty_vec(slice_mt, ty::VstoreSlice(slice_r)) => {
886886
(slice_mt.mutbl, slice_r)
887887
}
888888

src/librustc/middle/trans/_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ fn extract_vec_elems<'a>(
11111111
let slice_len = Sub(bcx, len, slice_len_offset);
11121112
let slice_ty = ty::mk_vec(bcx.tcx(),
11131113
ty::mt {ty: vt.unit_ty, mutbl: ast::MutImmutable},
1114-
ty::vstore_slice(ty::ReStatic)
1114+
ty::VstoreSlice(ty::ReStatic)
11151115
);
11161116
let scratch = rvalue_scratch_datum(bcx, slice_ty, "");
11171117
Store(bcx, slice_begin,
@@ -1319,7 +1319,7 @@ fn compare_values<'a>(
13191319
}
13201320

13211321
match ty::get(rhs_t).sty {
1322-
ty::ty_str(ty::vstore_uniq) => {
1322+
ty::ty_str(ty::VstoreUniq) => {
13231323
let scratch_lhs = alloca(cx, val_ty(lhs), "__lhs");
13241324
Store(cx, lhs, scratch_lhs);
13251325
let scratch_rhs = alloca(cx, val_ty(rhs), "__rhs");

src/librustc/middle/trans/base.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ fn decl_fn(llmod: ModuleRef, name: &str, cc: lib::llvm::CallConv,
188188
// FIXME #6750 ~Trait cannot be directly marked as
189189
// noalias because the actual object pointer is nested.
190190
ty::ty_uniq(..) | // ty::ty_trait(_, _, ty::UniqTraitStore, _, _) |
191-
ty::ty_vec(_, ty::vstore_uniq) | ty::ty_str(ty::vstore_uniq) => {
191+
ty::ty_vec(_, ty::VstoreUniq) | ty::ty_str(ty::VstoreUniq) => {
192192
unsafe {
193193
llvm::LLVMAddReturnAttribute(llfn, lib::llvm::NoAliasAttribute as c_uint);
194194
}
@@ -259,7 +259,7 @@ pub fn decl_rust_fn(ccx: &CrateContext, has_env: bool,
259259
// FIXME #6750 ~Trait cannot be directly marked as
260260
// noalias because the actual object pointer is nested.
261261
ty::ty_uniq(..) | // ty::ty_trait(_, _, ty::UniqTraitStore, _, _) |
262-
ty::ty_vec(_, ty::vstore_uniq) | ty::ty_str(ty::vstore_uniq) |
262+
ty::ty_vec(_, ty::VstoreUniq) | ty::ty_str(ty::VstoreUniq) |
263263
ty::ty_closure(~ty::ClosureTy {sigil: ast::OwnedSigil, ..}) => {
264264
unsafe {
265265
llvm::LLVMAddAttribute(llarg, lib::llvm::NoAliasAttribute as c_uint);
@@ -657,8 +657,8 @@ pub fn iter_structural_ty<'r,
657657
}
658658
})
659659
}
660-
ty::ty_str(ty::vstore_fixed(_)) |
661-
ty::ty_vec(_, ty::vstore_fixed(_)) => {
660+
ty::ty_str(ty::VstoreFixed(_)) |
661+
ty::ty_vec(_, ty::VstoreFixed(_)) => {
662662
let (base, len) = tvec::get_base_and_byte_len(cx, av, t);
663663
let unit_ty = ty::sequence_element_type(cx.tcx(), t);
664664
cx = tvec::iter_vec_raw(cx, base, unit_ty, len, f);

src/librustc/middle/trans/callee.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ pub fn trans_call_inner<'a>(
654654
match ty::get(ret_ty).sty {
655655
// `~` pointer return values never alias because ownership
656656
// is transferred
657-
ty::ty_uniq(..) | ty::ty_vec(_, ty::vstore_uniq) => {
657+
ty::ty_uniq(..) | ty::ty_vec(_, ty::VstoreUniq) => {
658658
attrs.push((0, NoAliasAttribute));
659659
}
660660
_ => {}

src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ pub fn mono_data_classify(t: ty::t) -> MonoDataClass {
712712
match ty::get(t).sty {
713713
ty::ty_float(_) => MonoFloat,
714714
ty::ty_rptr(..) | ty::ty_uniq(..) | ty::ty_box(..) |
715-
ty::ty_str(ty::vstore_uniq) | ty::ty_vec(_, ty::vstore_uniq) |
715+
ty::ty_str(ty::VstoreUniq) | ty::ty_vec(_, ty::VstoreUniq) |
716716
ty::ty_bare_fn(..) => MonoNonNull,
717717
// Is that everything? Would closures or slices qualify?
718718
_ => MonoBits

src/librustc/middle/trans/consts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ pub fn const_expr(cx: &CrateContext, e: &ast::Expr, is_local: bool) -> (ValueRef
246246
assert_eq!(abi::slice_elt_base, 0);
247247
assert_eq!(abi::slice_elt_len, 1);
248248
match ty::get(ty).sty {
249-
ty::ty_vec(_, ty::vstore_fixed(len)) => {
249+
ty::ty_vec(_, ty::VstoreFixed(len)) => {
250250
llconst = C_struct(cx, [
251251
llptr,
252252
C_uint(cx, len)
@@ -436,10 +436,10 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
436436
let (arr, len) = match ty::get(bt).sty {
437437
ty::ty_vec(_, vstore) | ty::ty_str(vstore) =>
438438
match vstore {
439-
ty::vstore_fixed(u) =>
439+
ty::VstoreFixed(u) =>
440440
(bv, C_uint(cx, u)),
441441

442-
ty::vstore_slice(_) => {
442+
ty::VstoreSlice(_) => {
443443
let e1 = const_get_elt(cx, bv, [0]);
444444
(const_deref_ptr(cx, e1), const_get_elt(cx, bv, [1]))
445445
},

src/librustc/middle/trans/debuginfo.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,14 +2128,14 @@ fn type_metadata(cx: &CrateContext,
21282128
ty::ty_str(ref vstore) => {
21292129
let i8_t = ty::mk_i8();
21302130
match *vstore {
2131-
ty::vstore_fixed(len) => {
2131+
ty::VstoreFixed(len) => {
21322132
fixed_vec_metadata(cx, i8_t, len, usage_site_span)
21332133
},
2134-
ty::vstore_uniq => {
2134+
ty::VstoreUniq => {
21352135
let vec_metadata = vec_metadata(cx, i8_t, usage_site_span);
21362136
pointer_type_metadata(cx, t, vec_metadata)
21372137
}
2138-
ty::vstore_slice(_region) => {
2138+
ty::VstoreSlice(_region) => {
21392139
vec_slice_metadata(cx, t, i8_t, usage_site_span)
21402140
}
21412141
}
@@ -2148,14 +2148,14 @@ fn type_metadata(cx: &CrateContext,
21482148
},
21492149
ty::ty_vec(ref mt, ref vstore) => {
21502150
match *vstore {
2151-
ty::vstore_fixed(len) => {
2151+
ty::VstoreFixed(len) => {
21522152
fixed_vec_metadata(cx, mt.ty, len, usage_site_span)
21532153
}
2154-
ty::vstore_uniq => {
2154+
ty::VstoreUniq => {
21552155
let vec_metadata = vec_metadata(cx, mt.ty, usage_site_span);
21562156
pointer_type_metadata(cx, t, vec_metadata)
21572157
}
2158-
ty::vstore_slice(_) => {
2158+
ty::VstoreSlice(_) => {
21592159
vec_slice_metadata(cx, t, mt.ty, usage_site_span)
21602160
}
21612161
}

src/librustc/middle/trans/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ fn apply_adjustments<'a>(bcx: &'a Block<'a>,
265265
// real one, but it will have the same runtime representation
266266
let slice_ty = ty::mk_vec(tcx,
267267
ty::mt { ty: unit_ty, mutbl: ast::MutImmutable },
268-
ty::vstore_slice(ty::ReStatic));
268+
ty::VstoreSlice(ty::ReStatic));
269269

270270
let scratch = rvalue_scratch_datum(bcx, slice_ty, "__adjust");
271271
Store(bcx, base, GEPi(bcx, scratch.val, [0u, abi::slice_elt_base]));

src/librustc/middle/trans/glue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fn get_drop_glue_type(ccx: &CrateContext, t: ty::t) -> ty::t {
9393
}
9494
}
9595

96-
ty::ty_vec(mt, ty::vstore_uniq) if !ty::type_needs_drop(tcx, mt.ty) =>
96+
ty::ty_vec(mt, ty::VstoreUniq) if !ty::type_needs_drop(tcx, mt.ty) =>
9797
ty::mk_uniq(tcx, ty::mk_i8()),
9898

9999
_ => t
@@ -289,7 +289,7 @@ fn make_drop_glue<'a>(bcx: &'a Block<'a>, v0: ValueRef, t: ty::t) -> &'a Block<'
289289
trans_exchange_free(bcx, llbox)
290290
})
291291
}
292-
ty::ty_vec(_, ty::vstore_uniq) | ty::ty_str(ty::vstore_uniq) => {
292+
ty::ty_vec(_, ty::VstoreUniq) | ty::ty_str(ty::VstoreUniq) => {
293293
let llbox = Load(bcx, v0);
294294
let not_null = IsNotNull(bcx, llbox);
295295
with_cond(bcx, not_null, |bcx| {

src/librustc/middle/trans/reflect.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<'a> Reflector<'a> {
5454
// We're careful to not use first class aggregates here because that
5555
// will kick us off fast isel. (Issue #4352.)
5656
let bcx = self.bcx;
57-
let str_vstore = ty::vstore_slice(ty::ReStatic);
57+
let str_vstore = ty::VstoreSlice(ty::ReStatic);
5858
let str_ty = ty::mk_str(bcx.tcx(), str_vstore);
5959
let scratch = rvalue_scratch_datum(bcx, str_ty, "");
6060
let len = C_uint(bcx.ccx(), s.get().len());
@@ -123,15 +123,15 @@ impl<'a> Reflector<'a> {
123123

124124
pub fn vstore_name_and_extra(&mut self,
125125
t: ty::t,
126-
vstore: ty::vstore)
126+
vstore: ty::Vstore)
127127
-> (~str, Vec<ValueRef> ) {
128128
match vstore {
129-
ty::vstore_fixed(n) => {
129+
ty::VstoreFixed(n) => {
130130
let extra = (vec!(self.c_uint(n))).append(self.c_size_and_align(t).as_slice());
131131
(~"fixed", extra)
132132
}
133-
ty::vstore_slice(_) => (~"slice", Vec::new()),
134-
ty::vstore_uniq => (~"uniq", Vec::new()),
133+
ty::VstoreSlice(_) => (~"slice", Vec::new()),
134+
ty::VstoreUniq => (~"uniq", Vec::new()),
135135
}
136136
}
137137

0 commit comments

Comments
 (0)