]> git.lizzy.rs Git - rust.git/commitdiff
test: Clean out the test suite a bit
authorAlex Crichton <alex@alexcrichton.com>
Fri, 21 Feb 2014 23:41:51 +0000 (15:41 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 25 Feb 2014 17:21:09 +0000 (09:21 -0800)
This updates a number of ignore-test tests, and removes a few completely
outdated tests due to the feature being tested no longer being supported.

This brings a number of bench/shootout tests up to date so they're compiling
again. I make no claims to the performance of these benchmarks, it's just nice
to not have bitrotted code.

Closes #2604
Closes #9407

58 files changed:
src/libgreen/sched.rs
src/test/auxiliary/private_variant_1.rs
src/test/bench/shootout-fannkuch-redux.rs
src/test/bench/shootout-fasta-redux.rs
src/test/bench/shootout-k-nucleotide.rs
src/test/bench/task-perf-linked-failure.rs [deleted file]
src/test/compile-fail/dead-code-ret.rs
src/test/compile-fail/empty-linkname.rs
src/test/compile-fail/empty-linkname2.rs [deleted file]
src/test/compile-fail/issue-2063.rs
src/test/compile-fail/issue-2969.rs [deleted file]
src/test/compile-fail/issue-3177-mutable-struct.rs [deleted file]
src/test/compile-fail/issue-3973.rs
src/test/compile-fail/issue-4542.rs [deleted file]
src/test/compile-fail/issue-5035.rs
src/test/compile-fail/issue-6801.rs
src/test/compile-fail/kindck-owned-trait-scoped.rs [deleted file]
src/test/compile-fail/liveness-unused.rs
src/test/compile-fail/pptypedef.rs
src/test/compile-fail/private-variant-xc.rs
src/test/compile-fail/private_variant_2.rs
src/test/compile-fail/recursion.rs [new file with mode: 0644]
src/test/compile-fail/redundant-link-args.rs [deleted file]
src/test/compile-fail/regions-fn-bound.rs
src/test/compile-fail/syntax-extension-minor.rs [new file with mode: 0644]
src/test/compile-fail/trait-inheritance-missing-requirement.rs [deleted file]
src/test/run-fail/issue-2061.rs
src/test/run-fail/linked-failure.rs [deleted file]
src/test/run-fail/linked-failure2.rs [deleted file]
src/test/run-fail/linked-failure3.rs [deleted file]
src/test/run-fail/linked-failure4.rs [deleted file]
src/test/run-fail/spawnfail.rs [deleted file]
src/test/run-fail/task-comm-recv-block.rs [deleted file]
src/test/run-pass/auto-encode.rs
src/test/run-pass/deriving-encodable-decodable.rs
src/test/run-pass/duplicate-use.rs [deleted file]
src/test/run-pass/for-destruct.rs
src/test/run-pass/foreign-lib-path.rs [deleted file]
src/test/run-pass/foreign-mod.rc [deleted file]
src/test/run-pass/foreign.rc [deleted file]
src/test/run-pass/issue-1451.rs [new file with mode: 0644]
src/test/run-pass/issue-2074.rs [new file with mode: 0644]
src/test/run-pass/issue-2190-1.rs
src/test/run-pass/issue-2190-2.rs
src/test/run-pass/issue-2190.rs [deleted file]
src/test/run-pass/issue-3168.rs [deleted file]
src/test/run-pass/issue-3290.rs
src/test/run-pass/issue-3796.rs [deleted file]
src/test/run-pass/issue-3904.rs
src/test/run-pass/issue-4241.rs [deleted file]
src/test/run-pass/issue-4542.rs
src/test/run-pass/lots-a-fail.rs [deleted file]
src/test/run-pass/nullable-pointer-iotareduction.rs
src/test/run-pass/recursion.rs [deleted file]
src/test/run-pass/send-iloop.rs [deleted file]
src/test/run-pass/syntax-extension-minor.rs [deleted file]
src/test/run-pass/task-killjoin-rsrc.rs [deleted file]
src/test/run-pass/task-killjoin.rs [deleted file]

index c6db989d036d76e75504b478d13b297a667f4962..a128ee4a25027a8cf6881aebf81d781aefeadbba 100644 (file)
@@ -1394,8 +1394,6 @@ fn drop(&mut self) {
         });
     }
 
