Skip to content

Commit 3505945

Browse files
committed
---
yaml --- r: 105805 b: refs/heads/master c: c821cac h: refs/heads/master i: 105803: c8cef92 v: v3
1 parent fde9598 commit 3505945

Some content is hidden

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

46 files changed

+186
-280
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d2686c751a45b18dd039dbca86c745dfa2c39f6b
2+
refs/heads/master: c821cacfed19d081fb5822b93f147e62e31e7931
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b8601a3d8b91ad3b653d143307611f2f5c75617e
55
refs/heads/try: db814977d07bd798feb24f6b74c00800ef458a13

trunk/src/compiletest/procsrv.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use std::os;
1212
use std::str;
1313
use std::io::process::{ProcessExit, Process, ProcessConfig, ProcessOutput};
14-
use std::vec;
1514

1615
#[cfg(target_os = "win32")]
1716
fn target_env(lib_path: &str, prog: &str) -> Vec<(~str,~str)> {
@@ -66,8 +65,7 @@ pub fn run(lib_path: &str,
6665
env: Vec<(~str, ~str)> ,
6766
input: Option<~str>) -> Option<Result> {
6867

69-
let env = vec::append(env.clone(),
70-
target_env(lib_path, prog).as_slice());
68+
let env = env.clone().append(target_env(lib_path, prog).as_slice());
7169
let mut opt_process = Process::configure(ProcessConfig {
7270
program: prog,
7371
args: args,
@@ -98,8 +96,7 @@ pub fn run_background(lib_path: &str,
9896
env: Vec<(~str, ~str)> ,
9997
input: Option<~str>) -> Option<Process> {
10098

101-
let env = vec::append(env.clone(),
102-
target_env(lib_path, prog).as_slice());
99+
let env = env.clone().append(target_env(lib_path, prog).as_slice());
103100
let opt_process = Process::configure(ProcessConfig {
104101
program: prog,
105102
args: args,

trunk/src/compiletest/runtest.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ use std::os;
3333
use std::str;
3434
use std::task;
3535
use std::slice;
36-
use std::vec;
3736
use test::MetricMap;
3837

3938
pub fn run(config: config, testfile: ~str) {
@@ -683,7 +682,7 @@ fn compile_test_(config: &config, props: &TestProps,
683682
let link_args = vec!(~"-L", aux_dir.as_str().unwrap().to_owned());
684683
let args = make_compile_args(config,
685684
props,
686-
vec::append(link_args, extra_args),
685+
link_args.append(extra_args),
687686
|a, b| ThisFile(make_exe_name(a, b)), testfile);
688687
compose_and_run_compiler(config, props, testfile, args, None)
689688
}
@@ -734,8 +733,7 @@ fn compose_and_run_compiler(
734733
let aux_args =
735734
make_compile_args(config,
736735
&aux_props,
737-
vec::append(crate_type,
738-
extra_link_args.as_slice()),
736+
crate_type.append(extra_link_args.as_slice()),
739737
|a,b| {
740738
let f = make_lib_name(a, b, testfile);
741739
ThisDirectory(f.dir_path())
@@ -1108,8 +1106,7 @@ fn compile_test_and_save_bitcode(config: &config, props: &TestProps,
11081106
let llvm_args = vec!(~"--emit=obj", ~"--crate-type=lib", ~"-C", ~"save-temps");
11091107
let args = make_compile_args(config,
11101108
props,
1111-
vec::append(link_args,
1112-
llvm_args.as_slice()),
1109+
link_args.append(llvm_args.as_slice()),
11131110
|a, b| ThisFile(make_o_name(a, b)), testfile);
11141111
compose_and_run_compiler(config, props, testfile, args, None)
11151112
}

trunk/src/doc/guide-container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ vectors is as follows:
278278
279279
~~~ {.ignore}
280280
impl<A> FromIterator<A> for ~[A] {
281-
pub fn from_iterator<T: Iterator<A>>(iterator: &mut T) -> ~[A] {
281+
pub fn from_iter<T: Iterator<A>>(iterator: &mut T) -> ~[A] {
282282
let (lower, _) = iterator.size_hint();
283283
let mut xs = with_capacity(lower);
284284
for x in iterator {

trunk/src/libcollections/dlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ impl<A> DoubleEndedIterator<A> for MoveItems<A> {
582582
}
583583

584584
impl<A> FromIterator<A> for DList<A> {
585-
fn from_iterator<T: Iterator<A>>(iterator: T) -> DList<A> {
585+
fn from_iter<T: Iterator<A>>(iterator: T) -> DList<A> {
586586
let mut ret = DList::new();
587587
ret.extend(iterator);
588588
ret

trunk/src/libcollections/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ pub type Values<'a, K, V> =
13561356
iter::Map<'static, (&'a K, &'a V), &'a V, Entries<'a, K, V>>;
13571357

13581358
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S> + Default> FromIterator<(K, V)> for HashMap<K, V, H> {
1359-
fn from_iterator<T: Iterator<(K, V)>>(iter: T) -> HashMap<K, V, H> {
1359+
fn from_iter<T: Iterator<(K, V)>>(iter: T) -> HashMap<K, V, H> {
13601360
let (lower, _) = iter.size_hint();
13611361
let mut map = HashMap::with_capacity_and_hasher(lower, Default::default());
13621362
map.extend(iter);
@@ -1540,7 +1540,7 @@ impl<T: TotalEq + Hash<S> + fmt::Show, S, H: Hasher<S>> fmt::Show for HashSet<T,
15401540
}
15411541

15421542
impl<T: TotalEq + Hash<S>, S, H: Hasher<S> + Default> FromIterator<T> for HashSet<T, H> {
1543-
fn from_iterator<I: Iterator<T>>(iter: I) -> HashSet<T, H> {
1543+
fn from_iter<I: Iterator<T>>(iter: I) -> HashSet<T, H> {
15441544
let (lower, _) = iter.size_hint();
15451545
let mut set = HashSet::with_capacity_and_hasher(lower, Default::default());
15461546
set.extend(iter);

trunk/src/libcollections/priority_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl<'a, T> Iterator<&'a T> for Items<'a, T> {
193193
}
194194

195195
impl<T: Ord> FromIterator<T> for PriorityQueue<T> {
196-
fn from_iterator<Iter: Iterator<T>>(iter: Iter) -> PriorityQueue<T> {
196+
fn from_iter<Iter: Iterator<T>>(iter: Iter) -> PriorityQueue<T> {
197197
let mut q = PriorityQueue::new();
198198
q.extend(iter);
199199
q

trunk/src/libcollections/ringbuf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl<A: Eq> Eq for RingBuf<A> {
386386
}
387387

388388
impl<A> FromIterator<A> for RingBuf<A> {
389-
fn from_iterator<T: Iterator<A>>(iterator: T) -> RingBuf<A> {
389+
fn from_iter<T: Iterator<A>>(iterator: T) -> RingBuf<A> {
390390
let (lower, _) = iterator.size_hint();
391391
let mut deq = RingBuf::with_capacity(lower);
392392
deq.extend(iterator);
@@ -778,7 +778,7 @@ mod tests {
778778
}
779779

780780
#[test]
781-
fn test_from_iterator() {
781+
fn test_from_iter() {
782782
use std::iter;
783783
let v = ~[1,2,3,4,5,6,7];
784784
let deq: RingBuf<int> = v.iter().map(|&x| x).collect();

trunk/src/libcollections/treemap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ fn remove<K: TotalOrd, V>(node: &mut Option<~TreeNode<K, V>>,
971971
}
972972

973973
impl<K: TotalOrd, V> FromIterator<(K, V)> for TreeMap<K, V> {
974-
fn from_iterator<T: Iterator<(K, V)>>(iter: T) -> TreeMap<K, V> {
974+
fn from_iter<T: Iterator<(K, V)>>(iter: T) -> TreeMap<K, V> {
975975
let mut map = TreeMap::new();
976976
map.extend(iter);
977977
map
@@ -988,7 +988,7 @@ impl<K: TotalOrd, V> Extendable<(K, V)> for TreeMap<K, V> {
988988
}
989989

990990
impl<T: TotalOrd> FromIterator<T> for TreeSet<T> {
991-
fn from_iterator<Iter: Iterator<T>>(iter: Iter) -> TreeSet<T> {
991+
fn from_iter<Iter: Iterator<T>>(iter: Iter) -> TreeSet<T> {
992992
let mut set = TreeSet::new();
993993
set.extend(iter);
994994
set

trunk/src/libcollections/trie.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl<T> TrieMap<T> {
261261
}
262262

263263
impl<T> FromIterator<(uint, T)> for TrieMap<T> {
264-
fn from_iterator<Iter: Iterator<(uint, T)>>(iter: Iter) -> TrieMap<T> {
264+
fn from_iter<Iter: Iterator<(uint, T)>>(iter: Iter) -> TrieMap<T> {
265265
let mut map = TrieMap::new();
266266
map.extend(iter);
267267
map
@@ -346,7 +346,7 @@ impl TrieSet {
346346
}
347347

348348
impl FromIterator<uint> for TrieSet {
349-
fn from_iterator<Iter: Iterator<uint>>(iter: Iter) -> TrieSet {
349+
fn from_iter<Iter: Iterator<uint>>(iter: Iter) -> TrieSet {
350350
let mut set = TrieSet::new();
351351
set.extend(iter);
352352
set

trunk/src/libnum/bigint.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use rand::Rng;
2828
use std::str;
2929
use std::uint;
3030
use std::{i64, u64};
31-
use std::vec;
3231

3332
/**
3433
A `BigDigit` is a `BigUint`'s composing element.
@@ -747,8 +746,7 @@ impl BigUint {
747746
fn shl_unit(&self, n_unit: uint) -> BigUint {
748747
if n_unit == 0 || self.is_zero() { return (*self).clone(); }
749748

750-
return BigUint::new(vec::append(Vec::from_elem(n_unit, ZERO_BIG_DIGIT),
751-
self.data.as_slice()));
749+
BigUint::new(Vec::from_elem(n_unit, ZERO_BIG_DIGIT).append(self.data.as_slice()))
752750
}
753751

754752
#[inline]

trunk/src/librustc/driver/driver.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use std::io::fs;
3737
use std::io::MemReader;
3838
use std::mem::drop;
3939
use std::os;
40-
use std::vec;
4140
use getopts::{optopt, optmulti, optflag, optflagopt};
4241
use getopts;
4342
use syntax::ast;
@@ -137,8 +136,7 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
137136
} else {
138137
InternedString::new("nogc")
139138
});
140-
return vec::append(user_cfg.move_iter().collect(),
141-
default_cfg.as_slice());
139+
user_cfg.move_iter().collect::<Vec<_>>().append(default_cfg.as_slice())
142140
}
143141

144142
// Convert strings provided as --cfg [cfgspec] into a crate_cfg
@@ -836,9 +834,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> session::Options {
836834

837835
let level_short = level_name.slice_chars(0, 1);
838836
let level_short = level_short.to_ascii().to_upper().into_str();
839-
let flags = vec::append(matches.opt_strs(level_short)
840-
.move_iter()
841-
.collect(),
837+
let flags = matches.opt_strs(level_short).move_iter().collect::<Vec<_>>().append(
842838
matches.opt_strs(level_name).as_slice());
843839
for lint_name in flags.iter() {
844840
let lint_name = lint_name.replace("-", "_");

trunk/src/librustc/front/std_inject.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use driver::session::Session;
1313

14-
use std::vec;
1514
use syntax::ast;
1615
use syntax::attr;
1716
use syntax::codemap::DUMMY_SP;
@@ -173,7 +172,7 @@ impl<'a> fold::Folder for PreludeInjector<'a> {
173172
span: DUMMY_SP,
174173
};
175174

176-
let vis = vec::append(vec!(vi2), module.view_items.as_slice());
175+
let vis = (vec!(vi2)).append(module.view_items.as_slice());
177176

178177
// FIXME #2543: Bad copy.
179178
let new_module = ast::Mod {

trunk/src/librustc/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ fn should_fail(i: @ast::Item) -> bool {
272272
fn add_test_module(cx: &TestCtxt, m: &ast::Mod) -> ast::Mod {
273273
let testmod = mk_test_module(cx);
274274
ast::Mod {
275-
items: vec::append_one(m.items.clone(), testmod),
275+
items: m.items.clone().append_one(testmod),
276276
..(*m).clone()
277277
}
278278
}

trunk/src/librustc/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ use std::io;
5454
use std::os;
5555
use std::str;
5656
use std::task;
57-
use std::vec;
5857
use syntax::ast;
5958
use syntax::diagnostic::Emitter;
6059
use syntax::diagnostic;
@@ -239,9 +238,7 @@ pub fn run_compiler(args: &[~str]) {
239238
return;
240239
}
241240

242-
let lint_flags = vec::append(matches.opt_strs("W")
243-
.move_iter()
244-
.collect(),
241+
let lint_flags = matches.opt_strs("W").move_iter().collect::<Vec<_>>().append(
245242
matches.opt_strs("warn").as_slice());
246243
if lint_flags.iter().any(|x| x == &~"help") {
247244
describe_warnings();

trunk/src/librustc/metadata/csearch.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use middle::typeck;
2020

2121
use reader = serialize::ebml::reader;
2222
use std::rc::Rc;
23-
use std::vec;
2423
use syntax::ast;
2524
use syntax::ast_map;
2625
use syntax::diagnostic::expect;
@@ -93,8 +92,7 @@ pub fn get_item_path(tcx: &ty::ctxt, def: ast::DefId) -> Vec<ast_map::PathElem>
9392

9493
// FIXME #1920: This path is not always correct if the crate is not linked
9594
// into the root namespace.
96-
vec::append(vec!(ast_map::PathMod(token::intern(cdata.name))),
97-
path.as_slice())
95+
(vec!(ast_map::PathMod(token::intern(cdata.name)))).append(path.as_slice())
9896
}
9997

10098
pub enum found_ast {

trunk/src/librustc/middle/borrowck/gather_loans/restrictions.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* Computes the restrictions that result from a borrow.
1313
*/
1414

15-
use std::vec;
1615
use middle::borrowck::*;
1716
use mc = middle::mem_categorization;
1817
use middle::ty;
@@ -173,11 +172,7 @@ impl<'a> RestrictionsContext<'a> {
173172
Safe => Safe,
174173
SafeIf(base_lp, base_vec) => {
175174
let lp = @LpExtend(base_lp, mc, elem);
176-
SafeIf(lp, vec::append_one(base_vec,
177-
Restriction {
178-
loan_path: lp,
179-
set: restrictions
180-
}))
175+
SafeIf(lp, base_vec.append_one(Restriction { loan_path: lp, set: restrictions }))
181176
}
182177
}
183178
}

trunk/src/librustc/middle/check_match.rs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use util::ppaux::ty_to_str;
2121

2222
use std::cmp;
2323
use std::iter;
24-
use std::vec;
2524
use syntax::ast::*;
2625
use syntax::ast_util::{unguarded_pat, walk_pat};
2726
use syntax::codemap::{DUMMY_SP, Span};
@@ -560,11 +559,10 @@ fn specialize(cx: &MatchCheckCtxt,
560559
Pat{id: pat_id, node: n, span: pat_span} =>
561560
match n {
562561
PatWild => {
563-
Some(vec::append(Vec::from_elem(arity, wild()), r.tail()))
562+
Some(Vec::from_elem(arity, wild()).append(r.tail()))
564563
}
565564
PatWildMulti => {
566-
Some(vec::append(Vec::from_elem(arity, wild_multi()),
567-
r.tail()))
565+
Some(Vec::from_elem(arity, wild_multi()).append(r.tail()))
568566
}
569567
PatIdent(_, _, _) => {
570568
let opt_def = cx.tcx.def_map.borrow().find_copy(&pat_id);
@@ -615,12 +613,7 @@ fn specialize(cx: &MatchCheckCtxt,
615613
}
616614
}
617615
_ => {
618-
Some(
619-
vec::append(
620-
Vec::from_elem(arity, wild()),
621-
r.tail()
622-
)
623-
)
616+
Some(Vec::from_elem(arity, wild()).append(r.tail()))
624617
}
625618
}
626619
}
@@ -667,7 +660,7 @@ fn specialize(cx: &MatchCheckCtxt,
667660
Some(args) => args.iter().map(|x| *x).collect(),
668661
None => Vec::from_elem(arity, wild())
669662
};
670-
Some(vec::append(args, r.tail()))
663+
Some(args.append(r.tail()))
671664
}
672665
DefVariant(_, _, _) => None,
673666

@@ -680,7 +673,7 @@ fn specialize(cx: &MatchCheckCtxt,
680673
}
681674
None => new_args = Vec::from_elem(arity, wild())
682675
}
683-
Some(vec::append(new_args, r.tail()))
676+
Some(new_args.append(r.tail()))
684677
}
685678
_ => None
686679
}
@@ -697,8 +690,8 @@ fn specialize(cx: &MatchCheckCtxt,
697690
Some(f) => f.pat,
698691
_ => wild()
699692
}
700-
}).collect();
701-
Some(vec::append(args, r.tail()))
693+
}).collect::<Vec<_>>();
694+
Some(args.append(r.tail()))
702695
} else {
703696
None
704697
}
@@ -728,16 +721,16 @@ fn specialize(cx: &MatchCheckCtxt,
728721
Some(f) => f.pat,
729722
_ => wild()
730723
}
731-
}).collect();
732-
Some(vec::append(args, r.tail()))
724+
}).collect::<Vec<_>>();
725+
Some(args.append(r.tail()))
733726
}
734727
}
735728
}
736729
PatTup(args) => {
737-
Some(vec::append(args.iter().map(|x| *x).collect(), r.tail()))
730+
Some(args.iter().map(|x| *x).collect::<Vec<_>>().append(r.tail()))
738731
}
739732
PatUniq(a) | PatRegion(a) => {
740-
Some(vec::append(vec!(a), r.tail()))
733+
Some((vec!(a)).append(r.tail()))
741734
}
742735
PatLit(expr) => {
743736
let e_v = eval_const_expr(cx.tcx, expr);

0 commit comments

Comments
 (0)