diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index b290bd2838ab3..c605596b9629e 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -451,7 +451,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) { let options_to_remove = [~"-O", ~"-g", ~"--debuginfo"]; let new_options = split_maybe_args(options).move_iter() .filter(|x| !options_to_remove.contains(x)) - .collect::<~[~str]>() + .collect::>() .connect(" "); Some(new_options) } diff --git a/src/libflate/lib.rs b/src/libflate/lib.rs index 753a3120c2157..ea5ffb9965a0f 100644 --- a/src/libflate/lib.rs +++ b/src/libflate/lib.rs @@ -117,13 +117,13 @@ mod tests { words.push(r.gen_vec::(range)); } for _ in range(0, 20) { - let mut input = ~[]; + let mut input = vec![]; for _ in range(0, 2000) { input.push_all(r.choose(words.as_slice()).as_slice()); } debug!("de/inflate of {} bytes of random word-sequences", input.len()); - let cmp = deflate_bytes(input).expect("deflation failed"); + let cmp = deflate_bytes(input.as_slice()).expect("deflation failed"); let out = inflate_bytes(cmp.as_slice()).expect("inflation failed"); debug!("{} bytes deflated to {} ({:.1f}% size)", input.len(), cmp.len(), diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index 9d4f2e2f8f082..52fbcc0cb1cab 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -53,7 +53,7 @@ //! //! let program = args[0].clone(); //! -//! let opts = ~[ +//! let opts = [ //! optopt("o", "", "set output file name", "NAME"), //! optflag("h", "help", "print this help menu") //! ]; diff --git a/src/libglob/lib.rs b/src/libglob/lib.rs index 5065fed01292f..ca49a1be97bae 100644 --- a/src/libglob/lib.rs +++ b/src/libglob/lib.rs @@ -31,6 +31,8 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://static.rust-lang.org/doc/master")] +#![deny(deprecated_owned_vector)] + use std::cell::Cell; use std::{cmp, os, path}; use std::io::fs; @@ -225,26 +227,26 @@ impl Pattern { */ pub fn new(pattern: &str) -> Pattern { - let chars = pattern.chars().collect::<~[_]>(); + let chars = pattern.chars().collect::>(); let mut tokens = Vec::new(); let mut i = 0; while i < chars.len() { - match chars[i] { + match *chars.get(i) { '?' => { tokens.push(AnyChar); i += 1; } '*' => { // *, **, ***, ****, ... are all equivalent - while i < chars.len() && chars[i] == '*' { + while i < chars.len() && *chars.get(i) == '*' { i += 1; } tokens.push(AnySequence); } '[' => { - if i <= chars.len() - 4 && chars[i + 1] == '!' { + if i <= chars.len() - 4 && *chars.get(i + 1) == '!' { match chars.slice_from(i + 3).position_elem(&']') { None => (), Some(j) => { @@ -256,7 +258,7 @@ impl Pattern { } } } - else if i <= chars.len() - 3 && chars[i + 1] != '!' { + else if i <= chars.len() - 3 && *chars.get(i + 1) != '!' { match chars.slice_from(i + 2).position_elem(&']') { None => (), Some(j) => { diff --git a/src/libgreen/basic.rs b/src/libgreen/basic.rs index 62b6f71ae9c6b..2877768dd8bfe 100644 --- a/src/libgreen/basic.rs +++ b/src/libgreen/basic.rs @@ -27,11 +27,11 @@ pub fn event_loop() -> ~EventLoop:Send { } struct BasicLoop { - work: ~[proc():Send], // pending work + work: Vec, // pending work idle: Option<*mut BasicPausable>, // only one is allowed - remotes: ~[(uint, ~Callback:Send)], + remotes: Vec<(uint, ~Callback:Send)>, next_remote: uint, - messages: Exclusive<~[Message]>, + messages: Exclusive>, } enum Message { RunRemote(uint), RemoveRemote(uint) } @@ -39,18 +39,18 @@ enum Message { RunRemote(uint), RemoveRemote(uint) } impl BasicLoop { fn new() -> BasicLoop { BasicLoop { - work: ~[], + work: vec![], idle: None, next_remote: 0, - remotes: ~[], - messages: Exclusive::new(~[]), + remotes: vec![], + messages: Exclusive::new(vec![]), } } /// Process everything in the work queue (continually) fn work(&mut self) { while self.work.len() > 0 { - for work in replace(&mut self.work, ~[]).move_iter() { + for work in replace(&mut self.work, vec![]).move_iter() { work(); } } @@ -60,7 +60,7 @@ impl BasicLoop { let messages = unsafe { self.messages.with(|messages| { if messages.len() > 0 { - Some(replace(messages, ~[])) + Some(replace(messages, vec![])) } else { None } @@ -165,12 +165,12 @@ impl EventLoop for BasicLoop { } struct BasicRemote { - queue: Exclusive<~[Message]>, + queue: Exclusive>, id: uint, } impl BasicRemote { - fn new(queue: Exclusive<~[Message]>, id: uint) -> BasicRemote { + fn new(queue: Exclusive>, id: uint) -> BasicRemote { BasicRemote { queue: queue, id: id } } } diff --git a/src/libgreen/lib.rs b/src/libgreen/lib.rs index e4a9641efd1b7..820627b6b7d13 100644 --- a/src/libgreen/lib.rs +++ b/src/libgreen/lib.rs @@ -195,6 +195,7 @@ // NB this does *not* include globs, please keep it that way. #![feature(macro_rules, phase)] #![allow(visible_private_types)] +#![deny(deprecated_owned_vector)] #[cfg(test)] #[phase(syntax, link)] extern crate log; #[cfg(test)] extern crate rustuv; @@ -209,7 +210,6 @@ use std::rt; use std::sync::atomics::{SeqCst, AtomicUint, INIT_ATOMIC_UINT}; use std::sync::deque; use std::task::TaskOpts; -use std::slice; use std::sync::arc::UnsafeArc; use sched::{Shutdown, Scheduler, SchedHandle, TaskFromFriend, NewNeighbor}; @@ -318,9 +318,9 @@ impl PoolConfig { /// used to keep the pool alive and also reap the status from the pool. pub struct SchedPool { id: uint, - threads: ~[Thread<()>], - handles: ~[SchedHandle], - stealers: ~[deque::Stealer<~task::GreenTask>], + threads: Vec>, + handles: Vec, + stealers: Vec>, next_friend: uint, stack_pool: StackPool, deque_pool: deque::BufferPool<~task::GreenTask>, @@ -356,9 +356,9 @@ impl SchedPool { // The pool of schedulers that will be returned from this function let (p, state) = TaskState::new(); let mut pool = SchedPool { - threads: ~[], - handles: ~[], - stealers: ~[], + threads: vec![], + handles: vec![], + stealers: vec![], id: unsafe { POOL_ID.fetch_add(1, SeqCst) }, sleepers: SleeperList::new(), stack_pool: StackPool::new(), @@ -371,8 +371,14 @@ impl SchedPool { // Create a work queue for each scheduler, ntimes. Create an extra // for the main thread if that flag is set. We won't steal from it. - let arr = slice::from_fn(nscheds, |_| pool.deque_pool.deque()); - let (workers, stealers) = slice::unzip(arr.move_iter()); + let mut workers = Vec::with_capacity(nscheds); + let mut stealers = Vec::with_capacity(nscheds); + + for _ in range(0, nscheds) { + let (w, s) = pool.deque_pool.deque(); + workers.push(w); + stealers.push(s); + } pool.stealers = stealers; // Now that we've got all our work queues, create one scheduler per @@ -420,7 +426,7 @@ impl SchedPool { } // Jettison the task away! - self.handles[idx].send(TaskFromFriend(task)); + self.handles.get_mut(idx).send(TaskFromFriend(task)); } /// Spawns a new scheduler into this M:N pool. A handle is returned to the @@ -466,7 +472,7 @@ impl SchedPool { /// This only waits for all tasks in *this pool* of schedulers to exit, any /// native tasks or extern pools will not be waited on pub fn shutdown(mut self) { - self.stealers = ~[]; + self.stealers = vec![]; // Wait for everyone to exit. We may have reached a 0-task count // multiple times in the past, meaning there could be several buffered @@ -478,10 +484,10 @@ impl SchedPool { } // Now that everyone's gone, tell everything to shut down. - for mut handle in replace(&mut self.handles, ~[]).move_iter() { + for mut handle in replace(&mut self.handles, vec![]).move_iter() { handle.send(Shutdown); } - for thread in replace(&mut self.threads, ~[]).move_iter() { + for thread in replace(&mut self.threads, vec![]).move_iter() { thread.join(); } } diff --git a/src/libgreen/sched.rs b/src/libgreen/sched.rs index 036d02655f9f0..9971dfee82815 100644 --- a/src/libgreen/sched.rs +++ b/src/libgreen/sched.rs @@ -49,7 +49,7 @@ pub struct Scheduler { work_queue: deque::Worker<~GreenTask>, /// Work queues for the other schedulers. These are created by /// cloning the core work queues. - work_queues: ~[deque::Stealer<~GreenTask>], + work_queues: Vec>, /// The queue of incoming messages from other schedulers. /// These are enqueued by SchedHandles after which a remote callback /// is triggered to handle the message. @@ -125,7 +125,7 @@ impl Scheduler { pub fn new(pool_id: uint, event_loop: ~EventLoop:Send, work_queue: deque::Worker<~GreenTask>, - work_queues: ~[deque::Stealer<~GreenTask>], + work_queues: Vec>, sleeper_list: SleeperList, state: TaskState) -> Scheduler { @@ -138,7 +138,7 @@ impl Scheduler { pub fn new_special(pool_id: uint, event_loop: ~EventLoop:Send, work_queue: deque::Worker<~GreenTask>, - work_queues: ~[deque::Stealer<~GreenTask>], + work_queues: Vec>, sleeper_list: SleeperList, run_anything: bool, friend: Option, @@ -502,7 +502,7 @@ impl Scheduler { let len = work_queues.len(); let start_index = self.rng.gen_range(0, len); for index in range(0, len).map(|i| (i + start_index) % len) { - match work_queues[index].steal() { + match work_queues.get_mut(index).steal() { deque::Data(task) => { rtdebug!("found task by stealing"); return Some(task) @@ -1137,7 +1137,7 @@ mod test { let mut pool = BufferPool::new(); let (normal_worker, normal_stealer) = pool.deque(); let (special_worker, special_stealer) = pool.deque(); - let queues = ~[normal_stealer, special_stealer]; + let queues = vec![normal_stealer, special_stealer]; let (_p, state) = TaskState::new(); // Our normal scheduler @@ -1326,7 +1326,7 @@ mod test { #[test] fn multithreading() { run(proc() { - let mut rxs = ~[]; + let mut rxs = vec![]; for _ in range(0, 10) { let (tx, rx) = channel(); spawn(proc() { diff --git a/src/libgreen/stack.rs b/src/libgreen/stack.rs index b8ab4d5f8c1fe..1f06ba379f0fa 100644 --- a/src/libgreen/stack.rs +++ b/src/libgreen/stack.rs @@ -126,13 +126,13 @@ impl Drop for Stack { pub struct StackPool { // Ideally this would be some datastructure that preserved ordering on // Stack.min_size. - stacks: ~[Stack], + stacks: Vec, } impl StackPool { pub fn new() -> StackPool { StackPool { - stacks: ~[], + stacks: vec![], } } diff --git a/src/libnative/io/file_unix.rs b/src/libnative/io/file_unix.rs index 56460166b48a4..5446ab2950e44 100644 --- a/src/libnative/io/file_unix.rs +++ b/src/libnative/io/file_unix.rs @@ -340,11 +340,11 @@ pub fn mkdir(p: &CString, mode: io::FilePermission) -> IoResult<()> { })) } -pub fn readdir(p: &CString) -> IoResult<~[Path]> { +pub fn readdir(p: &CString) -> IoResult> { use libc::{dirent_t}; use libc::{opendir, readdir_r, closedir}; - fn prune(root: &CString, dirs: ~[Path]) -> ~[Path] { + fn prune(root: &CString, dirs: Vec) -> Vec { let root = unsafe { CString::new(root.with_ref(|p| p), false) }; let root = Path::new(root); @@ -365,7 +365,7 @@ pub fn readdir(p: &CString) -> IoResult<~[Path]> { let dir_ptr = p.with_ref(|buf| unsafe { opendir(buf) }); if dir_ptr as uint != 0 { - let mut paths = ~[]; + let mut paths = vec!(); let mut entry_ptr = 0 as *mut dirent_t; while unsafe { readdir_r(dir_ptr, ptr, &mut entry_ptr) == 0 } { if entry_ptr.is_null() { break } @@ -571,4 +571,3 @@ mod tests { } } } - diff --git a/src/libnative/io/file_win32.rs b/src/libnative/io/file_win32.rs index 3e8ee55df94fc..8090042f090c9 100644 --- a/src/libnative/io/file_win32.rs +++ b/src/libnative/io/file_win32.rs @@ -323,10 +323,10 @@ pub fn mkdir(p: &CString, _mode: io::FilePermission) -> IoResult<()> { }) } -pub fn readdir(p: &CString) -> IoResult<~[Path]> { +pub fn readdir(p: &CString) -> IoResult> { use rt::global_heap::malloc_raw; - fn prune(root: &CString, dirs: ~[Path]) -> ~[Path] { + fn prune(root: &CString, dirs: Vec) -> Vec { let root = unsafe { CString::new(root.with_ref(|p| p), false) }; let root = Path::new(root); @@ -346,7 +346,7 @@ pub fn readdir(p: &CString) -> IoResult<~[Path]> { let wfd_ptr = malloc_raw(rust_list_dir_wfd_size() as uint); let find_handle = libc::FindFirstFileW(path_ptr, wfd_ptr as libc::HANDLE); if find_handle as libc::c_int != libc::INVALID_HANDLE_VALUE { - let mut paths = ~[]; + let mut paths = vec!(); let mut more_files = 1 as libc::c_int; while more_files != 0 { let fp_buf = rust_list_dir_wfd_fp_buf(wfd_ptr as *c_void); diff --git a/src/libnative/io/mod.rs b/src/libnative/io/mod.rs index ffca0dbe3dc60..cc432555abb92 100644 --- a/src/libnative/io/mod.rs +++ b/src/libnative/io/mod.rs @@ -217,7 +217,7 @@ impl rtio::IoFactory for IoFactory { fn fs_rename(&mut self, path: &CString, to: &CString) -> IoResult<()> { file::rename(path, to) } - fn fs_readdir(&mut self, path: &CString, _flags: c_int) -> IoResult<~[Path]> { + fn fs_readdir(&mut self, path: &CString, _flags: c_int) -> IoResult> { file::readdir(path) } fn fs_lstat(&mut self, path: &CString) -> IoResult { diff --git a/src/libnative/io/timer_other.rs b/src/libnative/io/timer_other.rs index 13f1ea6319a46..569b4cbb258e0 100644 --- a/src/libnative/io/timer_other.rs +++ b/src/libnative/io/timer_other.rs @@ -102,11 +102,11 @@ fn helper(input: libc::c_int, messages: Receiver) { // active timers are those which are able to be selected upon (and it's a // sorted list, and dead timers are those which have expired, but ownership // hasn't yet been transferred back to the timer itself. - let mut active: ~[~Inner] = ~[]; - let mut dead = ~[]; + let mut active: Vec<~Inner> = vec![]; + let mut dead = vec![]; // inserts a timer into an array of timers (sorted by firing time) - fn insert(t: ~Inner, active: &mut ~[~Inner]) { + fn insert(t: ~Inner, active: &mut Vec<~Inner>) { match active.iter().position(|tm| tm.target > t.target) { Some(pos) => { active.insert(pos, t); } None => { active.push(t); } @@ -114,7 +114,7 @@ fn helper(input: libc::c_int, messages: Receiver) { } // signals the first requests in the queue, possible re-enqueueing it. - fn signal(active: &mut ~[~Inner], dead: &mut ~[(uint, ~Inner)]) { + fn signal(active: &mut Vec<~Inner>, dead: &mut Vec<(uint, ~Inner)>) { let mut timer = match active.shift() { Some(timer) => timer, None => return }; @@ -137,7 +137,7 @@ fn helper(input: libc::c_int, messages: Receiver) { let now = now(); // If this request has already expired, then signal it and go // through another iteration - if active[0].target <= now { + if active.get(0).target <= now { signal(&mut active, &mut dead); continue; } @@ -145,7 +145,7 @@ fn helper(input: libc::c_int, messages: Receiver) { // The actual timeout listed in the requests array is an // absolute date, so here we translate the absolute time to a // relative time. - let tm = active[0].target - now; + let tm = active.get(0).target - now; timeout.tv_sec = (tm / 1000) as libc::time_t; timeout.tv_usec = ((tm % 1000) * 1000) as libc::suseconds_t; &timeout as *libc::timeval diff --git a/src/libnative/io/timer_timerfd.rs b/src/libnative/io/timer_timerfd.rs index 25dbdc1e1a5cd..d37a39fc30e8d 100644 --- a/src/libnative/io/timer_timerfd.rs +++ b/src/libnative/io/timer_timerfd.rs @@ -76,7 +76,7 @@ fn helper(input: libc::c_int, messages: Receiver) { add(efd, input); let events: [imp::epoll_event, ..16] = unsafe { mem::init() }; - let mut list: ~[(libc::c_int, Sender<()>, bool)] = ~[]; + let mut list: Vec<(libc::c_int, Sender<()>, bool)> = vec![]; 'outer: loop { let n = match unsafe { imp::epoll_wait(efd, events.as_ptr(), @@ -104,9 +104,9 @@ fn helper(input: libc::c_int, messages: Receiver) { // times? let _ = FileDesc::new(fd, false).inner_read(bits).unwrap(); let (remove, i) = { - match list.bsearch(|&(f, _, _)| f.cmp(&fd)) { + match list.as_slice().bsearch(|&(f, _, _)| f.cmp(&fd)) { Some(i) => { - let (_, ref c, oneshot) = list[i]; + let (_, ref c, oneshot) = *list.get(i); (!c.try_send(()) || oneshot, i) } None => fail!("fd not active: {}", fd), @@ -128,9 +128,9 @@ fn helper(input: libc::c_int, messages: Receiver) { // If we haven't previously seen the file descriptor, then // we need to add it to the epoll set. - match list.bsearch(|&(f, _, _)| f.cmp(&fd)) { + match list.as_slice().bsearch(|&(f, _, _)| f.cmp(&fd)) { Some(i) => { - drop(mem::replace(&mut list[i], (fd, chan, one))); + drop(mem::replace(list.get_mut(i), (fd, chan, one))); } None => { match list.iter().position(|&(f, _, _)| f >= fd) { @@ -150,7 +150,7 @@ fn helper(input: libc::c_int, messages: Receiver) { } Data(RemoveTimer(fd, chan)) => { - match list.bsearch(|&(f, _, _)| f.cmp(&fd)) { + match list.as_slice().bsearch(|&(f, _, _)| f.cmp(&fd)) { Some(i) => { drop(list.remove(i)); del(efd, fd); diff --git a/src/libnative/io/timer_win32.rs b/src/libnative/io/timer_win32.rs index 278a5a73a36bd..8b7592783da04 100644 --- a/src/libnative/io/timer_win32.rs +++ b/src/libnative/io/timer_win32.rs @@ -40,8 +40,8 @@ pub enum Req { } fn helper(input: libc::HANDLE, messages: Receiver) { - let mut objs = ~[input]; - let mut chans = ~[]; + let mut objs = vec![input]; + let mut chans = vec![]; 'outer: loop { let idx = unsafe { @@ -78,7 +78,7 @@ fn helper(input: libc::HANDLE, messages: Receiver) { } } else { let remove = { - match &chans[idx as uint - 1] { + match chans.get(idx as uint - 1) { &(ref c, oneshot) => !c.try_send(()) || oneshot } }; diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 50c22f6bf1bba..b57ab8d0f2fc8 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -190,7 +190,7 @@ fn visit_item(e: &Env, i: &ast::Item) { } else { None }) - .collect::<~[&ast::Attribute]>(); + .collect::>(); for m in link_args.iter() { match m.value_str() { Some(linkarg) => e.sess.cstore.add_used_link_args(linkarg.get()), @@ -205,7 +205,7 @@ fn visit_item(e: &Env, i: &ast::Item) { } else { None }) - .collect::<~[&ast::Attribute]>(); + .collect::>(); for m in link_args.iter() { match m.meta_item_list() { Some(items) => { diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 61f2075fcce65..788b2a5e6cd32 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -133,7 +133,7 @@ pub fn render(w: &mut io::Writer, s: &str, print_toc: bool) -> fmt::Result { slice::raw::buf_as_slice((*text).data, (*text).size as uint, |text| { let text = str::from_utf8(text).unwrap(); let mut lines = text.lines().filter(|l| stripped_filtered_line(*l).is_none()); - let text = lines.collect::<~[&str]>().connect("\n"); + let text = lines.collect::>().connect("\n"); let buf = buf { data: text.as_bytes().as_ptr(), @@ -186,7 +186,7 @@ pub fn render(w: &mut io::Writer, s: &str, print_toc: bool) -> fmt::Result { Some(s) => s.to_lower().into_str(), None => s.to_owned() } - }).collect::<~[~str]>().connect("-"); + }).collect::>().connect("-"); let opaque = unsafe {&mut *(opaque as *mut my_opaque)}; @@ -285,7 +285,7 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) { let tests = &mut *(opaque as *mut ::test::Collector); let text = str::from_utf8(text).unwrap(); let mut lines = text.lines().map(|l| stripped_filtered_line(l).unwrap_or(l)); - let text = lines.collect::<~[&str]>().connect("\n"); + let text = lines.collect::>().connect("\n"); tests.add_test(text, should_fail, no_run, ignore); }) } diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 3ed4ece514ad0..9e5c8f05c5008 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1205,8 +1205,8 @@ fn item_trait(w: &mut Writer, it: &clean::Item, it.name.get_ref().as_slice(), t.generics, parents)); - let required = t.methods.iter().filter(|m| m.is_req()).collect::<~[&clean::TraitMethod]>(); - let provided = t.methods.iter().filter(|m| !m.is_req()).collect::<~[&clean::TraitMethod]>(); + let required = t.methods.iter().filter(|m| m.is_req()).collect::>(); + let provided = t.methods.iter().filter(|m| !m.is_req()).collect::>(); if t.methods.len() == 0 { try!(write!(w, "\\{ \\}")); @@ -1502,11 +1502,11 @@ fn render_methods(w: &mut Writer, it: &clean::Item) -> fmt::Result { let mut non_trait = v.iter().filter(|p| { p.ref0().trait_.is_none() }); - let non_trait = non_trait.collect::<~[&(clean::Impl, Option<~str>)]>(); + let non_trait = non_trait.collect::)>>(); let mut traits = v.iter().filter(|p| { p.ref0().trait_.is_some() }); - let traits = traits.collect::<~[&(clean::Impl, Option<~str>)]>(); + let traits = traits.collect::)>>(); if non_trait.len() > 0 { try!(write!(w, "

Methods

")); diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs index be91279844209..be1a17e3e3143 100644 --- a/src/librustdoc/markdown.rs +++ b/src/librustdoc/markdown.rs @@ -161,12 +161,12 @@ pub fn render(input: &str, mut output: Path, matches: &getopts::Matches) -> int } /// Run any tests/code examples in the markdown file `input`. -pub fn test(input: &str, libs: HashSet, mut test_args: ~[~str]) -> int { +pub fn test(input: &str, libs: HashSet, mut test_args: Vec<~str>) -> int { let input_str = load_or_return!(input, 1, 2); let mut collector = Collector::new(input.to_owned(), libs, true, true); find_testable_code(input_str, &mut collector); test_args.unshift(~"rustdoctest"); - testing::test_main(test_args, collector.tests); + testing::test_main(test_args.as_slice(), collector.tests); 0 } diff --git a/src/librustuv/access.rs b/src/librustuv/access.rs index 0d2550d4ebda2..3ea58a71cfe3c 100644 --- a/src/librustuv/access.rs +++ b/src/librustuv/access.rs @@ -31,7 +31,7 @@ pub struct Guard<'a> { } struct Inner { - queue: ~[BlockedTask], + queue: Vec, held: bool, } @@ -39,7 +39,7 @@ impl Access { pub fn new() -> Access { Access { inner: UnsafeArc::new(Inner { - queue: ~[], + queue: vec![], held: false, }) } diff --git a/src/librustuv/file.rs b/src/librustuv/file.rs index acb7a8184dd07..69be32a60211d 100644 --- a/src/librustuv/file.rs +++ b/src/librustuv/file.rs @@ -152,13 +152,13 @@ impl FsRequest { } pub fn readdir(loop_: &Loop, path: &CString, flags: c_int) - -> Result<~[Path], UvError> + -> Result, UvError> { execute(|req, cb| unsafe { uvll::uv_fs_readdir(loop_.handle, req, path.with_ref(|p| p), flags, cb) }).map(|req| unsafe { - let mut paths = ~[]; + let mut paths = vec!(); let path = CString::new(path.with_ref(|p| p), false); let parent = Path::new(path); let _ = c_str::from_c_multistring(req.get_ptr() as *libc::c_char, diff --git a/src/librustuv/uvio.rs b/src/librustuv/uvio.rs index 424849bbf0eab..55456bb548e91 100644 --- a/src/librustuv/uvio.rs +++ b/src/librustuv/uvio.rs @@ -234,7 +234,7 @@ impl IoFactory for UvIoFactory { r.map_err(uv_error_to_io_error) } fn fs_readdir(&mut self, path: &CString, flags: c_int) - -> Result<~[Path], IoError> + -> Result, IoError> { let r = FsRequest::readdir(&self.loop_, path, flags); r.map_err(uv_error_to_io_error) diff --git a/src/libserialize/ebml.rs b/src/libserialize/ebml.rs index a6356e34af30d..d753922f7f426 100644 --- a/src/libserialize/ebml.rs +++ b/src/libserialize/ebml.rs @@ -636,7 +636,7 @@ pub mod writer { // ebml writing pub struct Encoder<'a, W> { pub writer: &'a mut W, - size_positions: ~[uint], + size_positions: Vec, } fn write_sized_vuint(w: &mut W, n: uint, size: uint) -> EncodeResult { @@ -668,10 +668,9 @@ pub mod writer { } pub fn Encoder<'a, W: Writer + Seek>(w: &'a mut W) -> Encoder<'a, W> { - let size_positions: ~[uint] = ~[]; Encoder { writer: w, - size_positions: size_positions, + size_positions: vec!(), } } diff --git a/src/libstd/fmt/parse.rs b/src/libstd/fmt/parse.rs index 4752f3a75f473..36ffb8572378f 100644 --- a/src/libstd/fmt/parse.rs +++ b/src/libstd/fmt/parse.rs @@ -131,13 +131,13 @@ pub enum Method<'a> { /// /// The final element of this enum is the default "other" case which is /// always required to be specified. - Plural(Option, ~[PluralArm<'a>], ~[Piece<'a>]), + Plural(Option, Vec>, Vec>), /// A select method selects over a string. Each arm is a different string /// which can be selected for. /// /// As with `Plural`, a default "other" case is required as well. - Select(~[SelectArm<'a>], ~[Piece<'a>]), + Select(Vec>, Vec>), } /// A selector for what pluralization a plural method should take @@ -156,7 +156,7 @@ pub struct PluralArm<'a> { /// literal. pub selector: PluralSelector, /// Array of pieces which are the format of this arm - pub result: ~[Piece<'a>], + pub result: Vec>, } /// Enum of the 5 CLDR plural keywords. There is one more, "other", but that @@ -184,7 +184,7 @@ pub struct SelectArm<'a> { /// String selector which guards this arm pub selector: &'a str, /// Array of pieces which are the format of this arm - pub result: ~[Piece<'a>], + pub result: Vec>, } /// The parser structure for interpreting the input format string. This is @@ -198,7 +198,7 @@ pub struct Parser<'a> { cur: str::CharOffsets<'a>, depth: uint, /// Error messages accumulated during parsing - pub errors: ~[~str], + pub errors: Vec<~str>, } impl<'a> Iterator> for Parser<'a> { @@ -236,7 +236,7 @@ impl<'a> Parser<'a> { input: s, cur: s.char_indices(), depth: 0, - errors: ~[], + errors: vec!(), } } @@ -463,7 +463,7 @@ impl<'a> Parser<'a> { /// Parses a 'select' statement (after the initial 'select' word) fn select(&mut self) -> ~Method<'a> { let mut other = None; - let mut arms = ~[]; + let mut arms = vec!(); // Consume arms one at a time loop { self.ws(); @@ -496,7 +496,7 @@ impl<'a> Parser<'a> { Some(arm) => { arm } None => { self.err("`select` statement must provide an `other` case"); - ~[] + vec!() } }; ~Select(arms, other) @@ -506,7 +506,7 @@ impl<'a> Parser<'a> { fn plural(&mut self) -> ~Method<'a> { let mut offset = None; let mut other = None; - let mut arms = ~[]; + let mut arms = vec!(); // First, attempt to parse the 'offset:' field. We know the set of // selector words which can appear in plural arms, and the only ones @@ -594,7 +594,7 @@ impl<'a> Parser<'a> { Some(arm) => { arm } None => { self.err("`plural` statement must provide an `other` case"); - ~[] + vec!() } }; ~Plural(offset, arms, other) @@ -684,9 +684,9 @@ mod tests { use super::*; use prelude::*; - fn same(fmt: &'static str, p: ~[Piece<'static>]) { + fn same(fmt: &'static str, p: &[Piece<'static>]) { let mut parser = Parser::new(fmt); - assert!(p == parser.collect()); + assert!(p == parser.collect::>>().as_slice()); } fn fmtdflt() -> FormatSpec<'static> { @@ -708,12 +708,12 @@ mod tests { #[test] fn simple() { - same("asdf", ~[String("asdf")]); - same("a\\{b", ~[String("a"), String("{b")]); - same("a\\#b", ~[String("a"), String("#b")]); - same("a\\}b", ~[String("a"), String("}b")]); - same("a\\}", ~[String("a"), String("}")]); - same("\\}", ~[String("}")]); + same("asdf", [String("asdf")]); + same("a\\{b", [String("a"), String("{b")]); + same("a\\#b", [String("a"), String("#b")]); + same("a\\}b", [String("a"), String("}b")]); + same("a\\}", [String("a"), String("}")]); + same("\\}", [String("}")]); } #[test] fn invalid01() { musterr("{") } @@ -725,7 +725,7 @@ mod tests { #[test] fn format_nothing() { - same("{}", ~[Argument(Argument { + same("{}", [Argument(Argument { position: ArgumentNext, format: fmtdflt(), method: None, @@ -733,7 +733,7 @@ mod tests { } #[test] fn format_position() { - same("{3}", ~[Argument(Argument { + same("{3}", [Argument(Argument { position: ArgumentIs(3), format: fmtdflt(), method: None, @@ -741,7 +741,7 @@ mod tests { } #[test] fn format_position_nothing_else() { - same("{3:}", ~[Argument(Argument { + same("{3:}", [Argument(Argument { position: ArgumentIs(3), format: fmtdflt(), method: None, @@ -749,7 +749,7 @@ mod tests { } #[test] fn format_type() { - same("{3:a}", ~[Argument(Argument { + same("{3:a}", [Argument(Argument { position: ArgumentIs(3), format: FormatSpec { fill: None, @@ -764,7 +764,7 @@ mod tests { } #[test] fn format_align_fill() { - same("{3:>}", ~[Argument(Argument { + same("{3:>}", [Argument(Argument { position: ArgumentIs(3), format: FormatSpec { fill: None, @@ -776,7 +776,7 @@ mod tests { }, method: None, })]); - same("{3:0<}", ~[Argument(Argument { + same("{3:0<}", [Argument(Argument { position: ArgumentIs(3), format: FormatSpec { fill: Some('0'), @@ -788,7 +788,7 @@ mod tests { }, method: None, })]); - same("{3:*(n: u64, size: uint, f: |v: &[u8]| -> T) -> T { 8u => f(unsafe { transmute::(to_le64(n as i64)) }), _ => { - let mut bytes: ~[u8] = ~[]; + let mut bytes = vec!(); let mut i = size; let mut n = n; while i > 0u { @@ -96,7 +96,7 @@ pub fn u64_to_le_bytes(n: u64, size: uint, f: |v: &[u8]| -> T) -> T { n >>= 8_u64; i -= 1u; } - f(bytes) + f(bytes.as_slice()) } } } @@ -127,14 +127,14 @@ pub fn u64_to_be_bytes(n: u64, size: uint, f: |v: &[u8]| -> T) -> T { 4u => f(unsafe { transmute::(to_be32(n as i32)) }), 8u => f(unsafe { transmute::(to_be64(n as i64)) }), _ => { - let mut bytes: ~[u8] = ~[]; + let mut bytes = vec!(); let mut i = size; while i > 0u { let shift = ((i - 1u) * 8u) as u64; bytes.push((n >> shift) as u8); i -= 1u; } - f(bytes) + f(bytes.as_slice()) } } } diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs index 2fea002d4197f..b8a58c5cf1040 100644 --- a/src/libstd/io/fs.rs +++ b/src/libstd/io/fs.rs @@ -483,7 +483,7 @@ pub fn rmdir(path: &Path) -> IoResult<()> { /// Will return an error if the provided `from` doesn't exist, the process lacks /// permissions to view the contents or if the `path` points at a non-directory /// file -pub fn readdir(path: &Path) -> IoResult<~[Path]> { +pub fn readdir(path: &Path) -> IoResult> { LocalIo::maybe_raise(|io| { io.fs_readdir(&path.to_c_str(), 0) }) @@ -498,7 +498,7 @@ pub fn walk_dir(path: &Path) -> IoResult { /// An iterator which walks over a directory pub struct Directories { - stack: ~[Path], + stack: Vec, } impl Iterator for Directories { diff --git a/src/libstd/io/signal.rs b/src/libstd/io/signal.rs index 6762e7c6a76ef..00b2e4f2307d8 100644 --- a/src/libstd/io/signal.rs +++ b/src/libstd/io/signal.rs @@ -29,6 +29,7 @@ use option::{Some, None}; use result::{Ok, Err}; use rt::rtio::{IoFactory, LocalIo, RtioSignal}; use slice::{ImmutableVector, OwnedVector}; +use vec::Vec; /// Signals that can be sent and received #[repr(int)] @@ -80,7 +81,7 @@ pub enum Signum { /// ``` pub struct Listener { /// A map from signums to handles to keep the handles in memory - handles: ~[(Signum, ~RtioSignal:Send)], + handles: Vec<(Signum, ~RtioSignal:Send)>, /// This is where all the handles send signums, which are received by /// the clients from the receiver. tx: Sender, @@ -99,7 +100,7 @@ impl Listener { Listener { tx: tx, rx: rx, - handles: ~[], + handles: vec!(), } } diff --git a/src/libstd/local_data.rs b/src/libstd/local_data.rs index c555fb58db89a..c76e079432ae1 100644 --- a/src/libstd/local_data.rs +++ b/src/libstd/local_data.rs @@ -47,6 +47,7 @@ use mem::replace; use option::{None, Option, Some}; use rt::task::{Task, LocalStorage}; use slice::{ImmutableVector, MutableVector, OwnedVector}; +use vec::Vec; /** * Indexes a task-local data slot. This pointer is used for comparison to @@ -89,7 +90,7 @@ impl LocalData for T {} // n.b. If TLS is used heavily in future, this could be made more efficient with // a proper map. #[doc(hidden)] -pub type Map = ~[Option<(*u8, TLSValue, LoanState)>]; +pub type Map = Vec>; type TLSValue = ~LocalData:Send; // Gets the map from the runtime. Lazily initialises if not done so already. @@ -106,7 +107,7 @@ unsafe fn get_local_map() -> &mut Map { // If this is the first time we've accessed TLS, perform similar // actions to the oldsched way of doing things. &LocalStorage(ref mut slot) => { - *slot = Some(~[]); + *slot = Some(vec!()); match *slot { Some(ref mut map_ptr) => { return map_ptr } None => abort() @@ -237,7 +238,7 @@ fn get_with { let ret; let mut return_loan = false; - match map[i] { + match *map.get_mut(i) { Some((_, ref data, ref mut loan)) => { match (state, *loan) { (_, NoLoan) => { @@ -271,7 +272,7 @@ fn get_with { *loan = NoLoan; } None => abort() } @@ -331,7 +332,7 @@ pub fn set(key: Key, data: T) { // we're not actually sending it to other schedulers or anything. let data: ~LocalData:Send = unsafe { cast::transmute(data) }; match insertion_position(map, keyval) { - Some(i) => { map[i] = Some((keyval, data, NoLoan)); } + Some(i) => { *map.get_mut(i) = Some((keyval, data, NoLoan)); } None => { map.push(Some((keyval, data, NoLoan))); } } } diff --git a/src/libstd/repr.rs b/src/libstd/repr.rs index e12e0234d9650..7205edee611c1 100644 --- a/src/libstd/repr.rs +++ b/src/libstd/repr.rs @@ -31,6 +31,7 @@ use to_str::ToStr; use slice::{Vector, OwnedVector}; use intrinsics::{Disr, Opaque, TyDesc, TyVisitor, get_tydesc, visit_tydesc}; use raw; +use vec::Vec; macro_rules! try( ($me:expr, $e:expr) => ( match $e { @@ -102,8 +103,8 @@ enum VariantState { pub struct ReprVisitor<'a> { ptr: *u8, - ptr_stk: ~[*u8], - var_stk: ~[VariantState], + ptr_stk: Vec<*u8>, + var_stk: Vec, writer: &'a mut io::Writer, last_err: Option, } @@ -112,8 +113,8 @@ pub fn ReprVisitor<'a>(ptr: *u8, writer: &'a mut io::Writer) -> ReprVisitor<'a> { ReprVisitor { ptr: ptr, - ptr_stk: ~[], - var_stk: ~[], + ptr_stk: vec!(), + var_stk: vec!(), writer: writer, last_err: None, } @@ -154,8 +155,8 @@ impl<'a> ReprVisitor<'a> { // issues we have to recreate it here. let u = ReprVisitor { ptr: ptr, - ptr_stk: ~[], - var_stk: ~[], + ptr_stk: vec!(), + var_stk: vec!(), writer: ::cast::transmute_copy(&self.writer), last_err: None, }; @@ -505,7 +506,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> { _offset: uint, inner: *TyDesc) -> bool { - match self.var_stk[self.var_stk.len() - 1] { + match *self.var_stk.get(self.var_stk.len() - 1) { Matched => { if i != 0 { try!(self, self.writer.write(", ".as_bytes())); @@ -523,7 +524,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> { _disr_val: Disr, n_fields: uint, _name: &str) -> bool { - match self.var_stk[self.var_stk.len() - 1] { + match *self.var_stk.get(self.var_stk.len() - 1) { Matched => { if n_fields > 0 { try!(self, self.writer.write([')' as u8])); diff --git a/src/libstd/rt/at_exit_imp.rs b/src/libstd/rt/at_exit_imp.rs index 4be9c8a84acd3..67b8b40b47e6e 100644 --- a/src/libstd/rt/at_exit_imp.rs +++ b/src/libstd/rt/at_exit_imp.rs @@ -20,8 +20,9 @@ use option::{Some, None}; use ptr::RawPtr; use unstable::sync::Exclusive; use slice::OwnedVector; +use vec::Vec; -type Queue = Exclusive<~[proc():Send]>; +type Queue = Exclusive>; // You'll note that these variables are *not* atomic, and this is done on // purpose. This module is designed to have init() called *once* in a @@ -35,7 +36,7 @@ pub fn init() { unsafe { rtassert!(!RUNNING); rtassert!(QUEUE.is_null()); - let state: ~Queue = ~Exclusive::new(~[]); + let state: ~Queue = ~Exclusive::new(vec!()); QUEUE = cast::transmute(state); } } @@ -61,7 +62,7 @@ pub fn run() { QUEUE = 0 as *mut Queue; let mut vec = None; state.with(|arr| { - vec = Some(mem::replace(arr, ~[])); + vec = Some(mem::replace(arr, vec!())); }); vec.take_unwrap() }; diff --git a/src/libstd/rt/rtio.rs b/src/libstd/rt/rtio.rs index 1750e685627d8..cc8356d2b9a04 100644 --- a/src/libstd/rt/rtio.rs +++ b/src/libstd/rt/rtio.rs @@ -20,6 +20,7 @@ use path::Path; use result::Err; use rt::local::Local; use rt::task::Task; +use vec::Vec; use ai = io::net::addrinfo; use io; @@ -168,7 +169,7 @@ pub trait IoFactory { fn fs_rmdir(&mut self, path: &CString) -> IoResult<()>; fn fs_rename(&mut self, path: &CString, to: &CString) -> IoResult<()>; fn fs_readdir(&mut self, path: &CString, flags: c_int) -> - IoResult<~[Path]>; + IoResult>; fn fs_lstat(&mut self, path: &CString) -> IoResult; fn fs_chown(&mut self, path: &CString, uid: int, gid: int) -> IoResult<()>; diff --git a/src/libstd/sync/deque.rs b/src/libstd/sync/deque.rs index d01c89878ded9..8beadce21604e 100644 --- a/src/libstd/sync/deque.rs +++ b/src/libstd/sync/deque.rs @@ -62,6 +62,7 @@ use sync::arc::UnsafeArc; use sync::atomics::{AtomicInt, AtomicPtr, SeqCst}; use unstable::sync::Exclusive; use slice::{OwnedVector, ImmutableVector}; +use vec::Vec; // Once the queue is less than 1/K full, then it will be downsized. Note that // the deque requires that this number be less than 2. @@ -116,14 +117,14 @@ pub enum Stolen { /// will only use this structure when allocating a new buffer or deallocating a /// previous one. pub struct BufferPool { - pool: Exclusive<~[~Buffer]>, + pool: Exclusive>>, } /// An internal buffer used by the chase-lev deque. This structure is actually /// implemented as a circular buffer, and is used as the intermediate storage of /// the data in the deque. /// -/// This type is implemented with *T instead of ~[T] for two reasons: +/// This type is implemented with *T instead of Vec for two reasons: /// /// 1. There is nothing safe about using this buffer. This easily allows the /// same value to be read twice in to rust, and there is nothing to @@ -132,7 +133,7 @@ pub struct BufferPool { /// destructors for values in this buffer (on drop) because the bounds /// are defined by the deque it's owned by. /// -/// 2. We can certainly avoid bounds checks using *T instead of ~[T], although +/// 2. We can certainly avoid bounds checks using *T instead of Vec, although /// LLVM is probably pretty good at doing this already. struct Buffer { storage: *T, @@ -143,7 +144,7 @@ impl BufferPool { /// Allocates a new buffer pool which in turn can be used to allocate new /// deques. pub fn new() -> BufferPool { - BufferPool { pool: Exclusive::new(~[]) } + BufferPool { pool: Exclusive::new(vec!()) } } /// Allocates a new work-stealing deque which will send/receiving memory to @@ -494,7 +495,7 @@ mod tests { } } }) - }).collect::<~[Thread<()>]>(); + }).collect::>>(); while remaining.load(SeqCst) > 0 { match w.pop() { @@ -525,7 +526,7 @@ mod tests { Thread::start(proc() { stampede(w, s, 4, 10000); }) - }).collect::<~[Thread<()>]>(); + }).collect::>>(); for thread in threads.move_iter() { thread.join(); @@ -556,7 +557,7 @@ mod tests { } } }) - }).collect::<~[Thread<()>]>(); + }).collect::>>(); let mut rng = rand::task_rng(); let mut expected = 0; @@ -658,4 +659,3 @@ mod tests { } } } - diff --git a/src/libstd/sync/mpmc_bounded_queue.rs b/src/libstd/sync/mpmc_bounded_queue.rs index 12c05c0d61cea..b392cc8ff9a70 100644 --- a/src/libstd/sync/mpmc_bounded_queue.rs +++ b/src/libstd/sync/mpmc_bounded_queue.rs @@ -35,7 +35,7 @@ use num::next_power_of_two; use option::{Option, Some, None}; use sync::arc::UnsafeArc; use sync::atomics::{AtomicUint,Relaxed,Release,Acquire}; -use slice; +use vec::Vec; struct Node { sequence: AtomicUint, @@ -44,7 +44,7 @@ struct Node { struct State { pad0: [u8, ..64], - buffer: ~[Node], + buffer: Vec>, mask: uint, pad1: [u8, ..64], enqueue_pos: AtomicUint, @@ -69,7 +69,7 @@ impl State { } else { capacity }; - let buffer = slice::from_fn(capacity, |i| { + let buffer = Vec::from_fn(capacity, |i| { Node { sequence:AtomicUint::new(i), value: None } }); State{ @@ -88,7 +88,7 @@ impl State { let mask = self.mask; let mut pos = self.enqueue_pos.load(Relaxed); loop { - let node = &mut self.buffer[pos & mask]; + let node = self.buffer.get_mut(pos & mask); let seq = node.sequence.load(Acquire); let diff: int = seq as int - pos as int; @@ -114,7 +114,7 @@ impl State { let mask = self.mask; let mut pos = self.dequeue_pos.load(Relaxed); loop { - let node = &mut self.buffer[pos & mask]; + let node = self.buffer.get_mut(pos & mask); let seq = node.sequence.load(Acquire); let diff: int = seq as int - (pos + 1) as int; if diff == 0 { @@ -186,7 +186,7 @@ mod tests { }); } - let mut completion_rxs = ~[]; + let mut completion_rxs = vec![]; for _ in range(0, nthreads) { let (tx, rx) = channel(); completion_rxs.push(rx); diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index 0f11dc51a995c..cc0f26dcc2f07 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -242,9 +242,9 @@ impl<'a, 'b> Context<'a, 'b> { } } } - self.verify_pieces(arm.result); + self.verify_pieces(arm.result.as_slice()); } - self.verify_pieces(*default); + self.verify_pieces(default.as_slice()); } parse::Select(ref arms, ref default) => { self.verify_arg_type(pos, String); @@ -258,9 +258,9 @@ impl<'a, 'b> Context<'a, 'b> { self.ecx.span_err(self.fmtsp, "empty selector in `select`"); } - self.verify_pieces(arm.result); + self.verify_pieces(arm.result.as_slice()); } - self.verify_pieces(*default); + self.verify_pieces(default.as_slice()); } } self.nest_level -= 1; diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs index d04aa4082c45c..f6c138b8c669d 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -170,14 +170,14 @@ impl<'a> Stats for &'a [f64] { // FIXME #11059 handle NaN, inf and overflow #[allow(deprecated_owned_vector)] fn sum(self) -> f64 { - let mut partials : ~[f64] = ~[]; + let mut partials = vec![]; for &mut x in self.iter() { let mut j = 0; // This inner loop applies `hi`/`lo` summation to each // partial so that the list of partial sums remains exact. for i in range(0, partials.len()) { - let mut y = partials[i]; + let mut y = *partials.get(i); if num::abs(x) < num::abs(y) { mem::swap(&mut x, &mut y); } @@ -186,7 +186,7 @@ impl<'a> Stats for &'a [f64] { let hi = x + y; let lo = y - (hi - x); if lo != 0f64 { - partials[j] = lo; + *partials.get_mut(j) = lo; j += 1; } x = hi; @@ -194,7 +194,7 @@ impl<'a> Stats for &'a [f64] { if j >= partials.len() { partials.push(x); } else { - partials[j] = x; + *partials.get_mut(j) = x; partials.truncate(j+1); } } diff --git a/src/libworkcache/lib.rs b/src/libworkcache/lib.rs index 748ca378e4d53..623488ac6129d 100644 --- a/src/libworkcache/lib.rs +++ b/src/libworkcache/lib.rs @@ -17,6 +17,7 @@ html_root_url = "http://static.rust-lang.org/doc/master")] #![feature(phase)] #![allow(visible_private_types)] +#![deny(deprecated_owned_vector)] #[phase(syntax, link)] extern crate log; extern crate serialize; @@ -319,8 +320,8 @@ impl Exec { } // returns pairs of (kind, name) - pub fn lookup_discovered_inputs(&self) -> ~[(~str, ~str)] { - let mut rs = ~[]; + pub fn lookup_discovered_inputs(&self) -> Vec<(~str, ~str)> { + let mut rs = vec![]; let WorkMap(ref discovered_inputs) = self.discovered_inputs; for (k, v) in discovered_inputs.iter() { let KindMap(ref vmap) = *v; @@ -341,8 +342,8 @@ impl<'a> Prep<'a> { } } - pub fn lookup_declared_inputs(&self) -> ~[~str] { - let mut rs = ~[]; + pub fn lookup_declared_inputs(&self) -> Vec<~str> { + let mut rs = vec![]; let WorkMap(ref declared_inputs) = self.declared_inputs; for (_, v) in declared_inputs.iter() { let KindMap(ref vmap) = *v; diff --git a/src/test/bench/shootout-binarytrees.rs b/src/test/bench/shootout-binarytrees.rs index 62b01779ac25a..49184e188ebb6 100644 --- a/src/test/bench/shootout-binarytrees.rs +++ b/src/test/bench/shootout-binarytrees.rs @@ -76,7 +76,7 @@ fn main() { format!("{}\t trees of depth {}\t check: {}", iterations * 2, depth, chk) }) - }).collect::<~[Future<~str>]>(); + }).collect::>>(); for message in messages.mut_iter() { println!("{}", *message.get_ref());