Skip to content

Commit b077f50

Browse files
committed
---
yaml --- r: 142507 b: refs/heads/try2 c: 65ed803 h: refs/heads/master i: 142505: e5a7cef 142503: 9df72e0 v: v3
1 parent ad45f72 commit b077f50

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+366
-257
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: d49acef07be04a2d32021dd1edadcf76582eda2c
8+
refs/heads/try2: 65ed80339b52bae26457f5c19dc9861bd7de643e
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/etc/local_stage0.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fi
4343

4444
cp ${PREFIX}/bin/rustc ${TARG_DIR}/stage0/bin/
4545
cp ${PREFIX}/lib/rustc/${TARG_DIR}/${LIBDIR}/* ${TARG_DIR}/stage0/${LIBDIR}/
46+
cp ${PREFIX}/lib/libextra*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
4647
cp ${PREFIX}/lib/librust*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
47-
cp ${PREFIX}/lib/libcore*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
4848
cp ${PREFIX}/lib/libstd*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
4949
cp ${PREFIX}/lib/libsyntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/

branches/try2/src/libextra/getopts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ fn name_str(nm: &Name) -> ~str {
176176
}
177177

178178
fn find_opt(opts: &[Opt], nm: Name) -> Option<uint> {
179-
opts.iter().position_(|opt| opt.name == nm)
179+
opts.iter().position(|opt| opt.name == nm)
180180
}
181181

182182
/**

branches/try2/src/libextra/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ impl serialize::Decoder for Decoder {
950950
}
951951
ref json => fail!("invalid variant: %?", *json),
952952
};
953-
let idx = match names.iter().position_(|n| str::eq_slice(*n, name)) {
953+
let idx = match names.iter().position(|n| str::eq_slice(*n, name)) {
954954
Some(idx) => idx,
955955
None => fail!("Unknown variant name: %?", name),
956956
};

branches/try2/src/libextra/net/ip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub mod v4 {
203203
}).collect();
204204
if parts.len() != 4 {
205205
Err(fmt!("'%s' doesn't have 4 parts", ip))
206-
} else if parts.iter().any_(|x| *x == 256u) {
206+
} else if parts.iter().any(|x| *x == 256u) {
207207
Err(fmt!("invalid octal in addr '%s'", ip))
208208
} else {
209209
Ok(Ipv4Rep {

branches/try2/src/libextra/net/url.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ fn get_authority(rawurl: &str) ->
522522
let host_is_end_plus_one: &fn() -> bool = || {
523523
let xs = ['?', '#', '/'];
524524
end+1 == len
525-
&& !xs.iter().any_(|x| *x == (rawurl[end] as char))
525+
&& !xs.iter().any(|x| *x == (rawurl[end] as char))
526526
};
527527

528528
// finish up

branches/try2/src/libextra/par.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ pub fn any<A:Copy + Send>(
136136
fn_factory: &fn() -> ~fn(&A) -> bool) -> bool {
137137
let mapped = map_slices(xs, || {
138138
let f = fn_factory();
139-
let result: ~fn(uint, &[A]) -> bool = |_, slice| slice.iter().any_(f);
139+
let result: ~fn(uint, &[A]) -> bool = |_, slice| slice.iter().any(f);
140140
result
141141
});
142-
mapped.iter().any_(|&x| x)
142+
mapped.iter().any(|&x| x)
143143
}

branches/try2/src/libextra/terminfo/parser/compiled.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> {
294294

295295
// Find the offset of the NUL we want to go to
296296
let nulpos = string_table.slice(offset as uint, string_table_bytes as uint)
297-
.iter().position_(|&b| b == 0);
297+
.iter().position(|&b| b == 0);
298298
match nulpos {
299299
Some(len) => {
300300
string_map.insert(name.to_owned(),

branches/try2/src/libextra/treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ mod test_treemap {
844844
for 90.times {
845845
let k = rng.gen();
846846
let v = rng.gen();
847-
if !ctrl.iter().any_(|x| x == &(k, v)) {
847+
if !ctrl.iter().any(|x| x == &(k, v)) {
848848
assert!(map.insert(k, v));
849849
ctrl.push((k, v));
850850
check_structure(&map);

branches/try2/src/librustc/front/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub fn metas_in_cfg(cfg: &[@ast::meta_item],
194194

195195
if cfg_metas.iter().all(|c| c.is_empty()) { return true; }
196196

197-
cfg_metas.iter().any_(|cfg_meta| {
197+
cfg_metas.iter().any(|cfg_meta| {
198198
cfg_meta.iter().all(|cfg_mi| {
199199
match cfg_mi.node {
200200
ast::meta_list(s, ref it) if "not" == s

branches/try2/src/librustc/front/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ fn mk_test_module(cx: &TestCtxt) -> @ast::item {
309309
let mainfn = (quote_item!(
310310
pub fn main() {
311311
#[main];
312-
extra::test::test_main_static(::std::os::args(), tests);
312+
extra::test::test_main_static(::std::os::args(), TESTS);
313313
}
314314
)).get();
315315

@@ -366,7 +366,7 @@ fn mk_tests(cx: &TestCtxt) -> @ast::item {
366366
let test_descs = mk_test_descs(cx);
367367

368368
(quote_item!(
369-
pub static tests : &'static [self::extra::test::TestDescAndFn] =
369+
pub static TESTS : &'static [self::extra::test::TestDescAndFn] =
370370
$test_descs
371371
;
372372
)).get()

branches/try2/src/librustc/metadata/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub fn get_used_crate_files(cstore: &CStore) -> ~[Path] {
102102
pub fn add_used_library(cstore: &mut CStore, lib: @str) -> bool {
103103
assert!(!lib.is_empty());
104104

105-
if cstore.used_libraries.iter().any_(|x| x == &lib) { return false; }
105+
if cstore.used_libraries.iter().any(|x| x == &lib) { return false; }
106106
cstore.used_libraries.push(lib);
107107
true
108108
}

branches/try2/src/librustc/middle/borrowck/move_data.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ impl FlowedMoveData {
506506
for self.dfcx_moves.each_bit_on_entry_frozen(id) |index| {
507507
let move = &self.move_data.moves[index];
508508
let moved_path = move.path;
509-
if base_indices.iter().any_(|x| x == &moved_path) {
509+
if base_indices.iter().any(|x| x == &moved_path) {
510510
// Scenario 1 or 2: `loan_path` or some base path of
511511
// `loan_path` was moved.
512512
if !f(move, self.move_data.path(moved_path).loan_path) {
@@ -535,7 +535,7 @@ impl FlowedMoveData {
535535
-> bool {
536536
//! True if `id` is the id of the LHS of an assignment
537537
538-
self.move_data.assignee_ids.iter().any_(|x| x == &id)
538+
self.move_data.assignee_ids.iter().any(|x| x == &id)
539539
}
540540

541541
pub fn each_assignment_of(&self,

branches/try2/src/librustc/middle/check_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub fn check_item_recursion(sess: Session,
224224
(visitor.visit_item)(it, (env, visitor));
225225

226226
fn visit_item(it: @item, (env, v): (env, visit::vt<env>)) {
227-
if env.idstack.iter().any_(|x| x == &(it.id)) {
227+
if env.idstack.iter().any(|x| x == &(it.id)) {
228228
env.sess.span_fatal(env.root_it.span, "recursive constant");
229229
}
230230
env.idstack.push(it.id);

branches/try2/src/librustc/middle/check_match.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ pub fn missing_ctor(cx: &MatchCheckCtxt,
371371
let variants = ty::enum_variants(cx.tcx, eid);
372372
if found.len() != (*variants).len() {
373373
for (*variants).iter().advance |v| {
374-
if !found.iter().any_(|x| x == &(variant(v.id))) {
374+
if !found.iter().any(|x| x == &(variant(v.id))) {
375375
return Some(variant(v.id));
376376
}
377377
}
@@ -805,13 +805,13 @@ pub fn is_refutable(cx: &MatchCheckCtxt, pat: &pat) -> bool {
805805
}
806806
pat_lit(_) | pat_range(_, _) => { true }
807807
pat_struct(_, ref fields, _) => {
808-
fields.iter().any_(|f| is_refutable(cx, f.pat))
808+
fields.iter().any(|f| is_refutable(cx, f.pat))
809809
}
810810
pat_tup(ref elts) => {
811-
elts.iter().any_(|elt| is_refutable(cx, *elt))
811+
elts.iter().any(|elt| is_refutable(cx, *elt))
812812
}
813813
pat_enum(_, Some(ref args)) => {
814-
args.iter().any_(|a| is_refutable(cx, *a))
814+
args.iter().any(|a| is_refutable(cx, *a))
815815
}
816816
pat_enum(_,_) => { false }
817817
pat_vec(*) => { true }

branches/try2/src/librustc/middle/dataflow.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,14 @@ impl<O:DataFlowOperator+Copy+'static> DataFlowContext<O> {
341341
let entry_str = bits_to_str(on_entry);
342342

343343
let gens = self.gens.slice(start, end);
344-
let gens_str = if gens.iter().any_(|&u| u != 0) {
344+
let gens_str = if gens.iter().any(|&u| u != 0) {
345345
fmt!(" gen: %s", bits_to_str(gens))
346346
} else {
347347
~""
348348
};
349349

350350
let kills = self.kills.slice(start, end);
351-
let kills_str = if kills.iter().any_(|&u| u != 0) {
351+
let kills_str = if kills.iter().any(|&u| u != 0) {
352352
fmt!(" kill: %s", bits_to_str(kills))
353353
} else {
354354
~""
@@ -643,7 +643,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
643643
self.walk_opt_expr(o_e, in_out, loop_scopes);
644644

645645
// is this a return from a `for`-loop closure?
646-
match loop_scopes.iter().position_(|s| s.loop_kind == ForLoop) {
646+
match loop_scopes.iter().position(|s| s.loop_kind == ForLoop) {
647647
Some(i) => {
648648
// if so, add the in_out bits to the state
649649
// upon exit. Remember that we cannot count
@@ -916,7 +916,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
916916
Some(_) => {
917917
match self.tcx().def_map.find(&expr.id) {
918918
Some(&ast::def_label(loop_id)) => {
919-
match loop_scopes.iter().position_(|l| l.loop_id == loop_id) {
919+
match loop_scopes.iter().position(|l| l.loop_id == loop_id) {
920920
Some(i) => i,
921921
None => {
922922
self.tcx().sess.span_bug(

branches/try2/src/librustc/middle/kind.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ pub fn check_cast_for_escaping_regions(
536536
// Check, based on the region associated with the trait, whether it can
537537
// possibly escape the enclosing fn item (note that all type parameters
538538
// must have been declared on the enclosing fn item).
539-
if target_regions.iter().any_(|r| is_re_scope(*r)) {
539+
if target_regions.iter().any(|r| is_re_scope(*r)) {
540540
return; /* case (1) */
541541
}
542542