-    // FIXME: #9407: ignore-test
-    #[ignore]
     #[test]
     fn dont_starve_1() {
         let mut pool = SchedPool::new(PoolConfig {
index 606a662315a0d95f97f2ac17b9cc55575165cb5d..f711af43699b3bbc1b955de2d76e1f318f253648 100644 (file)
@@ -10,6 +10,6 @@
 
 mod super_sekrit {
     pub enum sooper_sekrit {
-        pub quux, priv baz
+        quux, priv baz
     }
 }
index 9a47dc2696be8e1fc73dfd104285ebb9a0c71e3b..2f6370308024355434f74bc1d4b576155fb9a3cb 100644 (file)
@@ -8,11 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test reading from os::args()[1] - bogus!
-
-use std::from_str::FromStr;
 use std::os;
-use std::vec::MutableVector;
 use std::vec;
 
 fn max(a: i32, b: i32) -> i32 {
@@ -23,7 +19,6 @@ fn max(a: i32, b: i32) -> i32 {
     }
 }
 
-#[inline(never)]
 fn fannkuch_redux(n: i32) -> i32 {
     let mut perm = vec::from_elem(n as uint, 0i32);
     let mut perm1 = vec::from_fn(n as uint, |i| i as i32);
@@ -34,74 +29,70 @@ fn fannkuch_redux(n: i32) -> i32 {
 
     let mut r = n;
     loop {
-        unsafe {
-            while r != 1 {
-                count.unsafe_set((r-1) as uint, r);
-                r -= 1;
-            }
-
-            for (perm_i, perm1_i) in perm.mut_iter().zip(perm1.iter()) {
-                *perm_i = *perm1_i;
-            }
+        while r != 1 {
+            count[r - 1] = r;
+            r -= 1;
+        }
 
-            let mut flips_count: i32 = 0;
-            let mut k: i32;
-            loop {
-                k = *perm.unsafe_ref(0);
-                if k == 0 {
-                    break;
-                }
+        for (perm_i, perm1_i) in perm.mut_iter().zip(perm1.iter()) {
+            *perm_i = *perm1_i;
+        }
 
-                let k2 = (k+1) >> 1;
-                for i in range(0i32, k2) {
-                    let (perm_i, perm_k_i) = {
-                        (*perm.unsafe_ref(i as uint),
-                            *perm.unsafe_ref((k-i) as uint))
-                    };
-                    perm.unsafe_set(i as uint, perm_k_i);
-                    perm.unsafe_set((k-i) as uint, perm_i);
-                }
-                flips_count += 1;
+        let mut flips_count: i32 = 0;
+        let mut k: i32;
+        loop {
+            k = perm[0];
+            if k == 0 {
+                break;
             }
 
-            max_flips_count = max(max_flips_count, flips_count);
-            checksum += if perm_count % 2 == 0 {
-                flips_count
-            } else {
-                -flips_count
-            };
+            let k2 = (k+1) >> 1;
+            for i in range(0i32, k2) {
+                perm.swap(i as uint, (k - i) as uint);
+            }
+            flips_count += 1;
+        }
 
-            // Use incremental change to generate another permutation.
-            loop {
-                if r == n {
-                    println!("{}", checksum);
-                    return max_flips_count;
-                }
+        max_flips_count = max(max_flips_count, flips_count);
+        checksum += if perm_count % 2 == 0 {
+            flips_count
+        } else {
+            -flips_count
+        };
 
-                let perm0 = perm1[0];
-                let mut i: i32 = 0;
-                while i < r {
-                    let j = i + 1;
-                    let perm1_j = { *perm1.unsafe_ref(j as uint) };
-                    perm1.unsafe_set(i as uint, perm1_j);
-                    i = j;
-                }
-                perm1.unsafe_set(r as uint, perm0);
+        // Use incremental change to generate another permutation.
+        loop {
+            if r == n {
+                println!("{}", checksum);
+                return max_flips_count;
+            }
 
-                let count_r = { *count.unsafe_ref(r as uint) };
-                count.unsafe_set(r as uint, count_r - 1);
-                if *count.unsafe_ref(r as uint) > 0 {
-                    break;
-                }
-                r += 1;
+            let perm0 = perm1[0];
+            let mut i: i32 = 0;
+            while i < r {
+                let j = i + 1;
+                perm1[i] = perm1[j];
+                i = j;
             }
+            perm1[r] = perm0;
 
-            perm_count += 1;
+            count[r] -= 1;
+            if count[r] > 0 {
+                break;
+            }
+            r += 1;
         }
+
+        perm_count += 1;
     }
 }
 
 fn main() {
-    let n: i32 = FromStr::from_str(os::args()[1]).unwrap();
+    let args = os::args();
+    let n = if args.len() > 1 {
+        from_str::<i32>(args[1]).unwrap()
+    } else {
+        2
+    };
     println!("Pfannkuchen({}) = {}", n as int, fannkuch_redux(n) as int);
 }
index 282ea57ccf3a7a6dfaf18def475f51b5af6d0176..f38acf0457d3cab7a1b87a70971deaf95dda155e 100644 (file)
@@ -8,13 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test reading from os::args()[1] - bogus!
-
-use std::cast::transmute;
-use std::from_str::FromStr;
-use std::libc::{FILE, STDOUT_FILENO, c_int, fdopen, fputc, fputs, fwrite, size_t};
+use std::cmp::min;
+use std::io::{stdout, BufferedWriter, IoResult};
 use std::os;
-use std::uint::min;
 use std::vec::bytes::copy_memory;
 use std::vec;
 
 
 static NULL_AMINO_ACID: AminoAcid = AminoAcid { c: ' ' as u8, p: 0.0 };
 
-static MESSAGE_1: &'static str = ">ONE Homo sapiens alu\n";
-static MESSAGE_2: &'static str = ">TWO IUB ambiguity codes\n";
-static MESSAGE_3: &'static str = ">THREE Homo sapiens frequency\n";
-
 static IUB: [AminoAcid, ..15] = [
     AminoAcid { c: 'a' as u8, p: 0.27 },
     AminoAcid { c: 'c' as u8, p: 0.12 },
@@ -85,73 +77,68 @@ struct AminoAcid {
     p: f32,
 }
 
-struct RepeatFasta {
+struct RepeatFasta<'a, W> {
     alu: &'static str,
-    stdout: *FILE,
+    out: &'a mut W
 }
 
-impl RepeatFasta {
-    fn new(stdout: *FILE, alu: &'static str) -> RepeatFasta {
-        RepeatFasta {
-            alu: alu,
-            stdout: stdout,
-        }
+impl<'a, W: Writer> RepeatFasta<'a, W> {
+    fn new(alu: &'static str, w: &'a mut W) -> RepeatFasta<'a, W> {
+        RepeatFasta { alu: alu, out: w }
     }
 
-    fn make(&mut self, n: uint) {
-        unsafe {
-            let stdout = self.stdout;
-            let alu_len = self.alu.len();
-            let mut buf = vec::from_elem(alu_len + LINE_LEN, 0u8);
-            let alu: &[u8] = self.alu.as_bytes();
-
-            copy_memory(buf, alu);
-            let buf_len = buf.len();
-            copy_memory(buf.mut_slice(alu_len, buf_len),
-                        alu.slice_to(LINE_LEN));
-
-            let mut pos = 0;
-            let mut bytes;
-            let mut n = n;
-            while n > 0 {
-                bytes = min(LINE_LEN, n);
-                fwrite(transmute(&buf[pos]), bytes as size_t, 1, stdout);
-                fputc('\n' as c_int, stdout);
-                pos += bytes;
-                if pos > alu_len {
-                    pos -= alu_len;
-                }
-                n -= bytes;
+    fn make(&mut self, n: uint) -> IoResult<()> {
+        let alu_len = self.alu.len();
+        let mut buf = vec::from_elem(alu_len + LINE_LEN, 0u8);
+        let alu: &[u8] = self.alu.as_bytes();
+
+        copy_memory(buf, alu);
+        let buf_len = buf.len();
+        copy_memory(buf.mut_slice(alu_len, buf_len),
+                    alu.slice_to(LINE_LEN));
+
+        let mut pos = 0;
+        let mut bytes;
+        let mut n = n;
+        while n > 0 {
+            bytes = min(LINE_LEN, n);
+            try!(self.out.write(buf.slice(pos, pos + bytes)));
+            try!(self.out.write_u8('\n' as u8));
+            pos += bytes;
+            if pos > alu_len {
+                pos -= alu_len;
             }
+            n -= bytes;
         }
+        Ok(())
     }
 }
 
-struct RandomFasta {
+fn make_lookup(a: &[AminoAcid]) -> [AminoAcid, ..LOOKUP_SIZE] {
+    let mut lookup = [ NULL_AMINO_ACID, ..LOOKUP_SIZE ];
+    let mut j = 0;
+    for (i, slot) in lookup.mut_iter().enumerate() {
+        while a[j].p < (i as f32) {
+            j += 1;
+        }
+        *slot = a[j];
+    }
+    lookup
+}
+
+struct RandomFasta<'a, W> {
     seed: u32,
-    stdout: *FILE,
     lookup: [AminoAcid, ..LOOKUP_SIZE],
+    out: &'a mut W,
 }
 
-impl RandomFasta {
-    fn new(stdout: *FILE, a: &[AminoAcid]) -> RandomFasta {
+impl<'a, W: Writer> RandomFasta<'a, W> {
+    fn new(w: &'a mut W, a: &[AminoAcid]) -> RandomFasta<'a, W> {
         RandomFasta {
             seed: 42,
-            stdout: stdout,
-            lookup: RandomFasta::make_lookup(a),
-        }
-    }
-
-    fn make_lookup(a: &[AminoAcid]) -> [AminoAcid, ..LOOKUP_SIZE] {
-        let mut lookup = [ NULL_AMINO_ACID, ..LOOKUP_SIZE ];
-        let mut j = 0;
-        for (i, slot) in lookup.mut_iter().enumerate() {
-            while a[j].p < (i as f32) {
-                j += 1;
-            }
-            *slot = a[j];
+            out: w,
+            lookup: make_lookup(a),
         }
-        lookup
     }
 
     fn rng(&mut self, max: f32) -> f32 {
@@ -169,51 +156,50 @@ fn nextc(&mut self) -> u8 {
         0
     }
 
-    fn make(&mut self, n: uint) {
-        unsafe {
-            let lines = n / LINE_LEN;
-            let chars_left = n % LINE_LEN;
-            let mut buf = [0, ..LINE_LEN + 1];
-
-            for _ in range(0, lines) {
-                for i in range(0u, LINE_LEN) {
-                    buf[i] = self.nextc();
-                }
-                buf[LINE_LEN] = '\n' as u8;
-                fwrite(transmute(&buf[0]),
-                       LINE_LEN as size_t + 1,
-                       1,
-                       self.stdout);
-            }
-            for i in range(0u, chars_left) {
+    fn make(&mut self, n: uint) -> IoResult<()> {
+        let lines = n / LINE_LEN;
+        let chars_left = n % LINE_LEN;
+        let mut buf = [0, ..LINE_LEN + 1];
+
+        for _ in range(0, lines) {
+            for i in range(0u, LINE_LEN) {
                 buf[i] = self.nextc();
             }
-            fwrite(transmute(&buf[0]), chars_left as size_t, 1, self.stdout);
+            buf[LINE_LEN] = '\n' as u8;
+            try!(self.out.write(buf));
+        }
+        for i in range(0u, chars_left) {
+            buf[i] = self.nextc();
         }
+        self.out.write(buf.slice_to(chars_left))
     }
 }
 
 fn main() {
-    let n: uint = FromStr::from_str(os::args()[1]).unwrap();
-
-    unsafe {
-        let mode = "w";
-        let stdout = fdopen(STDOUT_FILENO as c_int, transmute(&mode[0]));
-
-        fputs(transmute(&MESSAGE_1[0]), stdout);
-        let mut repeat = RepeatFasta::new(stdout, ALU);
-        repeat.make(n * 2);
+    let args = os::args();
+    let n = if args.len() > 1 {
+        from_str::<uint>(args[1]).unwrap()
+    } else {
+        5
+    };
+
+    let mut out = BufferedWriter::new(stdout());
+
+    out.write_line(">ONE Homo sapiens alu").unwrap();
+    {
+        let mut repeat = RepeatFasta::new(ALU, &mut out);
+        repeat.make(n * 2).unwrap();
+    }
 
-        fputs(transmute(&MESSAGE_2[0]), stdout);
-        let iub = sum_and_scale(IUB);
-        let mut random = RandomFasta::new(stdout, iub);
-        random.make(n * 3);
+    out.write_line(">TWO IUB ambiguity codes").unwrap();
+    let iub = sum_and_scale(IUB);
+    let mut random = RandomFasta::new(&mut out, iub);
+    random.make(n * 3).unwrap();
 
-        fputs(transmute(&MESSAGE_3[0]), stdout);
-        let homo_sapiens = sum_and_scale(HOMO_SAPIENS);
-        random.lookup = RandomFasta::make_lookup(homo_sapiens);
-        random.make(n * 5);
+    random.out.write_line(">THREE Homo sapiens frequency").unwrap();
+    let homo_sapiens = sum_and_scale(HOMO_SAPIENS);
+    random.lookup = make_lookup(homo_sapiens);
+    random.make(n * 5).unwrap();
 
-        fputc('\n' as c_int, stdout);
-    }
+    random.out.write_str("\n").unwrap();
 }
index 9190ff69347eb4a2b5ff7403b6f56147e8891599..a8f3489cb8793b08a19f8704f1055f59e1fd3296 100644 (file)
@@ -8,19 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
+// ignore-pretty
 
-extern crate extra;
+use std::str;
+use std::vec;
 
-use std::cast::transmute;
-use std::i32::range;
-use std::libc::{STDIN_FILENO, c_int, fdopen, fgets, fileno, fopen, fstat};
-use std::libc::{stat, strlen};
-use std::mem::init;
-use std::ptr::null;
-use std::vec::{reverse};
-
-static LINE_LEN: uint = 80;
 static TABLE: [u8, ..4] = [ 'A' as u8, 'C' as u8, 'G' as u8, 'T' as u8 ];
 static TABLE_SIZE: uint = 2 << 16;
 
 
 // Code implementation
 
-#[deriving(Eq, Ord)]
+#[deriving(Eq, TotalOrd, TotalEq)]
 struct Code(u64);
 
 impl Code {
     fn hash(&self) -> u64 {
-        **self
+        let Code(ret) = *self;
+        return ret;
     }
 
-    #[inline(always)]
     fn push_char(&self, c: u8) -> Code {
-        Code((**self << 2) + (pack_symbol(c) as u64))
+        Code((self.hash() << 2) + (pack_symbol(c) as u64))
     }
 
     fn rotate(&self, c: u8, frame: i32) -> Code {
-        Code(*self.push_char(c) & ((1u64 << (2 * (frame as u64))) - 1))
+        Code(self.push_char(c).hash() & ((1u64 << (2 * (frame as u64))) - 1))
     }
 
     fn pack(string: &str) -> Code {
-        let mut code = Code(0u64);
-        for i in range(0u, string.len()) {
-            code = code.push_char(string[i]);
-        }
-        code
+        string.bytes().fold(Code(0u64), |a, b| a.push_char(b))
     }
 
     // FIXME: Inefficient.
     fn unpack(&self, frame: i32) -> ~str {
-        let mut key = **self;
+        let mut key = self.hash();
         let mut result = ~[];
         for _ in range(0, frame) {
             result.push(unpack_symbol((key as u8) & 3));
             key >>= 2;
         }
 
-        reverse(result);
+        result.reverse();
         str::from_utf8_owned(result).unwrap()
     }
 }
@@ -91,7 +79,8 @@ fn f(&self, entry: &mut Entry) {
 
 impl TableCallback for PrintCallback {
     fn f(&self, entry: &mut Entry) {
-        println!("{}\t{}", entry.count as int, **self);
+        let PrintCallback(s) = *self;
+        println!("{}\t{}", entry.count as int, s);
     }
 }
 
@@ -103,14 +92,19 @@ struct Entry {
 
 struct Table {
     count: i32,
-    items: [Option<~Entry>, ..TABLE_SIZE]
+    items: ~[Option<~Entry>]
+}
+
+struct Items<'a> {
+    cur: Option<&'a Entry>,
+    items: vec::Items<'a, Option<~Entry>>,
 }
 
 impl Table {
     fn new() -> Table {
         Table {
             count: 0,
-            items: [ None, ..TABLE_SIZE ],
+            items: vec::from_fn(TABLE_SIZE, |_| None),
         }
     }
 
@@ -137,7 +131,7 @@ fn search_remainder<C:TableCallback>(item: &mut Entry, key: Code, c: C) {
     }
 
     fn lookup<C:TableCallback>(&mut self, key: Code, c: C) {
-        let index = *key % (TABLE_SIZE as u64);
+        let index = key.hash() % (TABLE_SIZE as u64);
 
         {
             if self.items[index].is_none() {
@@ -153,7 +147,7 @@ fn lookup<C:TableCallback>(&mut self, key: Code, c: C) {
         }
 
         {
-            let mut entry = &mut *self.items[index].get_mut_ref();
+            let entry = &mut *self.items[index].get_mut_ref();
             if entry.code == key {
                 c.f(*entry);
                 return;
@@ -163,37 +157,45 @@ fn lookup<C:TableCallback>(&mut self, key: Code, c: C) {
         }
     }
 
-    fn each(&self, f: |entry: &Entry| -> bool) {
-        for self.items.each |item| {
-            match *item {
-                None => {}
-                Some(ref item) => {
-                    let mut item: &Entry = *item;
-                    loop {
-                        if !f(item) {
-                            return;
-                        }
-
-                        match item.next {
-                            None => break,
-                            Some(ref next_item) => item = &**next_item,
-                        }
+    fn iter<'a>(&'a self) -> Items<'a> {
+        Items { cur: None, items: self.items.iter() }
+    }
+}
+
+impl<'a> Iterator<&'a Entry> for Items<'a> {
+    fn next(&mut self) -> Option<&'a Entry> {
+        let ret = match self.cur {
+            None => {
+                let i;
+                loop {
+                    match self.items.next() {
+                        None => return None,
+                        Some(&None) => {}
+                        Some(&Some(ref a)) => { i = &**a; break }
                     }
                 }
-            };
+                self.cur = Some(&*i);
+                &*i
+            }
+            Some(c) => c
+        };
+        match ret.next {
+            None => { self.cur = None; }
+            Some(ref next) => { self.cur = Some(&**next); }
         }
+        return Some(ret);
     }
 }
 
 // Main program
 
 fn pack_symbol(c: u8) -> u8 {
-    match c {
-        'a' as u8 | 'A' as u8 => 0,
-        'c' as u8 | 'C' as u8 => 1,
-        'g' as u8 | 'G' as u8 => 2,
-        't' as u8 | 'T' as u8 => 3,
-        _ => fail!(c.to_str())
+    match c as char {
+        'a' | 'A' => 0,
+        'c' | 'C' => 1,
+        'g' | 'G' => 2,
+        't' | 'T' => 3,
+        _ => fail!("{}", c as char),
     }
 }
 
@@ -215,43 +217,6 @@ fn next_char<'a>(mut buf: &'a [u8]) -> &'a [u8] {
     buf
 }
 
-#[inline(never)]
-fn read_stdin() -> ~[u8] {
-    unsafe {
-        let mode = "r";
-        //let stdin = fdopen(STDIN_FILENO as c_int, transmute(&mode[0]));
-        let path = "knucleotide-input.txt";
-        let stdin = fopen(transmute(&path[0]), transmute(&mode[0]));
-
-        let mut st: stat = init();
-        fstat(fileno(stdin), &mut st);
-        let mut buf = vec::from_elem(st.st_size as uint, 0);
-
-        let header = ">THREE".as_bytes();
-
-        {
-            let mut window: &mut [u8] = buf;
-            loop {
-                fgets(transmute(&mut window[0]), LINE_LEN as c_int, stdin);
-
-                {
-                    if window.slice(0, 6) == header {
-                        break;
-                    }
-                }
-            }
-
-            while fgets(transmute(&mut window[0]),
-                        LINE_LEN as c_int,
-                        stdin) != null() {
-                window = window.mut_slice(strlen(transmute(&window[0])) as uint, window.len());
-            }
-        }
-
-        buf
-    }
-}
-
 fn generate_frequencies(frequencies: &mut Table,
                         mut input: &[u8],
                         frame: i32) {
@@ -273,20 +238,20 @@ fn generate_frequencies(frequencies: &mut Table,
 
 fn print_frequencies(frequencies: &Table, frame: i32) {
     let mut vector = ~[];
-    for frequencies.each |entry| {
+    for entry in frequencies.iter() {
         vector.push((entry.code, entry.count));
     }
     vector.sort();
 
     let mut total_count = 0;
-    for vector.each |&(_, count)| {
+    for &(_, count) in vector.iter() {
         total_count += count;
     }
 
-    for vector.each |&(key, count)| {
+    for &(key, count) in vector.iter() {
         println!("{} {:.3f}",
                  key.unpack(frame),
-                 (count as float * 100.0) / (total_count as float));
+                 (count as f32 * 100.0) / (total_count as f32));
     }
 }
 
@@ -295,22 +260,24 @@ fn print_occurrences(frequencies: &mut Table, occurrence: &'static str) {
 }
 
 fn main() {
-    let input = read_stdin();
-
-    let mut frequencies = ~Table::new();
-    generate_frequencies(frequencies, input, 1);
-    print_frequencies(frequencies, 1);
-
-    *frequencies = Table::new();
-    generate_frequencies(frequencies, input, 2);
-    print_frequencies(frequencies, 2);
-
-    for range(0, 5) |i| {
-        let occurrence = OCCURRENCES[i];
-        *frequencies = Table::new();
-        generate_frequencies(frequencies,
+    let input = include_str!("shootout-k-nucleotide.data");
+    let pos = input.find_str(">THREE").unwrap();
+    let pos2 = pos + input.slice_from(pos).find_str("\n").unwrap();
+    let input = input.slice_from(pos2 + 1).as_bytes();
+
+    let mut frequencies = Table::new();
+    generate_frequencies(&mut frequencies, input, 1);
+    print_frequencies(&frequencies, 1);
+
+    frequencies = Table::new();
+    generate_frequencies(&mut frequencies, input, 2);
+    print_frequencies(&frequencies, 2);
+
+    for occurrence in OCCURRENCES.iter() {
+        frequencies = Table::new();
+        generate_frequencies(&mut frequencies,
                              input,
                              occurrence.len() as i32);
-        print_occurrences(frequencies, occurrence);
+        print_occurrences(&mut frequencies, *occurrence);
     }
 }
diff --git a/src/test/bench/task-perf-linked-failure.rs b/src/test/bench/task-perf-linked-failure.rs
deleted file mode 100644 (file)
index 189a3ac..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-pretty
-// ignore-test linked failure
-
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-/**
- * Test performance of killing many tasks in a taskgroup.
- * Along the way, tests various edge cases of ancestor group management.
- * In particular, this tries to get each grandchild task to hit the
- * "nobe_is_dead" case in each_ancestor only during task exit, but not during
- * task spawn. This makes sure that defunct ancestor groups are handled correctly
- * w.r.t. possibly leaving stale *rust_tasks lying around.
- */
-
-// Creates in the background 'num_tasks' tasks, all blocked forever.
-// Doesn't return until all such tasks are ready, but doesn't block forever itself.
-
-use std::comm::{stream, Chan};
-use std::os;
-use std::result;
-use std::task;
-use std::uint;
-
-fn grandchild_group(num_tasks: uint) {
-    let (po, ch) = stream();
-    let ch = Chan::new(ch);
-
-    for _ in range(0, num_tasks) {
-        let ch = ch.clone();
-        let mut t = task::task();
-        t.spawn(proc() { // linked
-            ch.send(());
-            let (p, _c) = stream::<()>();
-            p.recv(); // block forever
-        });
-    }
-    error!("Grandchild group getting started");
-    for _ in range(0, num_tasks) {
-        // Make sure all above children are fully spawned; i.e., enlisted in
-        // their ancestor groups.
-        po.recv();
-    }
-    error!("Grandchild group ready to go.");
-    // Master grandchild task exits early.
-}
-
-fn spawn_supervised_blocking(myname: &str, f: proc()) {
-    let mut builder = task::task();
-    let res = builder.future_result();
-    builder.supervised();
-    builder.spawn(f);
-    error!("{} group waiting", myname);
-    let x = res.recv();
-    assert!(x.is_ok());
-}
-
-fn main() {
-    let args = os::args();
-    let args = if os::getenv("RUST_BENCH").is_some() {
-        ~[~"", ~"100000"]
-    } else if args.len() <= 1u {
-        ~[~"", ~"100"]
-    } else {
-        args.clone()
-    };
-
-    let num_tasks = from_str::<uint>(args[1]).unwrap();
-
-    // Main group #0 waits for unsupervised group #1.
-    // Grandparent group #1 waits for middle group #2, then fails, killing #3.
-    // Middle group #2 creates grandchild_group #3, waits for it to be ready, exits.
-    let x: result::Result<(), ~Any> = task::try(proc() { // unlinked
-        spawn_supervised_blocking("grandparent", proc() {
-            spawn_supervised_blocking("middle", proc() {
-                grandchild_group(num_tasks);
-            });
-            // When grandchild group is ready to go, make the middle group exit.
-            error!("Middle group wakes up and exits");
-        });
-        // Grandparent group waits for middle group to be gone, then fails
-        error!("Grandparent group wakes up and fails");
-        fail!();
-    });
-    assert!(x.is_err());
-}
index 6733fa6832f6a29c6231c23c58c907a351026962..70e76b9fde11c7fb8c8236a0025d06b823b8311c 100644 (file)
@@ -8,24 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
-
-// ignored because the lint pass doesn't know to ignore standard library
-// stuff.
-
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
+// error-pattern: unreachable statement
 
 #[deny(unreachable_code)];
 
 fn main() {
     return;
-    info!("Paul is dead"); //~ ERROR: unreachable
+    info!("Paul is dead");
 }
index 8dcc07f50f78edf65987bbae23fbe9df77de3368..cd5ee1cafecfbbb0dcb44bb54bbfb3413c4db0ea 100644 (file)
@@ -8,10 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern:empty #[link_name] not allowed; use #[nolink].
-
-// ignore-test
-
-#[link_name = ""]
+#[link(name = "")] //~ ERROR: given with empty name
 extern {
 }
diff --git a/src/test/compile-fail/empty-linkname2.rs b/src/test/compile-fail/empty-linkname2.rs
deleted file mode 100644 (file)
index bf4d2b8..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test
-
-// error-pattern:empty #[link_name] not allowed; use #[nolink].
-// Issue #1326
-
-#[link_name = ""]
-#[nolink]
-extern {
-}
index 5f50b1744932397056e00ca19edcc57d34e62dbc..846a51ca1287e8829f31e281117e4b82dec56c6c 100644 (file)
@@ -8,26 +8,24 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
-
 // test that autoderef of a type like this does not
 // cause compiler to loop.  Note that no instances
 // of such a type could ever be constructed.
-struct t(@t); //~ ERROR this type cannot be instantiated
+struct t(~t); //~ ERROR this type cannot be instantiated
 
 trait to_str_2 {
-    fn to_str() -> ~str;
+    fn my_to_str() -> ~str;
 }
 
 // I use an impl here because it will cause
 // the compiler to attempt autoderef and then
 // try to resolve the method.
 impl to_str_2 for t {
-    fn to_str() -> ~str { ~"t" }
+    fn my_to_str() -> ~str { ~"t" }
 }
 
 fn new_t(x: t) {
-    x.to_str();
+    x.my_to_str(); //~ ERROR does not implement
 }
 
 fn main() {
diff --git a/src/test/compile-fail/issue-2969.rs b/src/test/compile-fail/issue-2969.rs
deleted file mode 100644 (file)
index 414273b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test
-
-fn main()
-{
-// See #2969 -- error message should be improved
-   let mut x = [1, 2, 4];
-   let v : &int = &x[2];
-   x[2] = 6;
-   assert_eq!(*v, 6);
-}
diff --git a/src/test/compile-fail/issue-3177-mutable-struct.rs b/src/test/compile-fail/issue-3177-mutable-struct.rs
deleted file mode 100644 (file)
index ab90b7b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test
-// error-pattern: instantiating a type parameter with an incompatible type
-
-struct S<T:Freeze> {
-    s: T,
-    cant_nest: ()
-}
-
-fn main() {
-    let a1  = ~S{ s: true, cant_nest: () };
-    let _a2 = ~S{ s: a1, cant_nest: () };
-}
index 7b2a5a39aee02829d53ce31a7c17d69f818e72f8..c44336aeaf52b73bd934b7c08c887058ba9befda 100644 (file)
@@ -23,11 +23,11 @@ fn new(x: f64, y: f64) -> Point {
     }
 
     fn to_str(&self) -> ~str {
-        fmt!("(%f, %f)", self.x, self.y)
+        format!("({}, {})", self.x, self.y)
     }
 }
 
 fn main() {
-    let p = Point::new(0.0f, 0.0f);
+    let p = Point::new(0.0, 0.0);
     println!("{}", p.to_str());
 }
diff --git a/src/test/compile-fail/issue-4542.rs b/src/test/compile-fail/issue-4542.rs
deleted file mode 100644 (file)
index b9f0b6c..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test
-
-fn main() {
-    for os::args().each |arg| {
-        match (*arg).clone() {
-            s => { }
-        }
-    }
-}
index b2a9c9ba0fb61743c98c53a845f66622f87f5af3..94110f077623b680d815c414a616cdc137a2383c 100644 (file)
@@ -8,9 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
-
 trait I {}
-type K = I;
-impl K for int {}
+type K = I; //~ ERROR: reference to trait
+impl K for int {} //~ ERROR: `K` is not a trait
 fn main() {}
index 5d6b62fe28311e26f5343fa2588bc9850ea8ad88..a80d4b721924efda0bde66f4e751c76700b6ff7d 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
-
 // Creating a stack closure which references an owned pointer and then
 // transferring ownership of the owned box before invoking the stack
 // closure results in a crash.
@@ -26,6 +24,6 @@ fn main() {
       let x  : ~uint         = ~9;
       let sq : || -> uint =  || { *x * *x };
 
-      twice(x);
+      twice(x); //~ ERROR: cannot move out of
       invoke(sq);
 }
diff --git a/src/test/compile-fail/kindck-owned-trait-scoped.rs b/src/test/compile-fail/kindck-owned-trait-scoped.rs
deleted file mode 100644 (file)
index 2e13148..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test
-// ignored because to_foo() doesn't work.
-
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// A dummy trait/impl that work close over any type.  The trait will
-// be parameterized by a region due to the &'a int constraint.
-
-trait foo {
-    fn foo(&self, i: &'a int) -> int;
-}
-
-impl<T:Clone> foo for T {
-    fn foo(&self, i: &'a int) -> int {*i}
-}
-
-fn to_foo<T:Clone>(t: T) {
-    // This version is ok because, although T may contain references
-    // it never escapes the fn body.  We know this because
-    // the type of foo includes a region which will be resolved to
-    // the fn body itself.
-    let v = &3;
-    struct F<T> { f: T }
-    let x = @F {f:t} as @foo;
-    assert_eq!(x.foo(v), 3);
-}
-
-fn to_foo_2<T:Clone>(t: T) -> @foo {
-    // Not OK---T may contain references and it is going to escape
-    // as part of the returned foo value
-    struct F<T> { f: T }
-    @F {f:t} as @foo //~ ERROR value may contain references; add `'static` bound
-}
-
-fn to_foo_3<T:Clone + 'static>(t: T) -> @foo {
-    // OK---T may escape as part of the returned foo value, but it is
-    // owned and hence does not contain references
-    struct F<T> { f: T }
-    @F {f:t} as @foo
-}
-
-fn main() {
-}
index 48e258fe5fe61f379769ac254a7e3a27a76d2e5a..83c911d916e1e8c348101e061a6dee961db3e86c 100644 (file)
@@ -8,21 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
-// ignored because lint is messed up with the new visitor transition
-
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 #[deny(unused_variable)];
 #[deny(dead_assignment)];
+#[allow(dead_code, non_camel_case_types)];
 
 fn f1(x: int) {
     //~^ ERROR unused variable: `x`
index caf9fd6c66179f990717faeca576de0eb20739fd..79f0cc352e4e708b7e91bbf7d97532c1dd92e611 100644 (file)
@@ -8,13 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
-
-type foo = Option<int>;
-
-fn bar(_t: foo) {}
+fn let_in<T>(x: T, f: |T|) {}
 
 fn main() {
-    // we used to print foo<int>:
-    bar(Some(3u)); //~ ERROR mismatched types: expected `foo`
+    let_in(3u, |i| { assert!(i == 3i); });
+    //~^ ERROR expected `uint` but found `int`
+
+    let_in(3i, |i| { assert!(i == 3u); });
+    //~^ ERROR expected `int` but found `uint`
 }
index 5a252eb2975275f63e02c59c26494e83e63cc20d..fb80c31d4647c3ab835c7d09c4b7ad65c32421ee 100644 (file)
@@ -8,12 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
 // aux-build:private_variant_xc.rs
 
 extern crate private_variant_xc;
 
 pub fn main() {
     let _ = private_variant_xc::Bar;
-    let _ = private_variant_xc::Baz;    //~ ERROR unresolved name
+    let _ = private_variant_xc::Baz;    //~ ERROR variant `Baz` is private
 }
index 4afbe7ed48b1c2db141ee8a26cb26dde4efef712..e4dd4b75fd4a8903ab0bfbf241406928ce8f20a4 100644 (file)
@@ -8,11 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
 // aux-build:private_variant_1.rs
 
 extern crate private_variant_1;
 
 fn main() {
-    let _x = private_variant_1::super_sekrit::baz; //~ ERROR baz is private
+    let _x = private_variant_1::super_sekrit::baz; //~ ERROR is private
 }
diff --git a/src/test/compile-fail/recursion.rs b/src/test/compile-fail/recursion.rs
new file mode 100644 (file)
index 0000000..0fe042b
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+enum Nil {Nil}
+struct Cons<T> {head:int, tail:T}
+trait Dot {fn dot(&self, other:Self) -> int;}
+impl Dot for Nil {
+  fn dot(&self, _:Nil) -> int {0}
+}
+impl<T:Dot> Dot for Cons<T> {
+  fn dot(&self, other:Cons<T>) -> int {
+    self.head * other.head + self.tail.dot(other.tail)
+  }
+}
+fn test<T:Dot> (n:int, i:int, first:T, second:T) ->int {
+    //~^ ERROR: overly deep expansion of inlined function
+  match n {
+    0 => {first.dot(second)}
+      // Error message should be here. It should be a type error
+      // to instantiate `test` at a type other than T. (See #4287)
+    _ => {test (n-1, i+1, Cons {head:2*i+1, tail:first}, Cons{head:i*i, tail:second})}
+  }
+}
+pub fn main() {
+  let n = test(1, 0, Nil, Nil);
+  println!("{}", n);
+}
diff --git a/src/test/compile-fail/redundant-link-args.rs b/src/test/compile-fail/redundant-link-args.rs
deleted file mode 100644 (file)
index 8edbeae..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-fast
-// ignore-test
-
-// error-pattern:library 'm' already added: can't specify link_args.
-
-/* I think it should undefined to have multiple modules that link in the same
-  library, but provide different link arguments. Unfortunately we don't track
-  link_args by module -- they are just appended as discovered into the crate
-  store -- but for now, it should be an error to provide link_args on a module
-  that's already been included (with or without link_args). */
-
-#[link_name= "m"]
-#[link_args="-foo"]             // this could have been elided.
-extern {
-}
-
-#[link_name= "m"]
-#[link_args="-bar"]             // this is the actual error trigger.
-extern {
-}
index 2eeca4548549570030b54af07745437536c3e4f8..b3b5993bf915bd06d51143ba57dec3fd1fa18cab 100644 (file)
 fn of<T>() -> |T| { fail!(); }
 fn subtype<T>(x: |T|) { fail!(); }
 
-fn test_fn<T>(_x: &'x T, _y: &'y T, _z: &'z T) {
+fn test_fn<'x, 'y, 'z, T>(_x: &'x T, _y: &'y T, _z: &'z T) {
     // Here, x, y, and z are free.  Other letters
     // are bound.  Note that the arrangement
     // subtype::<T1>(of::<T2>()) will typecheck
     // iff T1 <: T2.
 
     // should be the default:
-    subtype::<'static ||>(of::<||>());
-    subtype::<||>(of::<'static ||>());
+    subtype::< ||:'static>(of::<||>());
+    subtype::<||>(of::< ||:'static>());
 
     //
-    subtype::<'x ||>(of::<||>());    //~ ERROR mismatched types
-    subtype::<'x ||>(of::<'y ||>());  //~ ERROR mismatched types
+    subtype::< <'x> ||>(of::<||>());    //~ ERROR mismatched types
+    subtype::< <'x> ||>(of::< <'y> ||>());  //~ ERROR mismatched types
 
-    subtype::<'x ||>(of::<'static ||>()); //~ ERROR mismatched types
-    subtype::<'static ||>(of::<'x ||>());
+    subtype::< <'x> ||>(of::< ||:'static>()); //~ ERROR mismatched types
+    subtype::< ||:'static>(of::< <'x> ||>());
 
 }
+
+fn main() {}
diff --git a/src/test/compile-fail/syntax-extension-minor.rs b/src/test/compile-fail/syntax-extension-minor.rs
new file mode 100644 (file)
index 0000000..e65b1c0
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// this now fails (correctly, I claim) because hygiene prevents
+// the assembled identifier from being a reference to the binding.
+
+pub fn main() {
+    let asdf_fdsa = ~"<.<";
+    assert_eq!(concat_idents!(asd, f_f, dsa), ~"<.<");
+    //~^ ERROR: unresolved name `asdf_fdsa`
+
+    assert!(stringify!(use_mention_distinction) ==
+                "use_mention_distinction");
+}
diff --git a/src/test/compile-fail/trait-inheritance-missing-requirement.rs b/src/test/compile-fail/trait-inheritance-missing-requirement.rs
deleted file mode 100644 (file)
index 2910115..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test
-// error-pattern: what
-
-trait Foo {
-    fn f();
-}
-
-trait Bar : Foo {
-    fn g();
-}
-
-struct A {
-    x: int
-}
-
-// Can't implement Bar without an impl of Foo
-impl Bar for A {
-    fn g() { }
-}
-
-fn main() {
-}
index fed6f675105a71f93e377aae6a6fb986e08c1d9f..49449be52af8f5a13981b8aabd13e24bc1850f04 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // ignore-test
-// error-pattern: ran out of stack
+// error-pattern: task '<main>' has overflowed its stack
 
 struct R {
     b: int,
diff --git a/src/test/run-fail/linked-failure.rs b/src/test/run-fail/linked-failure.rs
deleted file mode 100644 (file)
index fb5fdff..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test linked failure
-// error-pattern:1 == 2
-
-extern crate extra;
-
-use std::comm;
-use std::task;
-
-fn child() { assert!((1 == 2)); }
-
-fn main() {
-    let (p, _c) = comm::stream::<int>();
-    task::spawn(|| child() );
-    let x = p.recv();
-}
diff --git a/src/test/run-fail/linked-failure2.rs b/src/test/run-fail/linked-failure2.rs
deleted file mode 100644 (file)
index 8b9dd59..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test linked failure
-// error-pattern:fail
-
-use std::comm;
-use std::task;
-
-fn child() { fail!(); }
-
-fn main() {
-    let (p, _c) = comm::stream::<()>();
-    task::spawn(|| child() );
-    task::deschedule();
-}
diff --git a/src/test/run-fail/linked-failure3.rs b/src/test/run-fail/linked-failure3.rs
deleted file mode 100644 (file)
index 78119dd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test linked failure
-// error-pattern:fail
-
-use std::comm;
-use std::task;
-
-fn grandchild() { fail!("grandchild dies"); }
-
-fn child() {
-    let (p, _c) = comm::stream::<int>();
-    task::spawn(|| grandchild() );
-    let x = p.recv();
-}
-
-fn main() {
-    let (p, _c) = comm::stream::<int>();
-    task::spawn(|| child() );
-    let x = p.recv();
-}
diff --git a/src/test/run-fail/linked-failure4.rs b/src/test/run-fail/linked-failure4.rs
deleted file mode 100644 (file)
index fc47f47..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test linked failure
-// error-pattern:1 == 2
-
-use std::comm;
-use std::task;
-
-fn child() { assert!((1 == 2)); }
-
-fn parent() {
-    let (p, _c) = comm::stream::<int>();
-    task::spawn(|| child() );
-    let x = p.recv();
-}
-
-// This task is not linked to the failure chain, but since the other
-// tasks are going to fail the kernel, this one will fail too
-fn sleeper() {
-    let (p, _c) = comm::stream::<int>();
-    let x = p.recv();
-}
-
-fn main() {
-    task::spawn(|| sleeper() );
-    task::spawn(|| parent() );
-}
diff --git a/src/test/run-fail/spawnfail.rs b/src/test/run-fail/spawnfail.rs
deleted file mode 100644 (file)
index 01bc966..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test linked failure
-// error-pattern:explicit
-
-extern crate extra;
-
-use std::task;
-
-// We don't want to see any invalid reads
-fn main() {
-    fn f() {
-        fail!();
-    }
-    task::spawn(|| f() );
-}
diff --git a/src/test/run-fail/task-comm-recv-block.rs b/src/test/run-fail/task-comm-recv-block.rs
deleted file mode 100644 (file)
index 2eaca95..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test linked failure
-// error-pattern:goodfail
-
-use std::comm;
-use std::task;
-
-fn goodfail() {
-    task::deschedule();
-    fail!("goodfail");
-}
-
-fn main() {
-    task::spawn(|| goodfail() );
-    let (po, _c) = comm::stream();
-    // We shouldn't be able to get past this recv since there's no
-    // message available
-    let i: int = po.recv();
-    fail!("badfail");
-}
index 5383e9d5479b41e9df8bb2a509d8db57af6394f5..1ce6c1b77dda7ffc86cb66c8fc6cf6849f163ed7 100644 (file)
 
 #[feature(managed_boxes)];
 
-extern crate extra;
 extern crate time;
+extern crate serialize;
 
 // These tests used to be separate files, but I wanted to refactor all
 // the common code.
 
 use std::hashmap::{HashMap, HashSet};
 
-use EBReader = extra::ebml::reader;
-use EBWriter = extra::ebml::writer;
+use EBReader = serialize::ebml::reader;
+use EBWriter = serialize::ebml::writer;
 use std::cmp::Eq;
 use std::cmp;
 use std::io;
 use serialize::{Decodable, Encodable};
 
-fn test_ebml<'a, A:
+fn test_ebml<'a, 'b, A:
     Eq +
-    Encodable<EBWriter::Encoder> +
-    Decodable<EBReader::Decoder<'a>>
+    Encodable<EBWriter::Encoder<'a>> +
+    Decodable<EBReader::Decoder<'b>>
 >(a1: &A) {
     let mut wr = std::io::MemWriter::new();
     let mut ebml_w = EBWriter::Encoder(&mut wr);
     a1.encode(&mut ebml_w);
     let bytes = wr.get_ref();
 
-    let d: extra::ebml::Doc<'a> = EBReader::Doc(bytes);
+    let d: serialize::ebml::Doc<'a> = EBReader::Doc(bytes);
     let mut decoder: EBReader::Decoder<'a> = EBReader::Decoder(d);
     let a2: A = Decodable::decode(&mut decoder);
     assert!(*a1 == a2);
index 50ccac793c265c07f8a56d792dbdc0321ffd6869..ac4101ae5b174465738a6c96f13dd3919da2e5b8 100644 (file)
@@ -54,7 +54,7 @@ struct G<T> {
     t: T
 }
 
-fn roundtrip<'a, T: Rand + Eq + Encodable<Encoder> +
+fn roundtrip<'a, T: Rand + Eq + Encodable<Encoder<'a>> +
                     Decodable<Decoder<'a>>>() {
     let obj: T = random();
     let mut w = MemWriter::new();
diff --git a/src/test/run-pass/duplicate-use.rs b/src/test/run-pass/duplicate-use.rs
deleted file mode 100644 (file)
index c710eb5..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test
-
-extern crate extra;
-
-use list = extra::oldmap::chained;
-use extra::list;
-
-pub fn main() {
-    let _x: list::T<int, int> = list::mk();
-}
index d090f9a243c4ad193cfdbc2000098e34e6352656..fae67e9e3d9953694369f154ed448b121f7045b8 100644 (file)
@@ -8,13 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test: #3511: does not currently compile, due to rvalue issues
-
-use std::vec;
-
 struct Pair { x: int, y: int }
+
 pub fn main() {
-    for vec::each(~[Pair {x: 10, y: 20}, Pair {x: 30, y: 0}]) |elt| {
+    for elt in (~[Pair {x: 10, y: 20}, Pair {x: 30, y: 0}]).iter() {
         assert_eq!(elt.x + elt.y, 30);
     }
 }
diff --git a/src/test/run-pass/foreign-lib-path.rs b/src/test/run-pass/foreign-lib-path.rs
deleted file mode 100644 (file)
index 3ee43d0..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test FIXME I don't know how to test this (#2604)
-// compile-flags:-L.
-// The -L flag is also used for linking foreign libraries
-
-mod WHATGOESHERE {
-    // FIXME: I want to name a mod that would not link successfully
-    // wouthout providing a -L argument to the compiler, and that
-    // will also be found successfully at runtime.
-    extern {
-        pub fn IDONTKNOW() -> u32;
-    }
-}
-
-pub fn main() {
-    assert_eq!(IDONTKNOW(), 0x_BAD_DOOD_u32);
-}
diff --git a/src/test/run-pass/foreign-mod.rc b/src/test/run-pass/foreign-mod.rc
deleted file mode 100644 (file)
index 0e4114a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test FIXME #7308
-
-native mod libc = target_libc {
-  fn open(int name, int flags, int mode) -> int;
-  fn close(int fd) -> int;
-  fn read(int fd, int buf, int count) -> int;
-  fn write(int fd, int buf, int count) -> int;
-  fn malloc(int sz) -> int;
-  fn free(int p) -> ();
-}
-
-native "cdecl" mod rustrt {
-  fn str_buf(str s) -> int;
-}
-
-mod inner = "native-mod-src/inner.rs";
diff --git a/src/test/run-pass/foreign.rc b/src/test/run-pass/foreign.rc
deleted file mode 100644 (file)
index 129db5d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test
-
-native "cdecl" mod rustrt {
-  fn str_buf(str s) -> int;
-}
-
-
-native mod libc = target_libc {
-  fn puts(int s) -> ();
-}
-
-mod user = "native-src/native.rs";
diff --git a/src/test/run-pass/issue-1451.rs b/src/test/run-pass/issue-1451.rs
new file mode 100644 (file)
index 0000000..a0c0275
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[allow(unused_variable)];
+
+struct T { f: extern "Rust" fn() }
+struct S { f: extern "Rust" fn() }
+
+fn fooS(t: S) {
+}
+
+fn fooT(t: T) {
+}
+
+fn bar() {
+}
+
+pub fn main() {
+    let x: extern "Rust" fn() = bar;
+    fooS(S {f: x});
+    fooS(S {f: bar});
+
+    let x: extern "Rust" fn() = bar;
+    fooT(T {f: x});
+    fooT(T {f: bar});
+}
diff --git a/src/test/run-pass/issue-2074.rs b/src/test/run-pass/issue-2074.rs
new file mode 100644 (file)
index 0000000..a8e3584
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[allow(non_camel_case_types)];
+
+pub fn main() {
+    let one: || -> uint = || {
+        enum r { a };
+        a as uint
+    };
+    let two: || -> uint = || {
+        enum r { a };
+        a as uint
+    };
+    one(); two();
+}
index c00f5ddfb2bd39484f5abfd68d433b185e80c110..0580dd89a3092c8fdff3e2a8d5bffaa7a670558c 100644 (file)
@@ -8,18 +8,24 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
+use std::task;
 
 static generations: uint = 1024+256+128+49;
 
+fn spawn(f: proc()) {
+    let mut t = task::task();
+    t.opts.stack_size = Some(32 * 1024);
+    t.spawn(f);
+}
+
 fn child_no(x: uint) -> proc() {
-     || {
+    proc() {
         if x < generations {
-            task::spawn(child_no(x+1));
+            spawn(child_no(x+1));
         }
     }
 }
 
 pub fn main() {
-    task::spawn(child_no(0));
+    spawn(child_no(0));
 }
index b013e30047dd175b01ee248fba5bcec12c521e15..39a97b00b32da855b42da654de601e6e447ec6aa 100644 (file)
@@ -17,13 +17,13 @@ fn bar() {}
 }
 
 mod b {
-    fn foo(f: Option<||>) { f.iter(|x|x()) }
+    fn foo(f: Option<||>) { f.map(|x|x()); }
     fn bar() {}
     pub fn main() { foo(Some(bar)); }
 }
 
 mod c {
-    fn foo(f: Option<||>) { f.iter(|x|x()) }
+    fn foo(f: Option<||>) { f.map(|x|x()); }
     fn bar() {}
     pub fn main() { foo(Some(||bar())); }
 }
diff --git a/src/test/run-pass/issue-2190.rs b/src/test/run-pass/issue-2190.rs
deleted file mode 100644 (file)
index daea219..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test
-
-type t = {
-    f: proc()
-};
-
-pub fn main() {
-    let _t: t = { f: {||()} };
-}
diff --git a/src/test/run-pass/issue-3168.rs b/src/test/run-pass/issue-3168.rs
deleted file mode 100644 (file)
index 34a8552..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test linked failure
-// ignore-fast
-
-use std::comm;
-use std::task;
-
-pub fn main() {
-    let (p,c) = comm::stream();
-    task::try(|| {
-        let (p2,c2) = comm::stream();
-        task::spawn(|| {
-            p2.recv();
-            error!("sibling fails");
-            fail!();
-        });
-        let (p3,c3) = comm::stream();
-        c.send(c3);
-        c2.send(());
-        error!("child blocks");
-        p3.recv();
-    });
-    error!("parent tries");
-    assert!(!p.recv().try_send(()));
-    error!("all done!");
-}
index 8cc91134c5869136750e0484678e5dc1d8663b99..f2beda5973323c46f940bcc512c09867c39088f0 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test FIXME #3290
 pub fn main() {
    let mut x = ~3;
    x = x;
diff --git a/src/test/run-pass/issue-3796.rs b/src/test/run-pass/issue-3796.rs
deleted file mode 100644 (file)
index 37cccf7..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test FIXME #3796
-
-#[deny(dead_assignment)];
-pub fn main() {
-    let mut x = 1;
-    let f: || -> int = || { x + 20 };
-    assert_eq!(f(), 21);
-    x += 1;
-    assert_eq!(f(), 22);
-}
index 3360a726690ef62c48b1c5e7f3752482c94deeea..fe6521b4df9a630db170f438710038ac8c33faf0 100644 (file)
@@ -8,30 +8,28 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
-
-type ErrPrinter = |&str, &str|;
+type ErrPrinter<'a> = 'a |&str, &str|;
 
 fn example_err(prog: &str, arg: &str) {
     println!("{}: {}", prog, arg)
 }
 
-fn exit(+print: ErrPrinter, prog: &str, arg: &str) {
+fn exit(print: ErrPrinter, prog: &str, arg: &str) {
     print(prog, arg);
 }
 
-struct X {
-    err: ErrPrinter
+struct X<'a> {
+    err: ErrPrinter<'a>
 }
 
-impl X {
-    pub fn boom() {
+impl<'a> X<'a> {
+    pub fn boom(self) {
         exit(self.err, "prog", "arg");
     }
 }
 
 pub fn main(){
-    let val = &X{
+    let val = {
         err: example_err,
     };
     val.boom();
diff --git a/src/test/run-pass/issue-4241.rs b/src/test/run-pass/issue-4241.rs
deleted file mode 100644 (file)
index f6c2965..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-fast
-// ignore-test needs networking
-
-extern crate extra;
-
-use extra::net::tcp::TcpSocketBuf;
-
-use std::io;
-use std::int;
-
-use std::io::{ReaderUtil,WriterUtil};
-
-enum Result {
-  Nil,
-  Int(int),
-  Data(~[u8]),
-  List(~[Result]),
-  Error(~str),
-  Status(~str)
-}
-
-priv fn parse_data(len: uint, io: @io::Reader) -> Result {
-  let res =
-      if (len > 0) {
-      let bytes = io.read_bytes(len as uint);
-      assert_eq!(bytes.len(), len);
-      Data(bytes)
-  } else {
-      Data(~[])
-  };
-  assert_eq!(io.read_char(), '\r');
-  assert_eq!(io.read_char(), '\n');
-  return res;
-}
-
-priv fn parse_list(len: uint, io: @io::Reader) -> Result {
-    let mut list: ~[Result] = ~[];
-    for _ in range(0, len) {
-        let v = match io.read_char() {
-            '$' => parse_bulk(io),
-            ':' => parse_int(io),
-             _ => fail!()
-        };
-        list.push(v);
-    }
-    return List(list);
-}
-
-priv fn chop(s: ~str) -> ~str {
-  s.slice(0, s.len() - 1).to_owned()
-}
-
-priv fn parse_bulk(io: @io::Reader) -> Result {
-    match from_str::<int>(chop(io.read_line())) {
-    None => fail!(),
-    Some(-1) => Nil,
-    Some(len) if len >= 0 => parse_data(len as uint, io),
-    Some(_) => fail!()
-    }
-}
-
-priv fn parse_multi(io: @io::Reader) -> Result {
-    match from_str::<int>(chop(io.read_line())) {
-    None => fail!(),
-    Some(-1) => Nil,
-    Some(0) => List(~[]),
-    Some(len) if len >= 0 => parse_list(len as uint, io),
-    Some(_) => fail!()
-    }
-}
-
-priv fn parse_int(io: @io::Reader) -> Result {
-    match from_str::<int>(chop(io.read_line())) {
-    None => fail!(),
-    Some(i) => Int(i)
-    }
-}
-
-priv fn parse_response(io: @io::Reader) -> Result {
-    match io.read_char() {
-    '$' => parse_bulk(io),
-    '*' => parse_multi(io),
-    '+' => Status(chop(io.read_line())),
-    '-' => Error(chop(io.read_line())),
-    ':' => parse_int(io),
-    _ => fail!()
-    }
-}
-
-priv fn cmd_to_str(cmd: ~[~str]) -> ~str {
-  let mut res = ~"*";
-  res.push_str(cmd.len().to_str());
-  res.push_str("\r\n");
-    for s in cmd.iter() {
-    res.push_str([~"$", s.len().to_str(), ~"\r\n",
-                  (*s).clone(), ~"\r\n"].concat() );
-    }
-  res
-}
-
-fn query(cmd: ~[~str], sb: TcpSocketBuf) -> Result {
-  let cmd = cmd_to_str(cmd);
-  //println!("{}", cmd);
-  sb.write_str(cmd);
-  let res = parse_response(@sb as @io::Reader);
-  res
-}
-
-fn query2(cmd: ~[~str]) -> Result {
-  let _cmd = cmd_to_str(cmd);
-    io::with_str_reader(~"$3\r\nXXX\r\n")(|sb| {
-    let res = parse_response(@sb as @io::Reader);
-    println!("{:?}", res);
-    res
-    });
-}
-
-
-pub fn main() {
-}
index e6a3d2fa3b2410c2d59985e91279877ff2ce5b9b..024ee8c6dfec3e9ffdf9bb3d3c775bd5a7a5290d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
@@ -11,9 +11,8 @@
 use std::os;
 
 pub fn main() {
-    let x = os::args();
-    for arg in x.iter() {
-        match arg.clone() {
+    for arg in os::args().iter() {
+        match (*arg).clone() {
             _s => { }
         }
     }
diff --git a/src/test/run-pass/lots-a-fail.rs b/src/test/run-pass/lots-a-fail.rs
deleted file mode 100644 (file)
index 9c33ff5..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test linked failure
-
-extern crate extra;
-
-use std::task;
-
-fn die() {
-    fail!();
-}
-
-fn iloop() {
-    task::spawn(|| die() );
-}
-
-pub fn main() {
-    for _ in range(0u, 100u) {
-        task::spawn_unlinked(|| iloop() );
-    }
-}
index ccf641443916244e01044ba05ac288f1018bd72b..a922201c41ae457234e0a6942e591c958d6f9359 100644 (file)
@@ -8,19 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-test
-
-// ignored due to a bug in move detection for macros.
-
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
+#[feature(macro_rules)];
 
 use std::{option, cast};
 
@@ -42,7 +30,7 @@ fn is_none(&self) -> bool {
     }
     fn get_ref<'r>(&'r self) -> (int, &'r T) {
         match *self {
-            Nothing(..) => fail!("E::get_ref(Nothing::<%s>)",  stringify!($T)),
+            Nothing(..) => fail!("E::get_ref(Nothing::<{}>)",  stringify!(T)),
             Thing(x, ref y) => (x, y)
         }
     }
@@ -71,7 +59,7 @@ macro_rules! check_fancy {
         let t_ = Thing::<$T>(23, e);
         match t_.get_ref() {
             (23, $v) => { $chk }
-            _ => fail!("Thing::<%s>(23, %s).get_ref() != (23, _)",
+            _ => fail!("Thing::<{}>(23, {}).get_ref() != (23, _)",
                        stringify!($T), stringify!($e))
         }
     }}
@@ -91,7 +79,7 @@ pub fn main() {
     check_type!(~"foo": ~str);
     check_type!(~[20, 22]: ~[int]);
     let mint: uint = unsafe { cast::transmute(main) };
-    check_type!(main: extern fn(), |pthing| {
+    check_type!(main: fn(), |pthing| {
         assert!(mint == unsafe { cast::transmute(*pthing) })
     });
 }
diff --git a/src/test/run-pass/recursion.rs b/src/test/run-pass/recursion.rs
deleted file mode 100644 (file)
index d89227a..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test
-
-enum Nil {Nil}
-struct Cons<T> {head:int, tail:T}
-trait Dot {fn dot(other:self) -> int;}
-impl Dot for Nil {
-  fn dot(_:Nil) -> int {0}
-}
-impl<T:Dot> Dot for Cons<T> {
-  fn dot(other:Cons<T>) -> int {
-    self.head * other.head + self.tail.dot(other.tail)
-  }
-}
-fn test<T:Dot> (n:int, i:int, first:T, second:T) ->int {
-  match n {
-    0 => {first.dot(second)}
-      // Error message should be here. It should be a type error
-      // to instantiate `test` at a type other than T. (See #4287)
-    _ => {test (n-1, i+1, Cons {head:2*i+1, tail:first}, Cons{head:i*i, tail:second})}
-  }
-}
-pub fn main() {
-  let n = test(1, 0, Nil, Nil);
-  println!("{}", n);
-}
diff --git a/src/test/run-pass/send-iloop.rs b/src/test/run-pass/send-iloop.rs
deleted file mode 100644 (file)
index 5116dcb..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test linked failure
-extern crate extra;
-
-use std::comm;
-use std::task;
-
-fn die() {
-    fail!();
-}
-
-fn iloop() {
-    task::spawn(|| die() );
-    let (p, c) = comm::stream::<()>();
-    loop {
-        // Sending and receiving here because these actions deschedule,
-        // at which point our child can kill us.
-        c.send(());
-        p.recv();
-        // The above comment no longer makes sense but I'm
-        // reluctant to remove a linked failure test case.
-        task::deschedule();
-    }
-}
-
-pub fn main() {
-    for _ in range(0u, 16u) {
-        task::spawn_unlinked(|| iloop() );
-    }
-}
diff --git a/src/test/run-pass/syntax-extension-minor.rs b/src/test/run-pass/syntax-extension-minor.rs
deleted file mode 100644 (file)
index dcce94d..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test
-// this now fails (correctly, I claim) because hygiene prevents
-// the assembled identifier from being a reference to the binding.
-
-pub fn main() {
-    let asdf_fdsa = ~"<.<";
-    assert_eq!(concat_idents!(asd, f_f, dsa), ~"<.<");
-
-    assert!(stringify!(use_mention_distinction) ==
-                "use_mention_distinction");
-}
diff --git a/src/test/run-pass/task-killjoin-rsrc.rs b/src/test/run-pass/task-killjoin-rsrc.rs
deleted file mode 100644 (file)
index 61af43a..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test linked failure
-
-// A port of task-killjoin to use a class with a dtor to manage
-// the join.
-
-use std::cell::Cell;
-use std::comm::*;
-use std::ptr;
-use std::task;
-
-struct notify {
-    ch: Chan<bool>,
-    v: @Cell<bool>,
-}
-
-#[unsafe_destructor]
-impl Drop for notify {
-    fn drop(&mut self) {
-        unsafe {
-            error!("notify: task=%? v=%x unwinding=%b b=%b",
-                   0,
-                   ptr::to_unsafe_ptr(&(*(self.v))) as uint,
-                   task::failing(),
-                   *(self.v));
-            let b = *(self.v);
-            self.ch.send(b);
-        }
-    }
-}
-
-fn notify(ch: Chan<bool>, v: @Cell<bool>) -> notify {
-    notify {
-        ch: ch,
-        v: v
-    }
-}
-
-fn joinable(f: proc()) -> Port<bool> {
-    fn wrapper(c: Chan<bool>, f: ||) {
-        let b = @Cell::new(false);
-        error!("wrapper: task=%? allocated v=%x",
-               0,
-               ptr::to_unsafe_ptr(&b) as uint);
-        let _r = notify(c, b);
-        f();
-        *b = true;
-    }
-    let (p, c) = stream();
-    task::spawn_unlinked(proc() {
-        let ccc = c;
-        wrapper(ccc, f)
-    });
-    p
-}
-
-fn join(port: Port<bool>) -> bool {
-    port.recv()
-}
-
-fn supervised() {
-    // Deschedule to make sure the supervisor joins before we
-    // fail. This is currently not needed because the supervisor
-    // runs first, but I can imagine that changing.
-    error!("supervised task=%?", 0);
-    task::deschedule();
-    fail!();
-}
-
-fn supervisor() {
-    error!("supervisor task=%?", 0);
-    let t = joinable(supervised);
-    join(t);
-}
-
-pub fn main() {
-    join(joinable(supervisor));
-}
diff --git a/src/test/run-pass/task-killjoin.rs b/src/test/run-pass/task-killjoin.rs
deleted file mode 100644 (file)
index 3d4e091..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test linked failure
-
-// Create a task that is supervised by another task, join the supervised task
-// from the supervising task, then fail the supervised task. The supervised
-// task will kill the supervising task, waking it up. The supervising task no
-// longer needs to be wakened when the supervised task exits.
-
-use std::task;
-
-fn supervised() {
-    // Deschedule to make sure the supervisor joins before we fail. This is
-    // currently not needed because the supervisor runs first, but I can
-    // imagine that changing.
-    task::deschedule();
-    fail!();
-}
-
-fn supervisor() {
-    // Unsupervise this task so the process doesn't return a failure status as
-    // a result of the main task being killed.
-    let f = supervised;
-    task::try(supervised);
-}
-
-pub fn main() {
-    task::spawn_unlinked(supervisor)
-}