Skip to content

Commit 3068d80

Browse files
committed
Rename hir::Vec to HirVec
1 parent dc3b857 commit 3068d80

File tree

13 files changed

+182
-181
lines changed

13 files changed

+182
-181
lines changed

src/librustc/front/map/collector.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ use rustc_front::util;
1616
use rustc_front::intravisit::{self, Visitor};
1717
use middle::def_id::{CRATE_DEF_INDEX, DefIndex};
1818
use std::iter::repeat;
19-
use std::vec;
2019
use syntax::ast::{NodeId, CRATE_NODE_ID, DUMMY_NODE_ID};
2120
use syntax::codemap::Span;
2221

2322
/// A Visitor that walks over an AST and collects Node's into an AST
2423
/// Map.
2524
pub struct NodeCollector<'ast> {
2625
pub krate: &'ast Crate,
27-
pub map: vec::Vec<MapEntry<'ast>>,
26+
pub map: Vec<MapEntry<'ast>>,
2827
pub definitions: Definitions,
2928
pub parent_node: NodeId,
3029
}
@@ -51,7 +50,7 @@ impl<'ast> NodeCollector<'ast> {
5150
parent: &'ast InlinedParent,
5251
parent_node: NodeId,
5352
parent_def_path: DefPath,
54-
map: vec::Vec<MapEntry<'ast>>,
53+
map: Vec<MapEntry<'ast>>,
5554
definitions: Definitions)
5655
-> NodeCollector<'ast> {
5756
let mut collector = NodeCollector {

src/librustc/front/map/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ use std::io;
3535
use std::iter;
3636
use std::mem;
3737
use std::slice;
38-
use std::vec;
3938

4039
pub mod blocks;
4140
mod collector;
@@ -165,7 +164,7 @@ impl<'ast> Clone for MapEntry<'ast> {
165164

166165
#[derive(Debug)]
167166
pub struct InlinedParent {
168-
path: vec::Vec<PathElem>,
167+
path: Vec<PathElem>,
169168
ii: InlinedItem
170169
}
171170

@@ -262,7 +261,7 @@ pub struct Map<'ast> {
262261
///
263262
/// Also, indexing is pretty quick when you've got a vector and
264263
/// plain old integers.
265-
map: RefCell<vec::Vec<MapEntry<'ast>>>,
264+
map: RefCell<Vec<MapEntry<'ast>>>,
266265

267266
definitions: RefCell<Definitions>,
268267
}
@@ -843,7 +842,7 @@ pub fn map_crate<'ast>(forest: &'ast mut Forest) -> Map<'ast> {
843842
/// crate. The `path` should be the path to the item but should not include
844843
/// the item itself.
845844
pub fn map_decoded_item<'ast, F: FoldOps>(map: &Map<'ast>,
846-
path: vec::Vec<PathElem>,
845+
path: Vec<PathElem>,
847846
def_path: DefPath,
848847
ii: InlinedItem,
849848
fold_ops: F)