@@ -551,7 +551,7 @@ pub fn check_cast_for_escaping_regions(
551551
|_r| {
552552
// FIXME(#5723) --- turn this check on once &Objects are usable
553553
//
554-
// if !target_regions.iter().any_(|t_r| is_subregion_of(cx, *t_r, r)) {
554+
// if !target_regions.iter().any(|t_r| is_subregion_of(cx, *t_r, r)) {
555555
// cx.tcx.sess.span_err(
556556
// source.span,
557557
// fmt!("source contains borrowed pointer with lifetime \
@@ -565,7 +565,7 @@ pub fn check_cast_for_escaping_regions(
565565
|ty| {
566566
match ty::get(ty).sty {
567567
ty::ty_param(source_param) => {
568-
if target_params.iter().any_(|x| x == &source_param) {
568+
if target_params.iter().any(|x| x == &source_param) {
569569
/* case (2) */
570570
} else {
571571
check_durable(cx.tcx, ty, source.span); /* case (3) */

branches/try2/src/librustc/middle/lang_items.rs

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -63,33 +63,34 @@ pub enum LangItem {
6363
FailFnLangItem, // 24
6464
FailBoundsCheckFnLangItem, // 25
6565
ExchangeMallocFnLangItem, // 26
66-
ClosureExchangeMallocFnLangItem, // 27
67-
ExchangeFreeFnLangItem, // 28
68-
MallocFnLangItem, // 29
69-
FreeFnLangItem, // 30
70-
BorrowAsImmFnLangItem, // 31
71-
BorrowAsMutFnLangItem, // 32
72-
ReturnToMutFnLangItem, // 33
73-
CheckNotBorrowedFnLangItem, // 34
74-
StrDupUniqFnLangItem, // 35
75-
RecordBorrowFnLangItem, // 36
76-
UnrecordBorrowFnLangItem, // 37
77-
78-
StartFnLangItem, // 38
79-
80-
TyDescStructLangItem, // 39
81-
TyVisitorTraitLangItem, // 40
82-
OpaqueStructLangItem, // 41
66+
VectorExchangeMallocFnLangItem, // 27
67+
ClosureExchangeMallocFnLangItem, // 28
68+
ExchangeFreeFnLangItem, // 29
69+
MallocFnLangItem, // 30
70+
FreeFnLangItem, // 31
71+
BorrowAsImmFnLangItem, // 32
72+
BorrowAsMutFnLangItem, // 33
73+
ReturnToMutFnLangItem, // 34
74+
CheckNotBorrowedFnLangItem, // 35
75+
StrDupUniqFnLangItem, // 36
76+
RecordBorrowFnLangItem, // 37
77+
UnrecordBorrowFnLangItem, // 38
78+
79+
StartFnLangItem, // 39
80+
81+
TyDescStructLangItem, // 40
82+
TyVisitorTraitLangItem, // 41
83+
OpaqueStructLangItem, // 42
8384
}
8485

8586
pub struct LanguageItems {
86-
items: [Option<def_id>, ..42]
87+
items: [Option<def_id>, ..43]
8788
}
8889

8990
impl LanguageItems {
9091
pub fn new() -> LanguageItems {
9192
LanguageItems {
92-
items: [ None, ..42 ]
93+
items: [ None, ..43 ]
9394
}
9495
}
9596

@@ -129,23 +130,24 @@ impl LanguageItems {
129130
24 => "fail_",
130131
25 => "fail_bounds_check",
131132
26 => "exchange_malloc",
132-
27 => "closure_exchange_malloc",
133-
28 => "exchange_free",
134-
29 => "malloc",
135-
30 => "free",
136-
31 => "borrow_as_imm",
137-
32 => "borrow_as_mut",
138-
33 => "return_to_mut",
139-
34 => "check_not_borrowed",
140-
35 => "strdup_uniq",
141-
36 => "record_borrow",
142-
37 => "unrecord_borrow",
143-
144-
38 => "start",
145-
146-
39 => "ty_desc",
147-
40 => "ty_visitor",
148-
41 => "opaque",
133+
27 => "vector_exchange_malloc",
134+
28 => "closure_exchange_malloc",
135+
29 => "exchange_free",
136+
30 => "malloc",
137+
31 => "free",
138+
32 => "borrow_as_imm",
139+
33 => "borrow_as_mut",
140+
34 => "return_to_mut",
141+
35 => "check_not_borrowed",
142+
36 => "strdup_uniq",
143+
37 => "record_borrow",
144+
38 => "unrecord_borrow",
145+
146+
39 => "start",
147+
148+
40 => "ty_desc",
149+
41 => "ty_visitor",
150+
42 => "opaque",
149151

150152
_ => "???"
151153
}
@@ -238,6 +240,9 @@ impl LanguageItems {
238240
pub fn exchange_malloc_fn(&self) -> def_id {
239241
self.items[ExchangeMallocFnLangItem as uint].get()
240242
}
243+
pub fn vector_exchange_malloc_fn(&self) -> def_id {
244+
self.items[VectorExchangeMallocFnLangItem as uint].get()
245+
}
241246
pub fn closure_exchange_malloc_fn(&self) -> def_id {
242247
self.items[ClosureExchangeMallocFnLangItem as uint].get()
243248
}
@@ -331,6 +336,7 @@ impl<'self> LanguageItemCollector<'self> {
331336
item_refs.insert(@"fail_bounds_check",
332337
FailBoundsCheckFnLangItem as uint);
333338
item_refs.insert(@"exchange_malloc", ExchangeMallocFnLangItem as uint);
339+
item_refs.insert(@"vector_exchange_malloc", VectorExchangeMallocFnLangItem as uint);
334340
item_refs.insert(@"closure_exchange_malloc", ClosureExchangeMallocFnLangItem as uint);
335341
item_refs.insert(@"exchange_free", ExchangeFreeFnLangItem as uint);
336342
item_refs.insert(@"malloc", MallocFnLangItem as uint);

branches/try2/src/librustc/middle/lint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ fn check_item_non_uppercase_statics(cx: &Context, it: &ast::item) {
898898
// check for lowercase letters rather than non-uppercase
899899
// ones (some scripts don't have a concept of
900900
// upper/lowercase)
901-
if s.iter().any_(|c| c.is_lowercase()) {
901+
if s.iter().any(|c| c.is_lowercase()) {
902902
cx.span_lint(non_uppercase_statics, it.span,
903903
"static constant should have an uppercase identifier");
904904
}
@@ -1038,7 +1038,7 @@ fn lint_missing_doc() -> visit::vt<@mut Context> {
10381038
// If we have doc(hidden), nothing to do
10391039
if cx.doc_hidden { return }
10401040
// If we're documented, nothing to do
1041-
if attrs.iter().any_(|a| a.node.is_sugared_doc) { return }
1041+
if attrs.iter().any(|a| a.node.is_sugared_doc) { return }
10421042

10431043
// otherwise, warn!
10441044
cx.span_lint(missing_doc, sp, msg);

branches/try2/src/librustc/middle/moves.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ impl VisitContext {
390390
// any fields which (1) were not explicitly
391391
// specified and (2) have a type that
392392
// moves-by-default:
393-
let consume_with = with_fields.iter().any_(|tf| {
394-
!fields.iter().any_(|f| f.node.ident == tf.ident) &&
393+
let consume_with = with_fields.iter().any(|tf| {
394+
!fields.iter().any(|f| f.node.ident == tf.ident) &&
395395
ty::type_moves_by_default(self.tcx, tf.mt.ty)
396396
});
397397

0 commit comments

Comments
 (0)