Fix/annotate a variety of xfails

This commit is contained in:
Corey Richardson 2013-06-22 14:43:15 -04:00 committed by Daniel Micay
parent e2e39234cc
commit adb8ac4162
34 changed files with 98 additions and 246 deletions

View File

@ -1,6 +1,4 @@
// xfail-test
// xfail'd because of a problem with by-value self.
// xfail-test #5321
// 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.

View File

@ -1,60 +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.
// xfail-test
use to_str::*;
use to_str::to_str;
class cat : to_str {
priv {
let mut meows : uint;
fn meow() {
error!("Meow");
self.meows += 1u;
if self.meows % 5u == 0u {
self.how_hungry += 1;
}
}
}
let mut how_hungry : int;
let name : str;
new(in_x : uint, in_y : int, in_name: str)
{ self.meows = in_x; self.how_hungry = in_y; self.name = in_name; }
fn speak() { self.meow(); }
fn eat() -> bool {
if self.how_hungry > 0 {
error!("OM NOM NOM");
self.how_hungry -= 2;
return true;
}
else {
error!("Not hungry!");
return false;
}
}
fn to_str() -> str { self.name }
}
fn print_out<T:to_str>(thing: T, expected: str) {
let actual = thing.to_str();
debug!("%s", actual);
assert_eq!(actual, expected);
}
pub fn main() {
let nyan : to_str = cat(0u, 2, "nyan") as to_str;
print_out(nyan, "nyan");
}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// xfail-test FIXME #7307
// xfail-fast
extern mod extra;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// xfail-test FIXME #7305
extern mod extra;
use extra::oldmap::*;

View File

@ -1,8 +1,6 @@
// xfail-test
fn sum(x: &[int]) -> int {
let mut sum = 0;
for x.each |y| { sum += *y; }
for x.iter().advance |y| { sum += *y; }
return sum;
}
@ -14,8 +12,10 @@ fn sum_imm(y: &[int]) -> int {
sum(y)
}
/* FIXME #7304
fn sum_const(y: &const [int]) -> int {
sum(y)
}
*/
pub fn main() {}

View File

@ -1,20 +1,20 @@
// xfail-test
/* FIXME #7302
fn foo(v: &const [uint]) -> ~[uint] {
v.to_vec()
v.to_owned()
}
*/
fn bar(v: &mut [uint]) -> ~[uint] {
v.to_vec()
v.to_owned()
}
fn bip(v: &[uint]) -> ~[uint] {
v.to_vec()
v.to_owned()
}
pub fn main() {
let mut the_vec = ~[1, 2, 3, 100];
assert_eq!(the_vec, foo(the_vec));
assert_eq!(the_vec, bar(the_vec));
assert_eq!(the_vec, bip(the_vec));
let mut the_vec = ~[1u, 2, 3, 100];
// assert_eq!(the_vec.clone(), foo(the_vec));
assert_eq!(the_vec.clone(), bar(the_vec));
assert_eq!(the_vec.clone(), bip(the_vec));
}

View File

@ -1,4 +1,4 @@
// xfail-test #7103 `extern mod` does not work on windows
// xfail-fast #7103 `extern mod` does not work on windows
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at

View File

@ -10,7 +10,7 @@
// Just a test that new-style extern mods parse
// xfail-test
// xfail-test FIXME #6407
extern mod test = "github.com/catamorphism/test-pkg";
fn main() {}
fn main() {}

View File