src/librustc/middle/check_match.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ fn construct_witness<'a,'tcx>(cx: &MatchCheckCtxt<'a,'tcx>, ctor: &Constructor,
516516
ty::TyEnum(adt, _) | ty::TyStruct(adt, _) => {
517517
let v = adt.variant_of_ctor(ctor);
518518
if let VariantKind::Struct = v.kind() {
519-
let field_pats: hir::Vec<_> = v.fields.iter()
519+
let field_pats: hir::HirVec<_> = v.fields.iter()
520520
.zip(pats)
521521
.filter(|&(_, ref pat)| pat.node != hir::PatWild)
522522
.map(|(field, pat)| Spanned {
@@ -539,14 +539,14 @@ fn construct_witness<'a,'tcx>(cx: &MatchCheckCtxt<'a,'tcx>, ctor: &Constructor,
539539
ty::TyArray(_, n) => match ctor {
540540
&Single => {
541541
assert_eq!(pats_len, n);
542-
hir::PatVec(pats.collect(), None, hir::Vec::new())
542+
hir::PatVec(pats.collect(), None, hir::HirVec::new())
543543
},
544544
_ => unreachable!()
545545
},
546546
ty::TySlice(_) => match ctor {
547547
&Slice(n) => {
548548
assert_eq!(pats_len, n);
549-
hir::PatVec(pats.collect(), None, hir::Vec::new())
549+
hir::PatVec(pats.collect(), None, hir::HirVec::new())
550550
},
551551
_ => unreachable!()
552552
},
@@ -561,7 +561,7 @@ fn construct_witness<'a,'tcx>(cx: &MatchCheckCtxt<'a,'tcx>, ctor: &Constructor,
561561

562562
ty::TyArray(_, len) => {
563563
assert_eq!(pats_len, len);
564-
hir::PatVec(pats.collect(), None, hir::Vec::new())
564+
hir::PatVec(pats.collect(), None, hir::HirVec::new())
565565
}
566566

567567
_ => {

src/librustc/middle/const_eval.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -352,14 +352,14 @@ pub fn const_expr_to_pat(tcx: &ty::ctxt, expr: &Expr, span: Span) -> P<hir::Pat>
352352

353353
hir::ExprVec(ref exprs) => {
354354
let pats = exprs.iter().map(|expr| const_expr_to_pat(tcx, &**expr, span)).collect();
355-
hir::PatVec(pats, None, hir::Vec::new())
355+
hir::PatVec(pats, None, hir::HirVec::new())
356356
}
357357

358358
hir::ExprPath(_, ref path) => {
359359
let opt_def = tcx.def_map.borrow().get(&expr.id).map(|d| d.full_def());
360360
match opt_def {
361361
Some(def::DefStruct(..)) =>
362-
hir::PatStruct(path.clone(), hir::Vec::new(), false),
362+
hir::PatStruct(path.clone(), hir::HirVec::new(), false),
363363
Some(def::DefVariant(..)) =>
364364
hir::PatEnum(path.clone(), None),
365365
_ => {

src/librustc/middle/infer/error_reporting.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1152,10 +1152,10 @@ impl<'a, 'tcx> Rebuilder<'a, 'tcx> {
11521152
}
11531153

11541154
fn rebuild_ty_params(&self,
1155-
ty_params: hir::Vec<hir::TyParam>,
1155+
ty_params: hir::HirVec<hir::TyParam>,
11561156
lifetime: hir::Lifetime,
11571157
region_names: &HashSet<ast::Name>)
1158-
-> hir::Vec<hir::TyParam> {
1158+
-> hir::HirVec<hir::TyParam> {
11591159
ty_params.move_map(|ty_param| {
11601160
let bounds = self.rebuild_ty_param_bounds(ty_param.bounds,
11611161
lifetime,
@@ -1247,13 +1247,13 @@ impl<'a, 'tcx> Rebuilder<'a, 'tcx> {
12471247
add: &Vec<hir::Lifetime>,
12481248
keep: &HashSet<ast::Name>,
12491249
remove: &HashSet<ast::Name>,
1250-
ty_params: hir::Vec<hir::TyParam>,
1250+
ty_params: hir::HirVec<hir::TyParam>,
12511251
where_clause: hir::WhereClause)
12521252
-> hir::Generics {
12531253
let mut lifetimes = Vec::new();
12541254
for lt in add {
12551255
lifetimes.push(hir::LifetimeDef { lifetime: *lt,
1256-
bounds: hir::Vec::new() });
1256+
bounds: hir::HirVec::new() });
12571257
}
12581258
for lt in &generics.lifetimes {
12591259
if keep.contains(&lt.lifetime.name) ||
@@ -1273,7 +1273,7 @@ impl<'a, 'tcx> Rebuilder<'a, 'tcx> {
12731273
lifetime: hir::Lifetime,
12741274
anon_nums: &HashSet<u32>,
12751275
region_names: &HashSet<ast::Name>)
1276-
-> hir::Vec<hir::Arg> {
1276+
-> hir::HirVec<hir::Arg> {
12771277
let mut new_inputs = Vec::new();
12781278
for arg in inputs {
12791279
let new_ty = self.rebuild_arg_ty_or_output(&*arg.ty, lifetime,

src/librustc_front/fold.rs

+13-11
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub trait Folder : Sized {
3434
noop_fold_crate(c, self)
3535
}
3636

37-
fn fold_meta_items(&mut self, meta_items: Vec<P<MetaItem>>) -> Vec<P<MetaItem>> {
37+
fn fold_meta_items(&mut self, meta_items: HirVec<P<MetaItem>>) -> HirVec<P<MetaItem>> {
3838
noop_fold_meta_items(meta_items, self)
3939
}
4040

@@ -198,19 +198,19 @@ pub trait Folder : Sized {
198198
noop_fold_variant_data(vdata, self)
199199
}
200200

201-
fn fold_lifetimes(&mut self, lts: Vec<Lifetime>) -> Vec<Lifetime> {
201+
fn fold_lifetimes(&mut self, lts: HirVec<Lifetime>) -> HirVec<Lifetime> {
202202
noop_fold_lifetimes(lts, self)
203203
}
204204

205-
fn fold_lifetime_defs(&mut self, lts: Vec<LifetimeDef>) -> Vec<LifetimeDef> {
205+
fn fold_lifetime_defs(&mut self, lts: HirVec<LifetimeDef>) -> HirVec<LifetimeDef> {
206206
noop_fold_lifetime_defs(lts, self)
207207
}
208208

209209
fn fold_ty_param(&mut self, tp: TyParam) -> TyParam {
210210
noop_fold_ty_param(tp, self)
211211
}
212212

213-
fn fold_ty_params(&mut self, tps: Vec<TyParam>) -> Vec<TyParam> {
213+
fn fold_ty_params(&mut self, tps: HirVec<TyParam>) -> HirVec<TyParam> {
214214
noop_fold_ty_params(tps, self)
215215
}
216216

@@ -263,9 +263,9 @@ pub trait Folder : Sized {
263263
}
264264
}
265265

266-
pub fn noop_fold_meta_items<T: Folder>(meta_items: Vec<P<MetaItem>>,
266+
pub fn noop_fold_meta_items<T: Folder>(meta_items: HirVec<P<MetaItem>>,
267267
fld: &mut T)
268-
-> Vec<P<MetaItem>> {
268+
-> HirVec<P<MetaItem>> {
269269
meta_items.move_map(|x| fld.fold_meta_item(x))
270270
}
271271

@@ -304,7 +304,7 @@ pub fn noop_fold_view_path<T: Folder>(view_path: P<ViewPath>, fld: &mut T) -> P<
304304
})
305305
}
306306

307-
pub fn fold_attrs<T: Folder>(attrs: Vec<Attribute>, fld: &mut T) -> Vec<Attribute> {
307+
pub fn fold_attrs<T: Folder>(attrs: HirVec<Attribute>, fld: &mut T) -> HirVec<Attribute> {
308308
attrs.move_flat_map(|x| fld.fold_attribute(x))
309309
}
310310

@@ -575,9 +575,9 @@ pub fn noop_fold_ty_param<T: Folder>(tp: TyParam, fld: &mut T) -> TyParam {
575575
}
576576
}
577577

578-
pub fn noop_fold_ty_params<T: Folder>(tps: Vec<TyParam>,
578+
pub fn noop_fold_ty_params<T: Folder>(tps: HirVec<TyParam>,
579579
fld: &mut T)
580-
-> Vec<TyParam> {
580+
-> HirVec<TyParam> {
581581
tps.move_map(|tp| fld.fold_ty_param(tp))
582582
}
583583

@@ -596,11 +596,13 @@ pub fn noop_fold_lifetime_def<T: Folder>(l: LifetimeDef, fld: &mut T) -> Lifetim
596596
}
597597
}
598598

599-
pub fn noop_fold_lifetimes<T: Folder>(lts: Vec<Lifetime>, fld: &mut T) -> Vec<Lifetime> {
599+
pub fn noop_fold_lifetimes<T: Folder>(lts: HirVec<Lifetime>, fld: &mut T) -> HirVec<Lifetime> {
600600
lts.move_map(|l| fld.fold_lifetime(l))
601601
}
602602

603-
pub fn noop_fold_lifetime_defs<T: Folder>(lts: Vec<LifetimeDef>, fld: &mut T) -> Vec<LifetimeDef> {
603+
pub fn noop_fold_lifetime_defs<T: Folder>(lts: HirVec<LifetimeDef>,
604+
fld: &mut T)
605+
-> HirVec<LifetimeDef> {
604606
lts.move_map(|l| fld.fold_lifetime_def(l))
605607
}
606608

0 commit comments

Comments
 (0)