diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-03-22 11:23:21 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-03-22 12:57:28 -0700 |
| commit | 3eda11a4f79103a7f6d73c38e5e4f0880e26cc3c (patch) | |
| tree | 0a0175a52524bf5812b0185adc52743fa706bbc7 | |
| parent | fbe22afdbe4d1b612ba722551ba1c099e7f3e0b0 (diff) | |
| download | rust-3eda11a4f79103a7f6d73c38e5e4f0880e26cc3c.tar.gz rust-3eda11a4f79103a7f6d73c38e5e4f0880e26cc3c.zip | |
test: Remove `pure` from the test suite
62 files changed, 153 insertions, 158 deletions
diff --git a/src/test/auxiliary/cci_class_cast.rs b/src/test/auxiliary/cci_class_cast.rs index 5006c72ad15..edda0644b16 100644 --- a/src/test/auxiliary/cci_class_cast.rs +++ b/src/test/auxiliary/cci_class_cast.rs @@ -18,7 +18,7 @@ pub mod kitty { } impl ToStr for cat { - pure fn to_str(&self) -> ~str { copy self.name } + fn to_str(&self) -> ~str { copy self.name } } priv impl cat { diff --git a/src/test/auxiliary/crateresolve5-1.rs b/src/test/auxiliary/crateresolve5-1.rs index 01c2dccb7b9..c120a971c6b 100644 --- a/src/test/auxiliary/crateresolve5-1.rs +++ b/src/test/auxiliary/crateresolve5-1.rs @@ -25,11 +25,11 @@ pub enum e { pub fn nominal() -> e { e_val } -pub pure fn nominal_eq(e1: e, e2: e) -> bool { true } +pub fn nominal_eq(e1: e, e2: e) -> bool { true } impl Eq for e { - pure fn eq(&self, other: &e) -> bool { nominal_eq(*self, *other) } - pure fn ne(&self, other: &e) -> bool { !nominal_eq(*self, *other) } + fn eq(&self, other: &e) -> bool { nominal_eq(*self, *other) } + fn ne(&self, other: &e) -> bool { !nominal_eq(*self, *other) } } pub fn f() -> int { 10 } diff --git a/src/test/auxiliary/crateresolve5-2.rs b/src/test/auxiliary/crateresolve5-2.rs index 328b9aa0ecb..230fdad0468 100644 --- a/src/test/auxiliary/crateresolve5-2.rs +++ b/src/test/auxiliary/crateresolve5-2.rs @@ -23,12 +23,12 @@ pub enum e { } impl Eq for e { - pure fn eq(&self, other: &e) -> bool { !nominal_neq(*self, *other) } - pure fn ne(&self, other: &e) -> bool { nominal_neq(*self, *other) } + fn eq(&self, other: &e) -> bool { !nominal_neq(*self, *other) } + fn ne(&self, other: &e) -> bool { nominal_neq(*self, *other) } } pub fn nominal() -> e { e_val } -pub pure fn nominal_neq(e1: e, e2: e) -> bool { false } +pub fn nominal_neq(e1: e, e2: e) -> bool { false } pub fn f() -> int { 20 } diff --git a/src/test/auxiliary/impl_privacy_xc_2.rs b/src/test/auxiliary/impl_privacy_xc_2.rs index d8c2a9ede5c..0fa15fa14f6 100644 --- a/src/test/auxiliary/impl_privacy_xc_2.rs +++ b/src/test/auxiliary/impl_privacy_xc_2.rs @@ -7,8 +7,8 @@ pub struct Fish { mod unexported { use super::Fish; impl Eq for Fish { - pure fn eq(&self, _: &Fish) -> bool { true } - pure fn ne(&self, _: &Fish) -> bool { false } + fn eq(&self, _: &Fish) -> bool { true } + fn ne(&self, _: &Fish) -> bool { false } } } diff --git a/src/test/auxiliary/static_fn_trait_xc_aux.rs b/src/test/auxiliary/static_fn_trait_xc_aux.rs index f3cb9a22625..cc03ac38943 100644 --- a/src/test/auxiliary/static_fn_trait_xc_aux.rs +++ b/src/test/auxiliary/static_fn_trait_xc_aux.rs @@ -1,11 +1,11 @@ pub mod num { pub trait Num2 { - pure fn from_int2(n: int) -> Self; + fn from_int2(n: int) -> Self; } } pub mod float { impl ::num::Num2 for float { - pure fn from_int2(n: int) -> float { return n as float; } + fn from_int2(n: int) -> float { return n as float; } } } diff --git a/src/test/auxiliary/trait_inheritance_overloading_xc.rs b/src/test/auxiliary/trait_inheritance_overloading_xc.rs index e86f7cfd26a..1b480ff17b3 100644 --- a/src/test/auxiliary/trait_inheritance_overloading_xc.rs +++ b/src/test/auxiliary/trait_inheritance_overloading_xc.rs @@ -18,24 +18,24 @@ pub struct MyInt { } impl Add<MyInt, MyInt> for MyInt { - pure fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) } + fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) } } impl Sub<MyInt, MyInt> for MyInt { - pure fn sub(&self, other: &MyInt) -> MyInt { mi(self.val - other.val) } + fn sub(&self, other: &MyInt) -> MyInt { mi(self.val - other.val) } } impl Mul<MyInt, MyInt> for MyInt { - pure fn mul(&self, other: &MyInt) -> MyInt { mi(self.val * other.val) } + fn mul(&self, other: &MyInt) -> MyInt { mi(self.val * other.val) } } impl Eq for MyInt { - pure fn eq(&self, other: &MyInt) -> bool { self.val == other.val } + fn eq(&self, other: &MyInt) -> bool { self.val == other.val } - pure fn ne(&self, other: &MyInt) -> bool { !self.eq(other) } + fn ne(&self, other: &MyInt) -> bool { !self.eq(other) } } impl MyNum for MyInt; -pure fn mi(v: int) -> MyInt { MyInt { val: v } } +fn mi(v: int) -> MyInt { MyInt { val: v } } diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index fc980e3d6db..f0847b635b4 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -27,14 +27,14 @@ fn sort_and_fmt(mm: HashMap<~[u8], uint>, total: uint) -> ~str { return (xx as float) * 100f / (yy as float); } - pure fn le_by_val<TT:Copy,UU:Copy + Ord>(kv0: &(TT,UU), + fn le_by_val<TT:Copy,UU:Copy + Ord>(kv0: &(TT,UU), kv1: &(TT,UU)) -> bool { let (_, v0) = *kv0; let (_, v1) = *kv1; return v0 >= v1; } - pure fn le_by_key<TT:Copy + Ord,UU:Copy>(kv0: &(TT,UU), + fn le_by_key<TT:Copy + Ord,UU:Copy>(kv0: &(TT,UU), kv1: &(TT,UU)) -> bool { let (k0, _) = *kv0; let (k1, _) = *kv1; diff --git a/src/test/bench/shootout-mandelbrot.rs b/src/test/bench/shootout-mandelbrot.rs index eeea62d50fb..ada5ff7be2f 100644 --- a/src/test/bench/shootout-mandelbrot.rs +++ b/src/test/bench/shootout-mandelbrot.rs @@ -33,7 +33,7 @@ struct cmplx { } impl ops::Mul<cmplx,cmplx> for cmplx { - pure fn mul(&self, x: &cmplx) -> cmplx { + fn mul(&self, x: &cmplx) -> cmplx { cmplx { re: self.re*(*x).re - self.im*(*x).im, im: self.re*(*x).im + self.im*(*x).re @@ -42,7 +42,7 @@ impl ops::Mul<cmplx,cmplx> for cmplx { } impl ops::Add<cmplx,cmplx> for cmplx { - pure fn add(&self, x: &cmplx) -> cmplx { + fn add(&self, x: &cmplx) -> cmplx { cmplx { re: self.re + (*x).re, im: self.im + (*x).im @@ -52,7 +52,7 @@ impl ops::Add<cmplx,cmplx> for cmplx { struct Line {i: uint, b: ~[u8]} -pure fn cabs(x: cmplx) -> f64 +fn cabs(x: cmplx) -> f64 { x.re*x.re + x.im*x.im } diff --git a/src/test/compile-fail/auto-ref-slice-plus-ref.rs b/src/test/compile-fail/auto-ref-slice-plus-ref.rs index 7faee6f7ea2..609e8de87d6 100644 --- a/src/test/compile-fail/auto-ref-slice-plus-ref.rs +++ b/src/test/compile-fail/auto-ref-slice-plus-ref.rs @@ -20,9 +20,9 @@ fn main() { } trait MyIter { - pure fn test_mut(&mut self); + fn test_mut(&mut self); } impl MyIter for &'self [int] { - pure fn test_mut(&mut self) { } + fn test_mut(&mut self) { } } diff --git a/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs b/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs index ece9ae7e861..482d1b6b8b6 100644 --- a/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs +++ b/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs @@ -13,7 +13,7 @@ struct foo(~uint); impl Add<foo, foo> for foo { - pure fn add(f: &foo) -> foo { + fn add(f: &foo) -> foo { foo(~(**self + **(*f))) } } diff --git a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs index 23debb4c5e2..a4ad7e69b33 100644 --- a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs +++ b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs @@ -14,7 +14,7 @@ struct Point { } impl ops::Add<int,int> for Point { - pure fn add(&self, z: &int) -> int { + fn add(&self, z: &int) -> int { self.x + self.y + (*z) } } diff --git a/src/test/compile-fail/borrowck-loan-rcvr.rs b/src/test/compile-fail/borrowck-loan-rcvr.rs index 4a7228dcca3..4473574926a 100644 --- a/src/test/compile-fail/borrowck-loan-rcvr.rs +++ b/src/test/compile-fail/borrowck-loan-rcvr.rs @@ -13,7 +13,7 @@ struct point { x: int, y: int } trait methods { fn impurem(&self); fn blockm(&self, f: &fn()); - pure fn purem(&self); + fn purem(&self); } impl methods for point { @@ -22,7 +22,7 @@ impl methods for point { fn blockm(&self, f: &fn()) { f() } - pure fn purem(&self) { + fn purem(&self) { } } diff --git a/src/test/compile-fail/issue-3344.rs b/src/test/compile-fail/issue-3344.rs index df768860cba..e931a8fa7e1 100644 --- a/src/test/compile-fail/issue-3344.rs +++ b/src/test/compile-fail/issue-3344.rs @@ -10,8 +10,8 @@ struct thing(uint); impl cmp::Ord for thing { //~ ERROR missing method `gt` - pure fn lt(&self, other: &thing) -> bool { **self < **other } - pure fn le(&self, other: &thing) -> bool { **self < **other } - pure fn ge(&self, other: &thing) -> bool { **self < **other } + fn lt(&self, other: &thing) -> bool { **self < **other } + fn le(&self, other: &thing) -> bool { **self < **other } + fn ge(&self, other: &thing) -> bool { **self < **other } } fn main() {} diff --git a/src/test/compile-fail/issue-3707.rs b/src/test/compile-fail/issue-3707.rs index ad5fa16f98c..2c8f94c4695 100644 --- a/src/test/compile-fail/issue-3707.rs +++ b/src/test/compile-fail/issue-3707.rs @@ -14,10 +14,10 @@ struct Obj { } pub impl Obj { - pure fn boom() -> bool { + fn boom() -> bool { return 1+1 == 2 } - pure fn chirp() { + fn chirp() { self.boom(); //~ ERROR wat } } diff --git a/src/test/compile-fail/issue-3820.rs b/src/test/compile-fail/issue-3820.rs index 3a726d270ff..68c00494b9b 100644 --- a/src/test/compile-fail/issue-3820.rs +++ b/src/test/compile-fail/issue-3820.rs @@ -14,7 +14,7 @@ struct Thing { } impl Mul<int, Thing>*/ for Thing/* { //~ ERROR Look ma, no Mul! - pure fn mul(c: &int) -> Thing { + fn mul(c: &int) -> Thing { Thing {x: self.x * *c} } } diff --git a/src/test/compile-fail/issue-3953.rs b/src/test/compile-fail/issue-3953.rs index bfc17c589db..b726f090e7d 100644 --- a/src/test/compile-fail/issue-3953.rs +++ b/src/test/compile-fail/issue-3953.rs @@ -25,8 +25,8 @@ struct Lol(int); impl Hahaha for Lol { } impl Eq for Lol { - pure fn eq(&self, other: &Lol) -> bool { **self != **other } - pure fn ne(&self, other: &Lol) -> bool { **self == **other } + fn eq(&self, other: &Lol) -> bool { **self != **other } + fn ne(&self, other: &Lol) -> bool { **self == **other } } fn main() { diff --git a/src/test/compile-fail/issue-3973.rs b/src/test/compile-fail/issue-3973.rs index 15107ccd51c..b1d741f9186 100644 --- a/src/test/compile-fail/issue-3973.rs +++ b/src/test/compile-fail/issue-3973.rs @@ -20,7 +20,7 @@ impl ToStr for Point { //~ ERROR implements a method not defined in the trait Point { x: x, y: y } } - pure fn to_str(&self) -> ~str { + fn to_str(&self) -> ~str { fmt!("(%f, %f)", self.x, self.y) } } diff --git a/src/test/compile-fail/missing-derivable-attr.rs b/src/test/compile-fail/missing-derivable-attr.rs index 057e6dbc068..67cf67bfa5a 100644 --- a/src/test/compile-fail/missing-derivable-attr.rs +++ b/src/test/compile-fail/missing-derivable-attr.rs @@ -9,7 +9,7 @@ // except according to those terms. trait MyEq { - pure fn eq(&self, other: &Self) -> bool; + fn eq(&self, other: &Self) -> bool; } struct A { @@ -17,7 +17,7 @@ struct A { } impl MyEq for int { - pure fn eq(&self, other: &int) -> bool { *self == *other } + fn eq(&self, other: &int) -> bool { *self == *other } } impl MyEq for A; //~ ERROR missing method diff --git a/src/test/run-fail/die-macro-pure.rs b/src/test/run-fail/die-macro-pure.rs index 4479c2ecbeb..296fba2ae9b 100644 --- a/src/test/run-fail/die-macro-pure.rs +++ b/src/test/run-fail/die-macro-pure.rs @@ -1,6 +1,6 @@ // error-pattern:test -pure fn f() { +fn f() { fail!(~"test"); } diff --git a/src/test/run-fail/if-check-fail.rs b/src/test/run-fail/if-check-fail.rs index a3831a10874..a77d520b07e 100644 --- a/src/test/run-fail/if-check-fail.rs +++ b/src/test/run-fail/if-check-fail.rs @@ -9,7 +9,7 @@ // except according to those terms. // error-pattern:Number is odd -pure fn even(x: uint) -> bool { +fn even(x: uint) -> bool { if x < 2u { return false; } else if x == 2u { return true; } else { return even(x - 2u); } diff --git a/src/test/run-pass/auto-encode.rs b/src/test/run-pass/auto-encode.rs index 7538892f038..1a8ad446c79 100644 --- a/src/test/run-pass/auto-encode.rs +++ b/src/test/run-pass/auto-encode.rs @@ -60,7 +60,7 @@ enum Expr { } impl cmp::Eq for Expr { - pure fn eq(&self, other: &Expr) -> bool { + fn eq(&self, other: &Expr) -> bool { match *self { Val(e0a) => { match *other { @@ -82,18 +82,18 @@ impl cmp::Eq for Expr { } } } - pure fn ne(&self, other: &Expr) -> bool { !(*self).eq(other) } + fn ne(&self, other: &Expr) -> bool { !(*self).eq(other) } } impl cmp::Eq for Point { - pure fn eq(&self, other: &Point) -> bool { + fn eq(&self, other: &Point) -> bool { self.x == other.x && self.y == other.y } - pure fn ne(&self, other: &Point) -> bool { !(*self).eq(other) } + fn ne(&self, other: &Point) -> bool { !(*self).eq(other) } } impl<T:cmp::Eq> cmp::Eq for Quark<T> { - pure fn eq(&self, other: &Quark<T>) -> bool { + fn eq(&self, other: &Quark<T>) -> bool { match *self { Top(ref q) => { match *other { @@ -109,14 +109,14 @@ impl<T:cmp::Eq> cmp::Eq for Quark<T> { }, } } - pure fn ne(&self, other: &Quark<T>) -> bool { !(*self).eq(other) } + fn ne(&self, other: &Quark<T>) -> bool { !(*self).eq(other) } } impl cmp::Eq for CLike { - pure fn eq(&self, other: &CLike) -> bool { + fn eq(&self, other: &CLike) -> bool { (*self) as int == *other as int } - pure fn ne(&self, other: &CLike) -> bool { !self.eq(other) } + fn ne(&self, other: &CLike) -> bool { !self.eq(other) } } #[auto_encode] diff --git a/src/test/run-pass/auto-ref-slice-plus-ref.rs b/src/test/run-pass/auto-ref-slice-plus-ref.rs index 39fe34bfe52..65366a350ef 100644 --- a/src/test/run-pass/auto-ref-slice-plus-ref.rs +++ b/src/test/run-pass/auto-ref-slice-plus-ref.rs @@ -12,18 +12,18 @@ // and also references them to create the &self pointer trait MyIter { - pure fn test_imm(&self); - pure fn test_const(&const self); + fn test_imm(&self); + fn test_const(&const self); } impl MyIter for &'self [int] { - pure fn test_imm(&self) { fail_unless!(self[0] == 1) } - pure fn test_const(&const self) { fail_unless!(self[0] == 1) } + fn test_imm(&self) { fail_unless!(self[0] == 1) } + fn test_const(&const self) { fail_unless!(self[0] == 1) } } impl MyIter for &'self str { - pure fn test_imm(&self) { fail_unless!(*self == "test") } - pure fn test_const(&const self) { fail_unless!(*self == "test") } + fn test_imm(&self) { fail_unless!(*self == "test") } + fn test_const(&const self) { fail_unless!(*self == "test") } } pub fn main() { diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index a82db7b1be3..40dd1a46574 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -16,10 +16,10 @@ use core::iter::BaseIter; enum cat_type { tuxedo, tabby, tortoiseshell } impl cmp::Eq for cat_type { - pure fn eq(&self, other: &cat_type) -> bool { + fn eq(&self, other: &cat_type) -> bool { ((*self) as uint) == ((*other) as uint) } - pure fn ne(&self, other: &cat_type) -> bool { !(*self).eq(other) } + fn ne(&self, other: &cat_type) -> bool { !(*self).eq(other) } } // Very silly -- this just returns the value of the name field @@ -50,7 +50,7 @@ pub impl<T> cat<T> { } impl<T> BaseIter<(int, &'self T)> for cat<T> { - pure fn each(&self, f: &fn(&(int, &'self T)) -> bool) { + fn each(&self, f: &fn(&(int, &'self T)) -> bool) { let mut n = int::abs(self.meows); while n > 0 { if !f(&(n, &self.name)) { break; } @@ -58,12 +58,12 @@ impl<T> BaseIter<(int, &'self T)> for cat<T> { } } - pure fn size_hint(&self) -> Option<uint> { Some(self.len()) } + fn size_hint(&self) -> Option<uint> { Some(self.len()) } } impl<T> Container for cat<T> { - pure fn len(&const self) -> uint { self.meows as uint } - pure fn is_empty(&const self) -> bool { self.meows == 0 } + fn len(&const self) -> uint { self.meows as uint } + fn is_empty(&const self) -> bool { self.meows == 0 } } impl<T> Mutable for cat<T> { @@ -71,13 +71,13 @@ impl<T> Mutable for cat<T> { } impl<T> Map<int, T> for cat<T> { - pure fn contains_key(&self, k: &int) -> bool { *k <= self.meows } + fn contains_key(&self, k: &int) -> bool { *k <= self.meows } - pure fn each_key(&self, f: &fn(v: &int) -> bool) { + fn each_key(&self, f: &fn(v: &int) -> bool) { for self.each |&(k, _)| { if !f(&k) { break; } loop;}; } - pure fn each_value(&self, f: &fn(v: &T) -> bool) { + fn each_value(&self, f: &fn(v: &T) -> bool) { for self.each |&(_, v)| { if !f(v) { break; } loop;}; } @@ -90,7 +90,7 @@ impl<T> Map<int, T> for cat<T> { true } - pure fn find(&self, k: &int) -> Option<&'self T> { + fn find(&self, k: &int) -> Option<&'self T> { if *k <= self.meows { Some(&self.name) } else { @@ -108,14 +108,14 @@ impl<T> Map<int, T> for cat<T> { } pub impl<T> cat<T> { - pure fn get(&self, k: &int) -> &'self T { + fn get(&self, k: &int) -> &'self T { match self.find(k) { Some(v) => { v } None => { fail!(~"epic fail"); } } } - pure fn new(in_x: int, in_y: int, in_name: T) -> cat<T> { + fn new(in_x: int, in_y: int, in_name: T) -> cat<T> { cat{meows: in_x, how_hungry: in_y, name: in_name } } } diff --git a/src/test/run-pass/class-separate-impl.rs b/src/test/run-pass/class-separate-impl.rs index bb07597a188..168f2d872e7 100644 --- a/src/test/run-pass/class-separate-impl.rs +++ b/src/test/run-pass/class-separate-impl.rs @@ -51,7 +51,7 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat { } impl ToStr for cat { - pure fn to_str(&self) -> ~str { + fn to_str(&self) -> ~str { // FIXME #5384: this unsafe block is to work around purity unsafe { self.name.clone() diff --git a/src/test/run-pass/coerce-reborrow-imm-ptr-arg.rs b/src/test/run-pass/coerce-reborrow-imm-ptr-arg.rs index 905046756f6..e40272bb7a4 100644 --- a/src/test/run-pass/coerce-reborrow-imm-ptr-arg.rs +++ b/src/test/run-pass/coerce-reborrow-imm-ptr-arg.rs @@ -1,4 +1,4 @@ -pure fn negate(x: &int) -> int { +fn negate(x: &int) -> int { -*x } diff --git a/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs b/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs index 54d9758aa21..12ca00fedd3 100644 --- a/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs +++ b/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs @@ -3,7 +3,7 @@ struct SpeechMaker { } pub impl SpeechMaker { - pure fn how_many(&const self) -> uint { self.speeches } + fn how_many(&const self) -> uint { self.speeches } } fn foo(speaker: &const SpeechMaker) -> uint { 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 a18b4a2b0c6..ad5eb50ccef 100644 --- a/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs +++ b/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs @@ -1,6 +1,6 @@ // xfail-test -pure fn sum(x: &[int]) -> int { +fn sum(x: &[int]) -> int { let mut sum = 0; for x.each |y| { sum += *y; } return sum; diff --git a/src/test/run-pass/coherence-impl-in-fn.rs b/src/test/run-pass/coherence-impl-in-fn.rs index 4fb43092500..7643799df06 100644 --- a/src/test/run-pass/coherence-impl-in-fn.rs +++ b/src/test/run-pass/coherence-impl-in-fn.rs @@ -11,9 +11,9 @@ pub fn main() { enum x { foo } impl ::core::cmp::Eq for x { - pure fn eq(&self, other: &x) -> bool { + fn eq(&self, other: &x) -> bool { (*self) as int == (*other) as int } - pure fn ne(&self, other: &x) -> bool { !(*self).eq(other) } + fn ne(&self, other: &x) -> bool { !(*self).eq(other) } } } diff --git a/src/test/run-pass/const-struct.rs b/src/test/run-pass/const-struct.rs index b210b20458c..f2b5be4e36f 100644 --- a/src/test/run-pass/const-struct.rs +++ b/src/test/run-pass/const-struct.rs @@ -12,12 +12,12 @@ struct foo { a: int, b: int, c: int } impl cmp::Eq for foo { - pure fn eq(&self, other: &foo) -> bool { + fn eq(&self, other: &foo) -> bool { (*self).a == (*other).a && (*self).b == (*other).b && (*self).c == (*other).c } - pure fn ne(&self, other: &foo) -> bool { !(*self).eq(other) } + fn ne(&self, other: &foo) -> bool { !(*self).eq(other) } } const x : foo = foo { a:1, b:2, c: 3 }; diff --git a/src/test/run-pass/do-pure.rs b/src/test/run-pass/do-pure.rs index 41686cf5b37..08056f59acd 100644 --- a/src/test/run-pass/do-pure.rs +++ b/src/test/run-pass/do-pure.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pure fn f(f: &fn()) { +fn f(f: &fn()) { } -pure fn g() { +fn g() { // `f || { }` is considered pure, so `do f { }` should be too do f { } } diff --git a/src/test/run-pass/empty-tag.rs b/src/test/run-pass/empty-tag.rs index ca81489e0bd..0589ffc79e0 100644 --- a/src/test/run-pass/empty-tag.rs +++ b/src/test/run-pass/empty-tag.rs @@ -11,10 +11,10 @@ enum chan { chan_t, } impl cmp::Eq for chan { - pure fn eq(&self, other: &chan) -> bool { + fn eq(&self, other: &chan) -> bool { ((*self) as uint) == ((*other) as uint) } - pure fn ne(&self, other: &chan) -> bool { !(*self).eq(other) } + fn ne(&self, other: &chan) -> bool { !(*self).eq(other) } } fn wrapper3(i: chan) { diff --git a/src/test/run-pass/explicit-self-generic.rs b/src/test/run-pass/explicit-self-generic.rs index 16c4986fc53..e22e739f570 100644 --- a/src/test/run-pass/explicit-self-generic.rs +++ b/src/test/run-pass/explicit-self-generic.rs @@ -15,8 +15,8 @@ extern mod std; * * The hash should concentrate entropy in the lower bits. */ -type HashFn<K> = ~pure fn(K) -> uint; -type EqFn<K> = ~pure fn(K, K) -> bool; +type HashFn<K> = ~fn(K) -> uint; +type EqFn<K> = ~fn(K, K) -> bool; struct LM { resize_at: uint, size: uint } diff --git a/src/test/run-pass/export-unexported-dep.rs b/src/test/run-pass/export-unexported-dep.rs index 36483f88377..4634cc4ef11 100644 --- a/src/test/run-pass/export-unexported-dep.rs +++ b/src/test/run-pass/export-unexported-dep.rs @@ -16,10 +16,10 @@ mod foo { enum t { t1, t2, } impl cmp::Eq for t { - pure fn eq(&self, other: &t) -> bool { + fn eq(&self, other: &t) -> bool { ((*self) as uint) == ((*other) as uint) } - pure fn ne(&self, other: &t) -> bool { !(*self).eq(other) } + fn ne(&self, other: &t) -> bool { !(*self).eq(other) } } pub fn f() -> t { return t1; } diff --git a/src/test/run-pass/expr-alt-struct.rs b/src/test/run-pass/expr-alt-struct.rs index 564fb1a912c..03358f2511b 100644 --- a/src/test/run-pass/expr-alt-struct.rs +++ b/src/test/run-pass/expr-alt-struct.rs @@ -24,10 +24,10 @@ fn test_rec() { enum mood { happy, sad, } impl cmp::Eq for mood { - pure fn eq(&self, other: &mood) -> bool { + fn eq(&self, other: &mood) -> bool { ((*self) as uint) == ((*other) as uint) } - pure fn ne(&self, other: &mood) -> bool { !(*self).eq(other) } + fn ne(&self, other: &mood) -> bool { !(*self).eq(other) } } fn test_tag() { diff --git a/src/test/run-pass/expr-if-struct.rs b/src/test/run-pass/expr-if-struct.rs index d37a67d922e..14212347835 100644 --- a/src/test/run-pass/expr-if-struct.rs +++ b/src/test/run-pass/expr-if-struct.rs @@ -25,10 +25,10 @@ fn test_rec() { enum mood { happy, sad, } impl cmp::Eq for mood { - pure fn eq(&self, other: &mood) -> bool { + fn eq(&self, other: &mood) -> bool { ((*self) as uint) == ((*other) as uint) } - pure fn ne(&self, other: &mood) -> bool { !(*self).eq(other) } + fn ne(&self, other: &mood) -> bool { !(*self).eq(other) } } fn test_tag() { diff --git a/src/test/run-pass/if-check.rs b/src/test/run-pass/if-check.rs index 3ee0808fa95..5c72de87ccb 100644 --- a/src/test/run-pass/if-check.rs +++ b/src/test/run-pass/if-check.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pure fn even(x: uint) -> bool { +fn even(x: uint) -> bool { if x < 2u { return false; } else if x == 2u { return true; } else { return even(x - 2u); } diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index 9538ebc554c..343e62b2d0c 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -28,7 +28,7 @@ enum square { } impl to_str::ToStr for square { - pure fn to_str(&self) -> ~str { + fn to_str(&self) -> ~str { match *self { bot => { ~"R" } wall => { ~"#" } diff --git a/src/test/run-pass/issue-3149.rs b/src/test/run-pass/issue-3149.rs index df102f93c2b..e433141c44d 100644 --- a/src/test/run-pass/issue-3149.rs +++ b/src/test/run-pass/issue-3149.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pure fn Matrix4<T:Copy>(m11: T, m12: T, m13: T, m14: T, - m21: T, m22: T, m23: T, m24: T, - m31: T, m32: T, m33: T, m34: T, - m41: T, m42: T, m43: T, m44: T) - -> Matrix4<T> { +fn Matrix4<T:Copy>(m11: T, m12: T, m13: T, m14: T, + m21: T, m22: T, m23: T, m24: T, + m31: T, m32: T, m33: T, m34: T, + m41: T, m42: T, m43: T, m44: T) + -> Matrix4<T> { Matrix4 { m11: m11, m12: m12, m13: m13, m14: m14, diff --git a/src/test/run-pass/issue-3480.rs b/src/test/run-pass/issue-3480.rs index e813cde7c27..aaff822398d 100644 --- a/src/test/run-pass/issue-3480.rs +++ b/src/test/run-pass/issue-3480.rs @@ -13,13 +13,12 @@ type IMap<K:Copy,V:Copy> = ~[(K, V)]; trait ImmutableMap<K:Copy,V:Copy> { - pure fn contains_key(key: K) -> bool; + fn contains_key(key: K) -> bool; } impl<K:Copy,V:Copy> IMap<K, V> : ImmutableMap<K, V> { - pure fn contains_key(key: K) -> bool - { + fn contains_key(key: K) -> bool { vec::find(self, |e| {e.first() == key}).is_some() } } diff --git a/src/test/run-pass/issue-3563-3.rs b/src/test/run-pass/issue-3563-3.rs index ad6cae0bff9..fdbd7ec304e 100644 --- a/src/test/run-pass/issue-3563-3.rs +++ b/src/test/run-pass/issue-3563-3.rs @@ -111,8 +111,7 @@ impl AsciiArt // Allows AsciiArt to be converted to a string using the libcore ToStr trait. // Note that the %s fmt! specifier will not call this automatically. impl ToStr for AsciiArt { - pure fn to_str(&self) -> ~str - { + fn to_str(&self) -> ~str { // Convert each line into a string. let lines = do self.lines.map |line| {str::from_chars(*line)}; diff --git a/src/test/run-pass/issue-3874.rs b/src/test/run-pass/issue-3874.rs index 8d62da9efad..f54d2f9fafc 100644 --- a/src/test/run-pass/issue-3874.rs +++ b/src/test/run-pass/issue-3874.rs @@ -11,7 +11,7 @@ // xfail-test enum PureCounter { PureCounter(uint) } -pure fn each(self: PureCounter, blk: &fn(v: &uint)) { +fn each(self: PureCounter, blk: &fn(v: &uint)) { let PureCounter(ref x) = self; blk(x); } diff --git a/src/test/run-pass/mod-merge-hack-template.rs b/src/test/run-pass/mod-merge-hack-template.rs index 94edb596b5f..8628d84d4e7 100644 --- a/src/test/run-pass/mod-merge-hack-template.rs +++ b/src/test/run-pass/mod-merge-hack-template.rs @@ -13,4 +13,4 @@ use T = self::inst::T; pub const bits: uint = inst::bits; -pub pure fn min(x: T, y: T) -> T { if x < y { x } else { y } } +pub fn min(x: T, y: T) -> T { if x < y { x } else { y } } diff --git a/src/test/run-pass/new-impl-syntax.rs b/src/test/run-pass/new-impl-syntax.rs index aad7ded42d3..12b41fc9148 100644 --- a/src/test/run-pass/new-impl-syntax.rs +++ b/src/test/run-pass/new-impl-syntax.rs @@ -4,7 +4,7 @@ struct Thingy { } impl ToStr for Thingy { - pure fn to_str(&self) -> ~str { + fn to_str(&self) -> ~str { fmt!("{ x: %d, y: %d }", self.x, self.y) } } @@ -14,7 +14,7 @@ struct PolymorphicThingy<T> { } impl<T:ToStr> ToStr for PolymorphicThingy<T> { - pure fn to_str(&self) -> ~str { + fn to_str(&self) -> ~str { self.x.to_str() } } diff --git a/src/test/run-pass/non-boolean-pure-fns.rs b/src/test/run-pass/non-boolean-pure-fns.rs index 83273a7aae6..ae241e458fc 100644 --- a/src/test/run-pass/non-boolean-pure-fns.rs +++ b/src/test/run-pass/non-boolean-pure-fns.rs @@ -14,13 +14,13 @@ extern mod std; use std::list::*; -pure fn pure_length_go<T:Copy>(ls: @List<T>, acc: uint) -> uint { +fn pure_length_go<T:Copy>(ls: @List<T>, acc: uint) -> uint { match *ls { Nil => { acc } Cons(_, tl) => { pure_length_go(tl, acc + 1u) } } } -pure fn pure_length<T:Copy>(ls: @List<T>) -> uint { pure_length_go(ls, 0u) } +fn pure_length<T:Copy>(ls: @List<T>) -> uint { pure_length_go(ls, 0u) } -pure fn nonempty_list<T:Copy>(ls: @List<T>) -> bool { pure_length(ls) > 0u } +fn nonempty_list<T:Copy>(ls: @List<T>) -> bool { pure_length(ls) > 0u } fn safe_head<T:Copy>(ls: @List<T>) -> T { fail_unless!(!is_empty(ls)); diff --git a/src/test/run-pass/operator-overloading.rs b/src/test/run-pass/operator-overloading.rs index 3873cdf615b..9299e3e365e 100644 --- a/src/test/run-pass/operator-overloading.rs +++ b/src/test/run-pass/operator-overloading.rs @@ -16,40 +16,40 @@ struct Point { } impl ops::Add<Point,Point> for Point { - pure fn add(&self, other: &Point) -> Point { + fn add(&self, other: &Point) -> Point { Point {x: self.x + (*other).x, y: self.y + (*other).y} } } impl ops::Sub<Point,Point> for Point { - pure fn sub(&self, other: &Point) -> Point { + fn sub(&self, other: &Point) -> Point { Point {x: self.x - (*other).x, y: self.y - (*other).y} } } impl ops::Neg<Point> for Point { - pure fn neg(&self) -> Point { + fn neg(&self) -> Point { Point {x: -self.x, y: -self.y} } } impl ops::Not<Point> for Point { - pure fn not(&self) -> Point { + fn not(&self) -> Point { Point {x: !self.x, y: !self.y } } } impl ops::Index<bool,int> for Point { - pure fn index(&self, +x: bool) -> int { + fn index(&self, +x: bool) -> int { if x { self.x } else { self.y } } } impl cmp::Eq for Point { - pure fn eq(&self, other: &Point) -> bool { + fn eq(&self, other: &Point) -> bool { (*self).x == (*other).x && (*self).y == (*other).y } - pure fn ne(&self, other: &Point) -> bool { !(*self).eq(other) } + fn ne(&self, other: &Point) -> bool { !(*self).eq(other) } } pub fn main() { diff --git a/src/test/run-pass/pred-not-bool.rs b/src/test/run-pass/pred-not-bool.rs index 4b90b99cb31..127b845ad4c 100644 --- a/src/test/run-pass/pred-not-bool.rs +++ b/src/test/run-pass/pred-not-bool.rs @@ -11,6 +11,6 @@ // this checks that a pred with a non-bool return // type is rejected, even if the pred is never used -pure fn bad(a: int) -> int { return 37; } //~ ERROR Non-boolean return type +fn bad(a: int) -> int { return 37; } //~ ERROR Non-boolean return type pub fn main() { } diff --git a/src/test/run-pass/pure-fmt.rs b/src/test/run-pass/pure-fmt.rs index b65c33939c8..424a5e4e8ef 100644 --- a/src/test/run-pass/pure-fmt.rs +++ b/src/test/run-pass/pure-fmt.rs @@ -13,7 +13,7 @@ struct Big { b: @~str, c: uint, d: int, e: char, f: float, g: bool } -pure fn foo() { +fn foo() { let a = Big { b: @~"hi", c: 0, diff --git a/src/test/run-pass/pure-sum.rs b/src/test/run-pass/pure-sum.rs index cac6b4ef349..6327a3f238d 100644 --- a/src/test/run-pass/pure-sum.rs +++ b/src/test/run-pass/pure-sum.rs @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Check that pure functions can modify local state. +// Check that functions can modify local state. -pure fn sums_to(v: ~[int], sum: int) -> bool { +fn sums_to(v: ~[int], sum: int) -> bool { let mut i = 0u, sum0 = 0; while i < v.len() { sum0 += v[i]; @@ -19,7 +19,7 @@ pure fn sums_to(v: ~[int], sum: int) -> bool { return sum0 == sum; } -pure fn sums_to_using_uniq(v: ~[int], sum: int) -> bool { +fn sums_to_using_uniq(v: ~[int], sum: int) -> bool { let mut i = 0u, sum0 = ~0; while i < v.len() { *sum0 += v[i]; @@ -28,7 +28,7 @@ pure fn sums_to_using_uniq(v: ~[int], sum: int) -> bool { return *sum0 == sum; } -pure fn sums_to_using_rec(v: ~[int], sum: int) -> bool { +fn sums_to_using_rec(v: ~[int], sum: int) -> bool { let mut i = 0u, sum0 = F {f: 0}; while i < v.len() { sum0.f += v[i]; @@ -39,7 +39,7 @@ pure fn sums_to_using_rec(v: ~[int], sum: int) -> bool { struct F<T> { f: T } -pure fn sums_to_using_uniq_rec(v: ~[int], sum: int) -> bool { +fn sums_to_using_uniq_rec(v: ~[int], sum: int) -> bool { let mut i = 0u, sum0 = F {f: ~0}; while i < v.len() { *sum0.f += v[i]; diff --git a/src/test/run-pass/purity-infer.rs b/src/test/run-pass/purity-infer.rs index ce9b3b78a9c..debde77b211 100644 --- a/src/test/run-pass/purity-infer.rs +++ b/src/test/run-pass/purity-infer.rs @@ -9,7 +9,7 @@ // except according to those terms. -fn something(f: &pure fn()) { f(); } +fn something(f: &fn()) { f(); } pub fn main() { something(|| error!("hi!") ); } diff --git a/src/test/run-pass/static-method-test.rs b/src/test/run-pass/static-method-test.rs index 99db34673ae..624a38b789b 100644 --- a/src/test/run-pass/static-method-test.rs +++ b/src/test/run-pass/static-method-test.rs @@ -35,28 +35,25 @@ impl bool_like for int { // A trait for sequences that can be constructed imperatively. trait buildable<A> { - pure fn build_sized(size: uint, - builder: &fn(push: &pure fn(+v: A))) -> Self; + fn build_sized(size: uint, builder: &fn(push: &fn(+v: A))) -> Self; } impl<A> buildable<A> for @[A] { #[inline(always)] - pure fn build_sized(size: uint, - builder: &fn(push: &pure fn(+v: A))) -> @[A] { + fn build_sized(size: uint, builder: &fn(push: &fn(+v: A))) -> @[A] { at_vec::build_sized(size, builder) } } impl<A> buildable<A> for ~[A] { #[inline(always)] - pure fn build_sized(size: uint, - builder: &fn(push: &pure fn(+v: A))) -> ~[A] { + fn build_sized(size: uint, builder: &fn(push: &fn(+v: A))) -> ~[A] { vec::build_sized(size, builder) } } #[inline(always)] -pure fn build<A, B: buildable<A>>(builder: &fn(push: &pure fn(+v: A))) -> B { +fn build<A, B: buildable<A>>(builder: &fn(push: &fn(+v: A))) -> B { buildable::build_sized(4, builder) } diff --git a/src/test/run-pass/static-methods-in-traits2.rs b/src/test/run-pass/static-methods-in-traits2.rs index ddf69cda63f..20e6efa11f0 100644 --- a/src/test/run-pass/static-methods-in-traits2.rs +++ b/src/test/run-pass/static-methods-in-traits2.rs @@ -1,17 +1,17 @@ pub trait Number: NumConv { - pure fn from<T:Number>(n: T) -> Self; + fn from<T:Number>(n: T) -> Self; } impl Number for float { - pure fn from<T:Number>(n: T) -> float { n.to_float() } + fn from<T:Number>(n: T) -> float { n.to_float() } } pub trait NumConv { - pure fn to_float(&self) -> float; + fn to_float(&self) -> float; } impl NumConv for float { - pure fn to_float(&self) -> float { *self } + fn to_float(&self) -> float { *self } } pub fn main() { diff --git a/src/test/run-pass/structured-compare.rs b/src/test/run-pass/structured-compare.rs index f32fc27e3aa..d9872033447 100644 --- a/src/test/run-pass/structured-compare.rs +++ b/src/test/run-pass/structured-compare.rs @@ -13,10 +13,10 @@ enum foo { large, small, } impl cmp::Eq for foo { - pure fn eq(&self, other: &foo) -> bool { + fn eq(&self, other: &foo) -> bool { ((*self) as uint) == ((*other) as uint) } - pure fn ne(&self, other: &foo) -> bool { !(*self).eq(other) } + fn ne(&self, other: &foo) -> bool { !(*self).eq(other) } } pub fn main() { diff --git a/src/test/run-pass/tag-variant-disr-val.rs b/src/test/run-pass/tag-variant-disr-val.rs index 2f87142d688..63300342bd3 100644 --- a/src/test/run-pass/tag-variant-disr-val.rs +++ b/src/test/run-pass/tag-variant-disr-val.rs @@ -20,10 +20,10 @@ enum color { } impl cmp::Eq for color { - pure fn eq(&self, other: &color) -> bool { + fn eq(&self, other: &color) -> bool { ((*self) as uint) == ((*other) as uint) } - pure fn ne(&self, other: &color) -> bool { !(*self).eq(other) } + fn ne(&self, other: &color) -> bool { !(*self).eq(other) } } pub fn main() { diff --git a/src/test/run-pass/tag.rs b/src/test/run-pass/tag.rs index 729e11dfc64..4e126379410 100644 --- a/src/test/run-pass/tag.rs +++ b/src/test/run-pass/tag.rs @@ -15,7 +15,7 @@ enum colour { red(int, int), green, } impl cmp::Eq for colour { - pure fn eq(&self, other: &colour) -> bool { + fn eq(&self, other: &colour) -> bool { match *self { red(a0, b0) => { match (*other) { @@ -31,7 +31,7 @@ impl cmp::Eq for colour { } } } - pure fn ne(&self, other: &colour) -> bool { !(*self).eq(other) } + fn ne(&self, other: &colour) -> bool { !(*self).eq(other) } } fn f() { let x = red(1, 2); let y = green; fail_unless!((x != y)); } diff --git a/src/test/run-pass/task-comm-16.rs b/src/test/run-pass/task-comm-16.rs index c50dfe79169..89dad2d462c 100644 --- a/src/test/run-pass/task-comm-16.rs +++ b/src/test/run-pass/task-comm-16.rs @@ -52,7 +52,7 @@ enum t { } impl cmp::Eq for t { - pure fn eq(&self, other: &t) -> bool { + fn eq(&self, other: &t) -> bool { match *self { tag1 => { match (*other) { @@ -75,7 +75,7 @@ impl cmp::Eq for t { } } } - pure fn ne(&self, other: &t) -> bool { !(*self).eq(other) } + fn ne(&self, other: &t) -> bool { !(*self).eq(other) } } fn test_tag() { diff --git a/src/test/run-pass/trait-inheritance-overloading-simple.rs b/src/test/run-pass/trait-inheritance-overloading-simple.rs index ce370854a41..283ed8ae2c1 100644 --- a/src/test/run-pass/trait-inheritance-overloading-simple.rs +++ b/src/test/run-pass/trait-inheritance-overloading-simple.rs @@ -15,8 +15,8 @@ trait MyNum : Eq { } struct MyInt { val: int } impl Eq for MyInt { - pure fn eq(&self, other: &MyInt) -> bool { self.val == other.val } - pure fn ne(&self, other: &MyInt) -> bool { !self.eq(other) } + fn eq(&self, other: &MyInt) -> bool { self.val == other.val } + fn ne(&self, other: &MyInt) -> bool { !self.eq(other) } } impl MyNum for MyInt; @@ -25,7 +25,7 @@ fn f<T:MyNum>(x: T, y: T) -> bool { return x == y; } -pure fn mi(v: int) -> MyInt { MyInt { val: v } } +fn mi(v: int) -> MyInt { MyInt { val: v } } pub fn main() { let (x, y, z) = (mi(3), mi(5), mi(3)); diff --git a/src/test/run-pass/trait-inheritance-overloading-xc-exe.rs b/src/test/run-pass/trait-inheritance-overloading-xc-exe.rs index f97412f4207..d4d16f2b43e 100644 --- a/src/test/run-pass/trait-inheritance-overloading-xc-exe.rs +++ b/src/test/run-pass/trait-inheritance-overloading-xc-exe.rs @@ -18,7 +18,7 @@ fn f<T:Copy + MyNum>(x: T, y: T) -> (T, T, T) { return (x + y, x - y, x * y); } -pure fn mi(v: int) -> MyInt { MyInt { val: v } } +fn mi(v: int) -> MyInt { MyInt { val: v } } pub fn main() { let (x, y) = (mi(3), mi(5)); diff --git a/src/test/run-pass/trait-inheritance-overloading.rs b/src/test/run-pass/trait-inheritance-overloading.rs index aadc0650958..d4f8d50b92b 100644 --- a/src/test/run-pass/trait-inheritance-overloading.rs +++ b/src/test/run-pass/trait-inheritance-overloading.rs @@ -15,20 +15,20 @@ trait MyNum : Add<Self,Self> + Sub<Self,Self> + Mul<Self,Self> + Eq { } struct MyInt { val: int } impl Add<MyInt, MyInt> for MyInt { - pure fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) } + fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) } } impl Sub<MyInt, MyInt> for MyInt { - pure fn sub(&self, other: &MyInt) -> MyInt { mi(self.val - other.val) } + fn sub(&self, other: &MyInt) -> MyInt { mi(self.val - other.val) } } impl Mul<MyInt, MyInt> for MyInt { - pure fn mul(&self, other: &MyInt) -> MyInt { mi(self.val * other.val) } + fn mul(&self, other: &MyInt) -> MyInt { mi(self.val * other.val) } } impl Eq for MyInt { - pure fn eq(&self, other: &MyInt) -> bool { self.val == other.val } - pure fn ne(&self, other: &MyInt) -> bool { !self.eq(other) } + fn eq(&self, other: &MyInt) -> bool { self.val == other.val } + fn ne(&self, other: &MyInt) -> bool { !self.eq(other) } } impl MyNum for MyInt; @@ -37,7 +37,7 @@ fn f<T:Copy + MyNum>(x: T, y: T) -> (T, T, T) { return (x + y, x - y, x * y); } -pure fn mi(v: int) -> MyInt { MyInt { val: v } } +fn mi(v: int) -> MyInt { MyInt { val: v } } pub fn main() { let (x, y) = (mi(3), mi(5)); diff --git a/src/test/run-pass/trait-inheritance-subst.rs b/src/test/run-pass/trait-inheritance-subst.rs index c1ee7a2c00a..9d0e5fa1f13 100644 --- a/src/test/run-pass/trait-inheritance-subst.rs +++ b/src/test/run-pass/trait-inheritance-subst.rs @@ -9,7 +9,7 @@ // except according to those terms. pub trait Add<RHS,Result> { - pure fn add(&self, rhs: &RHS) -> Result; + fn add(&self, rhs: &RHS) -> Result; } trait MyNum : Add<Self,Self> { } @@ -17,7 +17,7 @@ trait MyNum : Add<Self,Self> { } struct MyInt { val: int } impl Add<MyInt, MyInt> for MyInt { - pure fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) } + fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) } } impl MyNum for MyInt; @@ -26,7 +26,7 @@ fn f<T:MyNum>(x: T, y: T) -> T { return x.add(&y); } -pure fn mi(v: int) -> MyInt { MyInt { val: v } } +fn mi(v: int) -> MyInt { MyInt { val: v } } pub fn main() { let (x, y) = (mi(3), mi(5)); diff --git a/src/test/run-pass/trait-static-method-overwriting.rs b/src/test/run-pass/trait-static-method-overwriting.rs index 40f01fb63c1..a8a579422a3 100644 --- a/src/test/run-pass/trait-static-method-overwriting.rs +++ b/src/test/run-pass/trait-static-method-overwriting.rs @@ -12,7 +12,7 @@ mod base { pub trait HasNew<T> { - pure fn new() -> T; + fn new() -> T; } pub struct Foo { @@ -20,7 +20,7 @@ mod base { } impl ::base::HasNew<Foo> for Foo { - pure fn new() -> Foo { + fn new() -> Foo { unsafe { io::println("Foo"); } Foo { dummy: () } } @@ -31,7 +31,7 @@ mod base { } impl ::base::HasNew<Bar> for Bar { - pure fn new() -> Bar { + fn new() -> Bar { unsafe { io::println("Bar"); } Bar { dummy: () } } diff --git a/src/test/run-pass/tstate-loop-break.rs b/src/test/run-pass/tstate-loop-break.rs index 8b626611c41..4228f72b7ca 100644 --- a/src/test/run-pass/tstate-loop-break.rs +++ b/src/test/run-pass/tstate-loop-break.rs @@ -10,7 +10,7 @@ // xfail-test -pure fn is_even(i: int) -> bool { (i%2) == 0 } +fn is_even(i: int) -> bool { (i%2) == 0 } fn even(i: int) : is_even(i) -> int { i } fn test() { diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index a7ac8554b3d..0af35a6c619 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -56,7 +56,7 @@ fn notsure() { } fn canttouchthis() -> uint { - pure fn p() -> bool { true } + fn p() -> bool { true } let _a = (fail_unless!((true)) == (fail_unless!(p()))); let _c = (fail_unless!((p())) == ()); let _b: bool = (debug!("%d", 0) == (return 0u)); |