@ -8,12 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
extern mod extra;
use std::sys;
pub fn main() {
// Bare functions should just be a pointer
assert!(sys::rustrt::size_of::<fn()>() ==
sys::rustrt::size_of::<int>());
assert_eq!(sys::size_of::<extern "Rust" fn()>(), sys::size_of::<int>());
}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// xfail-test FIXME #7308
// -*- rust -*-
native mod libc = target_libc {

View File

@ -8,10 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// xfail-test FIXME #1866
mod a {
pub type rust_task = uint;
pub mod rustrt {
use super::rust_task;
pub extern {
pub fn rust_task_is_unwinding(rt: *rust_task) -> bool;
}
@ -21,6 +22,7 @@ mod a {
mod b {
pub type rust_task = bool;
pub mod rustrt {
use super::rust_task;
pub extern {
pub fn rust_task_is_unwinding(rt: *rust_task) -> bool;
}

View File

@ -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.
// xfail-test
extern mod extra;
use extra::arena;
use extra::arena::Arena;
enum hold { s(str) }
fn init(ar: &a.arena::Arena, str: str) -> &a.hold {
new(*ar) s(str)
}
pub fn main(args: ~[str]) {
let ar = arena::Arena();
let leak = init(&ar, args[0]);
match *leak {
s(astr) {
io::println(fmt!("%?", astr));
}
};
}

View File

@ -8,23 +8,23 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// xfail-test FIXME #2190
mod a {
fn foo(f: &fn()) { f() }
fn bar() {}
pub fn main() { foo(||bar()); }
fn foo(f: &fn()) { f() }
fn bar() {}
pub fn main() { foo(||bar()); }
}
mod b {
fn foo(f: Option<&fn()>) { f.iter(|x|x()) }
fn bar() {}
pub fn main() { foo(Some(bar)); }
fn foo(f: Option<&fn()>) { f.iter(|x|x()) }
fn bar() {}
pub fn main() { foo(Some(bar)); }
}
mod c {
fn foo(f: Option<&fn()>) { f.iter(|x|x()) }
fn bar() {}
pub fn main() { foo(Some(||bar())); }
fn foo(f: Option<&fn()>) { f.iter(|x|x()) }
fn bar() {}
pub fn main() { foo(Some(||bar())); }
}
pub fn main() {

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// xfail-test FIXME #3290
fn main() {
let mut x = ~3;
x = x;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// xfail-test FIXME #3796
#[deny(dead_assignment)];
fn main() {
let mut x = 1;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// xfail-test FIXME #3874
enum PureCounter { PureCounter(uint) }
fn each(self: PureCounter, blk: &fn(v: &uint)) {

View File

@ -9,16 +9,17 @@
// except according to those terms.
// xfail-test
trait A {
fn a_method();
fn a_method(&self);
}
trait B: A {
fn b_method();
fn b_method(&self);
}
trait C: B {
fn c_method() {
fn c_method(&self) {
self.a_method();
}
}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// xfail-test FIXME #5946
trait Positioned<S> {
fn SetX(&mut self, S);
fn X(&self) -> S;

View File

@ -8,11 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
extern mod extra;
use extra::net::tcp::TcpSocketBuf;
use std::io;
use std::int;
use std::io::{ReaderUtil,WriterUtil};
enum Result {
@ -97,9 +99,9 @@ priv fn cmd_to_str(cmd: ~[~str]) -> ~str {
let mut res = ~"*";
res.push_str(cmd.len().to_str());
res.push_str("\r\n");
for cmd.each |s| {
for cmd.iter().advance |s| {
res.push_str([~"$", s.len().to_str(), ~"\r\n",
copy *s, ~"\r\n"].concat()));
copy *s, ~"\r\n"].concat() );
}
res
}

View File

@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
use std::io;
fn parse_args() -> ~str {
let args = std::os::args();
let mut n = 0;

View File

@ -8,9 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
use std::os;
pub fn main() {
for os::args().each |arg| {
let x = os::args();
for x.iter().advance |arg| {
match arg.clone() {
s => { }
}

View File

@ -1,5 +1,3 @@
// xfail-test
// 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.
@ -10,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// aux-build:issue_3882.rc
extern mod linenoise;
use linenoise::issue_3882::*;

View File

@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-fast
// xfail-test
pub fn main() {
'foo: loop {
loop {

View File

@ -1,6 +1,8 @@
// xfail-test
// FIXME #7306
// xfail-fast
// -*- rust -*-
use std::io;
fn f1(ref_string: &str) {
match ref_string {
"a" => io::println("found a"),

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// FIXME #7303: xfail-test
// Protocols
proto! foo (

View File

@ -11,23 +11,30 @@
// xfail-test
// This checks that preemption works.
fn starve_main(alive: chan<int>) {
// note: halfway done porting to modern rust
extern mod extra;
use std::comm;
use extra::comm;
fn starve_main(alive: Port<int>) {
debug!("signalling main");
alive.recv(1);
alive.recv();
debug!("starving main");
let i: int = 0;
let mut i: int = 0;
loop { i += 1; }
}
pub fn main() {
let alive: port<int> = port();
let (port, chan) = stream();
debug!("main started");
let s: task = do task::spawn {
starve_main(chan(alive));
do spawn {
starve_main(port);
};
let i: int;
let mut i: int = 0;
debug!("main waiting for alive signal");
alive.send(i);
chan.send(i);
debug!("main got alive signal");
while i < 50 { debug!("main iterated"); i += 1; }
debug!("main completed");

View File

@ -1,6 +1,3 @@
// xfail-test
// xfail'd due to segfaults with by-value self.
// 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.
@ -15,26 +12,24 @@ trait get {
fn get(self) -> int;
}
// Note: impl on a slice
impl get for &'self int {
// FIXME #7302: Note: impl on a slice
impl<'self> get for &'self int {
fn get(self) -> int {
return **self;
return *self;
}
}
pub fn main() {
/*
let x = @mut 6;
let y = x.get();
assert_eq!(y, 6);
*/
let x = @6;
let y = x.get();
debug!("y=%d", y);
assert_eq!(y, 6);
let mut x = ~6;
let x = ~6;
let y = x.get();
debug!("y=%d", y);
assert_eq!(y, 6);

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
fn foo(x: &[uint]) -> uint {
x[0]
}

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
static foo: int = 4 >> 1;
enum bs { thing = foo }
pub fn main() { assert!((thing as int == foo)); }

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
use std::ptr;
enum a_tag<A,B> {
varA(A),

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
use std::ptr;
enum a_tag {
a_tag(u64)

View File

@ -1,4 +1,4 @@
// xfail-test
// xfail-test FIXME #5882
// Weird borrow check bug
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
@ -17,45 +17,45 @@ struct Tree(@mut TreeR);
struct TreeR {
left: Option<Tree>,
right: Option<Tree>,
val: to_str
val: ~to_str
}
trait to_str {
fn to_str(&self) -> ~str;
fn to_str_(&self) -> ~str;
}
impl<T:to_str> to_str for Option<T> {
fn to_str(&self) -> ~str {
fn to_str_(&self) -> ~str {
match *self {
None => { ~"none" }
Some(ref t) => { ~"some(" + t.to_str() + ~")" }
Some(ref t) => { ~"some(" + t.to_str_() + ~")" }
}
}
}
impl to_str for int {
fn to_str(&self) -> ~str { int::str(*self) }
fn to_str_(&self) -> ~str { self.to_str() }
}
impl to_str for Tree {
fn to_str(&self) -> ~str {
let l = self.left, r = self.right;
fn to_str_(&self) -> ~str {
let (l, r) = (self.left, self.right);
let val = &self.val;
fmt!("[%s, %s, %s]", val.to_str(), l.to_str(), r.to_str())
fmt!("[%s, %s, %s]", val.to_str_(), l.to_str_(), r.to_str_())
}
}
fn foo<T:to_str>(x: T) -> ~str { x.to_str() }
fn foo<T:to_str>(x: T) -> ~str { x.to_str_() }
pub fn main() {
let t1 = Tree(@mut TreeR{left: None,
right: None,
val: 1 as to_str });
val: ~1 as ~to_str });
let t2 = Tree(@mut TreeR{left: Some(t1),
right: Some(t1),
val: 2 as to_str });
val: ~2 as ~to_str });
let expected = ~"[2, some([1, none, none]), some([1, none, none])]";
assert_eq!(t2.to_str(), expected);
assert_eq!(foo(t2 as to_str), expected);
assert!(t2.to_str_() == expected);
assert!(foo(t2) == expected);
t1.left = Some(t2); // create cycle
}

View File

@ -1,55 +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.
//xfail-test
// Sketching traits.
// methods with no implementation are required; methods with an
// implementation are provided. No "req" keyword necessary.
trait Eq {
fn eq(a: self) -> bool;
fn neq(a: self) -> bool {
!self.eq(a)
}
}
// The `<` is pronounced `extends`. Also under consideration is `<:`.
// Just using `:` is frowned upon, because (paraphrasing dherman) `:`
// is supposed to separate things from different universes.
trait Ord < Eq {
fn lt(a: self) -> bool;
fn lte(a: self) -> bool {
self.lt(a) || self.eq(a)
}
fn gt(a: self) -> bool {
!self.lt(a) && !self.eq(a)
}
fn gte(a: self) -> bool {
!self.lt(a)
}
}
// pronounced "impl of Ord for int" -- not sold on this yet
impl Ord for int {
fn lt(a: &int) -> bool {
self < (*a)
}
// is this the place to put this?
fn eq(a: &int) -> bool {
self == (*a)
}
}

View File

@ -8,15 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
// See #3283
fn foo(blk: &fn(p: &'a fn() -> &'a fn())) {
let mut state = 0;
let statep = &mut state;
fn foo<'a>(blk: &fn(p: &'a fn() -> &'a fn())) {
let mut state = 0;
let statep = &mut state;
do blk {
|| { *statep = 1; }
}
}
fn main() {
do foo |p| { p()() }
}
}