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
_ => {}

0 commit comments

Comments
 (0)