Update the rest of the compiler with ~[T] changes

This commit is contained in:
Alex Crichton 2014-04-17 15:59:07 -07:00
parent 7d3b0bf391
commit 675b82657e
35 changed files with 140 additions and 166 deletions

View file

@ -16,7 +16,6 @@ use collections::{TrieMap, TreeMap, HashMap, HashSet};
use std::os;
use rand::{Rng, IsaacRng, SeedableRng};
use std::uint;
use std::slice;
fn timed(label: &str, f: ||) {
let start = time::precise_time_s();
@ -99,7 +98,7 @@ fn main() {
}
};
let mut rand = slice::with_capacity(n_keys);
let mut rand = Vec::with_capacity(n_keys);
{
let mut rng: IsaacRng = SeedableRng::from_seed(&[1, 1, 1, 1, 1, 1, 1]);
@ -130,7 +129,7 @@ fn main() {
{
println!(" Random integers:");
let mut map: TreeMap<uint,uint> = TreeMap::new();
vector(&mut map, n_keys, rand);
vector(&mut map, n_keys, rand.as_slice());
}
// FIXME: #9970
@ -149,7 +148,7 @@ fn main() {
{
println!(" Random integers:");
let mut map: HashMap<uint,uint> = HashMap::new();
vector(&mut map, n_keys, rand);
vector(&mut map, n_keys, rand.as_slice());
}
// FIXME: #9970
@ -168,6 +167,6 @@ fn main() {
{
println!(" Random integers:");
let mut map: TrieMap<uint> = TrieMap::new();
vector(&mut map, n_keys, rand);
vector(&mut map, n_keys, rand.as_slice());
}
}

View file

@ -9,7 +9,6 @@
// except according to those terms.
use std::os;
use std::slice;
fn max(a: i32, b: i32) -> i32 {
if a > b {
@ -20,13 +19,17 @@ fn max(a: i32, b: i32) -> i32 {
}
fn fannkuch_redux(n: i32) -> i32 {
let mut perm = slice::from_elem(n as uint, 0i32);
let mut perm1 = slice::from_fn(n as uint, |i| i as i32);
let mut count = slice::from_elem(n as uint, 0i32);
let mut perm = Vec::from_elem(n as uint, 0i32);
let mut perm1 = Vec::from_fn(n as uint, |i| i as i32);
let mut count = Vec::from_elem(n as uint, 0i32);
let mut max_flips_count = 0i32;
let mut perm_count = 0i32;
let mut checksum = 0i32;
let perm = perm.as_mut_slice();
let perm1 = perm1.as_mut_slice();
let count = count.as_mut_slice();
let mut r = n;
loop {
while r != 1 {

View file

@ -12,7 +12,6 @@ use std::cmp::min;
use std::io::{stdout, IoResult};
use std::os;
use std::slice::bytes::copy_memory;
use std::slice;
static LINE_LEN: uint = 60;
static LOOKUP_SIZE: uint = 4 * 1024;
@ -90,10 +89,10 @@ impl<'a, W: Writer> RepeatFasta<'a, W> {
fn make(&mut self, n: uint) -> IoResult<()> {
let alu_len = self.alu.len();
let mut buf = slice::from_elem(alu_len + LINE_LEN, 0u8);
let mut buf = Vec::from_elem(alu_len + LINE_LEN, 0u8);
let alu: &[u8] = self.alu.as_bytes();
copy_memory(buf, alu);
copy_memory(buf.as_mut_slice(), alu);
let buf_len = buf.len();
copy_memory(buf.mut_slice(alu_len, buf_len),
alu.slice_to(LINE_LEN));

View file

@ -14,7 +14,6 @@ use std::from_str::FromStr;
use std::iter::count;
use std::cmp::min;
use std::os;
use std::slice::from_elem;
use sync::{Arc, RWLock};
fn A(i: uint, j: uint) -> f64 {

View file

@ -13,5 +13,4 @@
fn main() {
~[1]; //~ ERROR use of deprecated `~[]`
//~^ ERROR use of deprecated `~[]`
std::slice::with_capacity::<int>(10); //~ ERROR use of deprecated `~[]`
}

View file

@ -29,7 +29,12 @@ use test::B;
// Make sure this import is warned about when at least one of its imported names
// is unused
use std::slice::{from_fn, from_elem}; //~ ERROR unused import
use test2::{foo, bar}; //~ ERROR unused import
mod test2 {
pub fn foo() {}
pub fn bar() {}
}
mod test {
pub trait A { fn a(&self) {} }
@ -66,5 +71,5 @@ fn main() {
let mut b = 4;
swap(&mut a, &mut b);
test::C.b();
let _a = from_elem(0, 0);
let _a = foo();
}

View file

@ -36,7 +36,7 @@ fn double() {
}
fn runtest(me: &str) {
let mut env = os::env();
let mut env = os::env().move_iter().collect::<Vec<(~str, ~str)>>();
match env.iter().position(|&(ref s, _)| "RUST_BACKTRACE" == *s) {
Some(i) => { env.remove(i); }
None => {}