diff --git a/src/test/run-pass/autoderef-method-priority.rs b/src/test/run-pass/autoderef-method-priority.rs index 9cfdac0a330..0fe30059ef6 100644 --- a/src/test/run-pass/autoderef-method-priority.rs +++ b/src/test/run-pass/autoderef-method-priority.rs @@ -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. diff --git a/src/test/run-pass/class-cast-to-trait-cross-crate.rs b/src/test/run-pass/class-cast-to-trait-cross-crate.rs deleted file mode 100644 index 6674147e147..00000000000 --- a/src/test/run-pass/class-cast-to-trait-cross-crate.rs +++ /dev/null @@ -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 or the MIT license -// , 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(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"); -} diff --git a/src/test/run-pass/class-impl-parameterized-trait.rs b/src/test/run-pass/class-impl-parameterized-trait.rs index 09967f0ab36..655a9d4a0c0 100644 --- a/src/test/run-pass/class-impl-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-parameterized-trait.rs @@ -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; diff --git a/src/test/run-pass/class-implements-multiple-traits.rs b/src/test/run-pass/class-implements-multiple-traits.rs index 7a3045db91f..8565ab03841 100644 --- a/src/test/run-pass/class-implements-multiple-traits.rs +++ b/src/test/run-pass/class-implements-multiple-traits.rs @@ -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::*; diff --git a/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs b/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs index 3f12c0d6353..f0c5b58d155 100644 --- a/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs +++ b/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs @@ -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() {} diff --git a/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs b/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs index 7ab80920849..590cd825020 100644 --- a/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs +++ b/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs @@ -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)); } diff --git a/src/test/run-pass/deriving-global.rs b/src/test/run-pass/deriving-global.rs index 3d5bacee71c..409c31f1fa5 100644 --- a/src/test/run-pass/deriving-global.rs +++ b/src/test/run-pass/deriving-global.rs @@ -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 diff --git a/src/test/run-pass/extern-mod-url.rs b/src/test/run-pass/extern-mod-url.rs index 457c61067e3..363c54f6812 100644 --- a/src/test/run-pass/extern-mod-url.rs +++ b/src/test/run-pass/extern-mod-url.rs @@ -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() {} \ No newline at end of file +fn main() {} diff --git a/src/test/run-pass/fn-bare-size.rs b/src/test/run-pass/fn-bare-size.rs index dc47dda420c..144cc7c1e28 100644 --- a/src/test/run-pass/fn-bare-size.rs +++ b/src/test/run-pass/fn-bare-size.rs @@ -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::() == - sys::rustrt::size_of::()); + assert_eq!(sys::size_of::(), sys::size_of::()); } diff --git a/src/test/run-pass/foreign-mod.rc b/src/test/run-pass/foreign-mod.rc index 390de827657..a11e89f37be 100644 --- a/src/test/run-pass/foreign-mod.rc +++ b/src/test/run-pass/foreign-mod.rc @@ -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 { diff --git a/src/test/run-pass/issue-1866.rs b/src/test/run-pass/issue-1866.rs index cb5e9b11166..530f40c6a83 100644 --- a/src/test/run-pass/issue-1866.rs +++ b/src/test/run-pass/issue-1866.rs @@ -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; } diff --git a/src/test/run-pass/issue-2101.rs b/src/test/run-pass/issue-2101.rs deleted file mode 100644 index 423888c1cf5..00000000000 --- a/src/test/run-pass/issue-2101.rs +++ /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 or the MIT license -// , 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)); - } - }; -} diff --git a/src/test/run-pass/issue-2190-2.rs b/src/test/run-pass/issue-2190-2.rs index 3842e073faf..d5ee712d412 100644 --- a/src/test/run-pass/issue-2190-2.rs +++ b/src/test/run-pass/issue-2190-2.rs @@ -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() { diff --git a/src/test/run-pass/issue-3290.rs b/src/test/run-pass/issue-3290.rs index 3f8ce032d0d..5cdc4238eaf 100644 --- a/src/test/run-pass/issue-3290.rs +++ b/src/test/run-pass/issue-3290.rs @@ -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; diff --git a/src/test/run-pass/issue-3796.rs b/src/test/run-pass/issue-3796.rs index 0091c096255..5f440939139 100644 --- a/src/test/run-pass/issue-3796.rs +++ b/src/test/run-pass/issue-3796.rs @@ -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; diff --git a/src/test/run-pass/issue-3874.rs b/src/test/run-pass/issue-3874.rs index f54d2f9fafc..e293e40ac69 100644 --- a/src/test/run-pass/issue-3874.rs +++ b/src/test/run-pass/issue-3874.rs @@ -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)) { diff --git a/src/test/run-pass/issue-3979-2.rs b/src/test/run-pass/issue-3979-2.rs index a04e3510802..9a8b90db185 100644 --- a/src/test/run-pass/issue-3979-2.rs +++ b/src/test/run-pass/issue-3979-2.rs @@ -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(); } } diff --git a/src/test/run-pass/issue-3979-generics.rs b/src/test/run-pass/issue-3979-generics.rs index b91ec5711cf..5884a35a1a1 100644 --- a/src/test/run-pass/issue-3979-generics.rs +++ b/src/test/run-pass/issue-3979-generics.rs @@ -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 { fn SetX(&mut self, S); fn X(&self) -> S; diff --git a/src/test/run-pass/issue-4241.rs b/src/test/run-pass/issue-4241.rs index 23e5f3945b1..720ce7a2c27 100644 --- a/src/test/run-pass/issue-4241.rs +++ b/src/test/run-pass/issue-4241.rs @@ -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 } diff --git a/src/test/run-pass/issue-4541.rs b/src/test/run-pass/issue-4541.rs index 24a8adfcb1a..4d59ea0fba3 100644 --- a/src/test/run-pass/issue-4541.rs +++ b/src/test/run-pass/issue-4541.rs @@ -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; diff --git a/src/test/run-pass/issue-4542.rs b/src/test/run-pass/issue-4542.rs index a5e5b10d076..4aa83b853de 100644 --- a/src/test/run-pass/issue-4542.rs +++ b/src/test/run-pass/issue-4542.rs @@ -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 => { } } diff --git a/src/test/run-pass/issue_3882.rs b/src/test/run-pass/issue_3882.rs index 7b1af0d151f..202385681ce 100644 --- a/src/test/run-pass/issue_3882.rs +++ b/src/test/run-pass/issue_3882.rs @@ -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::*; diff --git a/src/test/run-pass/labeled-break.rs b/src/test/run-pass/labeled-break.rs index 32cd7f0c7f8..b6b6e0e1437 100644 --- a/src/test/run-pass/labeled-break.rs +++ b/src/test/run-pass/labeled-break.rs @@ -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 { diff --git a/src/test/run-pass/match-borrowed_str.rs b/src/test/run-pass/match-borrowed_str.rs index 1a58174a3fb..99e1ae6ec56 100644 --- a/src/test/run-pass/match-borrowed_str.rs +++ b/src/test/run-pass/match-borrowed_str.rs @@ -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"), diff --git a/src/test/run-pass/pipe-select-macro.rs b/src/test/run-pass/pipe-select-macro.rs index a77e6acbb25..2db66054145 100644 --- a/src/test/run-pass/pipe-select-macro.rs +++ b/src/test/run-pass/pipe-select-macro.rs @@ -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 ( diff --git a/src/test/run-pass/preempt.rs b/src/test/run-pass/preempt.rs index 3d3e178f064..aa750c21d45 100644 --- a/src/test/run-pass/preempt.rs +++ b/src/test/run-pass/preempt.rs @@ -11,23 +11,30 @@ // xfail-test // This checks that preemption works. -fn starve_main(alive: chan) { +// note: halfway done porting to modern rust +extern mod extra; + +use std::comm; +use extra::comm; + +fn starve_main(alive: Port) { 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 = 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"); diff --git a/src/test/run-pass/rcvr-borrowed-to-region.rs b/src/test/run-pass/rcvr-borrowed-to-region.rs index fbd7d851fa3..c8e87af9ec0 100644 --- a/src/test/run-pass/rcvr-borrowed-to-region.rs +++ b/src/test/run-pass/rcvr-borrowed-to-region.rs @@ -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); diff --git a/src/test/run-pass/regions-borrow-evec-at.rs b/src/test/run-pass/regions-borrow-evec-at.rs index a018dad64b3..45e5b1ad9c9 100644 --- a/src/test/run-pass/regions-borrow-evec-at.rs +++ b/src/test/run-pass/regions-borrow-evec-at.rs @@ -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] } diff --git a/src/test/run-pass/resolve-issue-2428.rs b/src/test/run-pass/resolve-issue-2428.rs index 6d00210898b..57f6596d1d7 100644 --- a/src/test/run-pass/resolve-issue-2428.rs +++ b/src/test/run-pass/resolve-issue-2428.rs @@ -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)); } diff --git a/src/test/run-pass/tag-align-dyn-variants.rs b/src/test/run-pass/tag-align-dyn-variants.rs index cd94bd30c21..c360b613455 100644 --- a/src/test/run-pass/tag-align-dyn-variants.rs +++ b/src/test/run-pass/tag-align-dyn-variants.rs @@ -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 { varA(A), diff --git a/src/test/run-pass/tag-align-u64.rs b/src/test/run-pass/tag-align-u64.rs index ea60f389663..776c7d9ca44 100644 --- a/src/test/run-pass/tag-align-u64.rs +++ b/src/test/run-pass/tag-align-u64.rs @@ -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) diff --git a/src/test/run-pass/trait-cast.rs b/src/test/run-pass/trait-cast.rs index f21ea06697d..637fc7a70f5 100644 --- a/src/test/run-pass/trait-cast.rs +++ b/src/test/run-pass/trait-cast.rs @@ -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, right: Option, - val: to_str + val: ~to_str } trait to_str { - fn to_str(&self) -> ~str; + fn to_str_(&self) -> ~str; } impl to_str for Option { - 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(x: T) -> ~str { x.to_str() } +fn foo(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 } diff --git a/src/test/run-pass/traits.rs b/src/test/run-pass/traits.rs deleted file mode 100644 index ba3e8e082b3..00000000000 --- a/src/test/run-pass/traits.rs +++ /dev/null @@ -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 or the MIT license -// , 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) - } -} diff --git a/src/test/run-pass/unconstrained-region.rs b/src/test/run-pass/unconstrained-region.rs index b6e2ba553df..4882baceaa8 100644 --- a/src/test/run-pass/unconstrained-region.rs +++ b/src/test/run-pass/unconstrained-region.rs @@ -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()() } -} \ No newline at end of file +}