]> git.lizzy.rs Git - rust.git/commitdiff
test: Remove `pure` from the test suite
authorPatrick Walton <pcwalton@mimiga.net>
Fri, 22 Mar 2013 18:23:21 +0000 (11:23 -0700)
committerPatrick Walton <pcwalton@mimiga.net>
Fri, 22 Mar 2013 19:57:28 +0000 (12:57 -0700)
62 files changed:
src/test/auxiliary/cci_class_cast.rs
src/test/auxiliary/crateresolve5-1.rs
src/test/auxiliary/crateresolve5-2.rs
src/test/auxiliary/impl_privacy_xc_2.rs
src/test/auxiliary/static_fn_trait_xc_aux.rs
src/test/auxiliary/trait_inheritance_overloading_xc.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/bench/shootout-mandelbrot.rs
src/test/compile-fail/auto-ref-slice-plus-ref.rs
src/test/compile-fail/borrowck-loan-in-overloaded-op.rs
src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
src/test/compile-fail/borrowck-loan-rcvr.rs
src/test/compile-fail/issue-3344.rs
src/test/compile-fail/issue-3707.rs
src/test/compile-fail/issue-3820.rs
src/test/compile-fail/issue-3953.rs
src/test/compile-fail/issue-3973.rs
src/test/compile-fail/missing-derivable-attr.rs
src/test/run-fail/die-macro-pure.rs
src/test/run-fail/if-check-fail.rs
src/test/run-pass/auto-encode.rs
src/test/run-pass/auto-ref-slice-plus-ref.rs
src/test/run-pass/class-impl-very-parameterized-trait.rs
src/test/run-pass/class-separate-impl.rs
src/test/run-pass/coerce-reborrow-imm-ptr-arg.rs
src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs
src/test/run-pass/coerce-reborrow-imm-vec-arg.rs
src/test/run-pass/coherence-impl-in-fn.rs
src/test/run-pass/const-struct.rs
src/test/run-pass/do-pure.rs
src/test/run-pass/empty-tag.rs
src/test/run-pass/explicit-self-generic.rs
src/test/run-pass/export-unexported-dep.rs
src/test/run-pass/expr-alt-struct.rs
src/test/run-pass/expr-if-struct.rs
src/test/run-pass/if-check.rs
src/test/run-pass/issue-2904.rs
src/test/run-pass/issue-3149.rs
src/test/run-pass/issue-3480.rs
src/test/run-pass/issue-3563-3.rs
src/test/run-pass/issue-3874.rs
src/test/run-pass/mod-merge-hack-template.rs
src/test/run-pass/new-impl-syntax.rs
src/test/run-pass/non-boolean-pure-fns.rs
src/test/run-pass/operator-overloading.rs
src/test/run-pass/pred-not-bool.rs
src/test/run-pass/pure-fmt.rs
src/test/run-pass/pure-sum.rs
src/test/run-pass/purity-infer.rs
src/test/run-pass/static-method-test.rs
src/test/run-pass/static-methods-in-traits2.rs
src/test/run-pass/structured-compare.rs
src/test/run-pass/tag-variant-disr-val.rs
src/test/run-pass/tag.rs
src/test/run-pass/task-comm-16.rs
src/test/run-pass/trait-inheritance-overloading-simple.rs
src/test/run-pass/trait-inheritance-overloading-xc-exe.rs
src/test/run-pass/trait-inheritance-overloading.rs
src/test/run-pass/trait-inheritance-subst.rs
src/test/run-pass/trait-static-method-overwriting.rs
src/test/run-pass/tstate-loop-break.rs
src/test/run-pass/weird-exprs.rs

index 5006c72ad156b17802945014cf1fc139725f1a48..edda0644b16a6fc69be5e99104f7cc8000300dfb 100644 (file)
@@ -18,7 +18,7 @@ pub struct cat {
     }
 
     impl ToStr for cat {
-       pure fn to_str(&self) -> ~str { copy self.name }
+       fn to_str(&self) -> ~str { copy self.name }
     }
 
     priv impl cat {
index 01c2dccb7b92dfa494c726bec08093703c6c9e1a..c120a971c6b90fdbbff6638a0860b38ebbbbb172 100644 (file)
@@ -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 }
index 328b9aa0ecbd5a5dadc3297377594de1cd074d87..230fdad04689179b4658de72423fae8dac6a121f 100644 (file)
@@ -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 }
index d8c2a9ede5cffec91302f5c018af25398d8a969f..0fa15fa14f61310dc36eafe2b86fa992bf55b3f1 100644 (file)
@@ -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 }
     }
 }
 
index f3cb9a22625afc790a4f68dc9f04d8c7098a03da..cc03ac38943045d23e307050a5559c34843aebab 100644 (file)
@@ -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;  }
     }
 }
index e86f7cfd26ad50bbdf3280ec44fe0c9ce6a16c0d..1b480ff17b330fd16c632d5293afc3ffe55effa3 100644 (file)
@@ -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 } }
 
index fc980e3d6db53eb03713e334274cb3f2e939cebd..f0847b635b4bd285ee48f708457eaff2c64ec5d2 100644 (file)
@@ -27,14 +27,14 @@ fn pct(xx: uint, yy: uint) -> float {
       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;
index eeea62d50fb3a9db14e8b9f9a070a045d921c0ca..ada5ff7be2fa8461d2dc575e68f45e685f40c17d 100644 (file)
@@ -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
 }
index 7faee6f7ea28f5525d610a008ddcf6f1a22cc1aa..609e8de87d68b58cf3229c07baf90f71592f802e 100644 (file)
@@ -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) { }
 }
index ece9ae7e86199faab96520e76cc406196199e9d1..482d1b6b8b617f6f9598f162a99a0ffa79c0b4d1 100644 (file)
@@ -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)))
     }
 }
index 23debb4c5e212c841026fc7d13628c03cc475dab..a4ad7e69b3336902745f2a30bc7669825227890b 100644 (file)
@@ -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)
     }
 }
index 4a7228dcca39b1d33731b3b36e198f8eace5cc09..4473574926a34d85fe66b21fb8569337593c7c0a 100644 (file)
@@ -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 @@ fn impurem(&self) {
 
     fn blockm(&self, f: &fn()) { f() }
 
-    pure fn purem(&self) {
+    fn purem(&self) {
     }
 }
 
index df768860cba94817f1f297e5ed4222fd25669276..e931a8fa7e144fce3e4b2c475106c4224ca1fa24 100644 (file)
@@ -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() {}
index ad5fa16f98cb876ba977eb13ab2f41c96b2cb8cb..2c8f94c4695b0192c07515fa3cb13eadf9dce82c 100644 (file)
@@ -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
     }
 }
index 3a726d270ffce285d8b4ddcc8014495f7c060364..68c00494b9b4d66023ba0337fd9cab0d4a432edb 100644 (file)
@@ -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}
     }
 }
index bfc17c589db91ed69af911b7443008507c87263a..b726f090e7db74e6db9545275d039f7d56edf408 100644 (file)
@@ -25,8 +25,8 @@ trait Hahaha: Eq + Eq + Eq + Eq + Eq + //~ ERROR Duplicate supertrait
 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() {
index 15107ccd51ce389d4356dfa65e461e0eb7850d27..b1d741f9186b392a3a21ff4a692288f28983d866 100644 (file)
@@ -20,7 +20,7 @@ fn new(x: float, y: float) -> Point {
         Point { x: x, y: y }
     }
 
-    pure fn to_str(&self) -> ~str {
+    fn to_str(&self) -> ~str {
         fmt!("(%f, %f)", self.x, self.y)
     }
 }
index 057e6dbc06864afcf557c1bae203e6aaa3d9a009..67cf67bfa5a04de29c07c60c2ea8f617a008e039 100644 (file)
@@ -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
index 4479c2ecbeb35d05fa49b1fed2d1b68e3300bda6..296fba2ae9bcce3752db2007d0a85510e8152456 100644 (file)
@@ -1,6 +1,6 @@
 // error-pattern:test
 
-pure fn f() {
+fn f() {
     fail!(~"test");
 }
 
index a3831a10874c33fb4f616c246511b540642f74a1..a77d520b07e9583320320d33d7b7a8e83c9de418 100644 (file)
@@ -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); }
index 7538892f038920e678f568470c02f0cde1f1fd8f..1a8ad446c7954718ad35db0566147d5cde95b85e 100644 (file)
@@ -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]
index 39fe34bfe528658271be116ba3922394e7b2c278..65366a350efa3716f2fd7100f9d272ab6d90ec08 100644 (file)
 // 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() {
index a82db7b1be3729325cf57de372374c715d77de5d..40dd1a46574b1ce8961d9c95e755c54c5fa58e39 100644 (file)
 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 @@ fn eat(&mut self) -> bool {
 }
 
 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 @@ fn clear(&mut self) {}
 }
 
 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 @@ fn insert(&mut self, k: int, _: T) -> bool {
         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 @@ fn remove(&mut self, k: &int) -> bool {
 }
 
 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 }
     }
 }
index bb07597a1887ccc83f573598737e60a7cf89f6f2..168f2d872e7373606c5831f3682913d198ea9f3d 100644 (file)
@@ -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()
index 905046756f6ee9126fe7729d38f5f256067fd16b..e40272bb7a4d546ba5ea59efb7beb3add3908720 100644 (file)
@@ -1,4 +1,4 @@
-pure fn negate(x: &int) -> int {
+fn negate(x: &int) -> int {
     -*x
 }
 
index 54d9758aa214546a583c780bd72f772b29284437..12ca00fedd3f9b729c7579b0426fea1b8f050777 100644 (file)
@@ -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 {
index a18b4a2b0c6919148258404712b0a182a2c13706..ad5eb50ccef306f85a330fe51e4ce98fc4d30c0b 100644 (file)
@@ -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;
index 4fb43092500b36f6642d9205e8dbf655c36cbda0..7643799df0637fe2feedbc18f9700789e9d28c8e 100644 (file)
@@ -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) }
     }
 }
index b210b20458ca9b148832ffbcb1b2804d8e453b77..f2b5be4e36ff9e09081efdea7d673a21034c5bb2 100644 (file)
 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 };
index 41686cf5b3736baf5eb32c10cd07ad0653ecf927..08056f59acd3f3e0bf000bd8fa03781b66824c3a 100644 (file)
@@ -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 { }
 }
index ca81489e0bdb73cadbb7422740790c35938c06e2..0589ffc79e054ccb66239e28ebf3ae1c15eb8867 100644 (file)
 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) {
index 16c4986fc534583130b256050f40cba873956bbc..e22e739f570ff6ad910c21e90b0d52f1554e2491 100644 (file)
@@ -15,8 +15,8 @@
  *
  * 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 }
 
index 36483f883777d09c70d197d6f1a66b4eb5b68606..4634cc4ef1101cb2ad1c0c570dd4e07d0a604d01 100644 (file)
@@ -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; }
index 564fb1a912cfc5116fcf906d0fa40f05bb86c4cc..03358f2511bb6d0c00b4da71bed2ba32c55ce727 100644 (file)
@@ -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() {
index d37a67d922e61b6ffd008ab234182e5679467dd9..142123478357598249c51c31bab1ea60ec7ab221 100644 (file)
@@ -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() {
index 3ee0808fa95a47d4912302b9c40c2bc410ff88d2..5c72de87ccbefaa0a25d33760e8d9ce08b265dea 100644 (file)
@@ -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); }
index 9538ebc554ccf17637ecee1c5704dbdc36d44297..343e62b2d0c5923d844a4ee74c3bfcc794379d55 100644 (file)
@@ -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 => { ~"#" }
index df102f93c2bb7181567937c7f1bf8bd44ec1a64d..e433141c44dbd34bce971176c2c130f00fe5222a 100644 (file)
@@ -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,
index e813cde7c2760bd63d26992d9648702aedd0df95..aaff822398d6f1df4fa48cd743bbf256d6c7b507 100644 (file)
 
 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()
     }
 }
index ad6cae0bff9b2ccc9af372db8029c8bc32414e2b..fdbd7ec304edd22251aae00984b73fe173fc27fe 100644 (file)
@@ -111,8 +111,7 @@ fn add_pt(&mut self, x: int, y: int)
 // 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)};
 
index 8d62da9efad427991a4f56e8834821e088ff97a2..f54d2f9fafc4e4d59d4cc9895d5c299a6793cc5a 100644 (file)
@@ -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);
 }
index 94edb596b5f73f3695324642af57cd8d4c06f1a4..8628d84d4e7dbfb26cdf390ea756fb5fe50afc4e 100644 (file)
@@ -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 } }
index aad7ded42d3d01d606d5bdbcfa431eba4520bdae..12b41fc91485e30b578f8e77e2cf4b05e3401fc4 100644 (file)
@@ -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()
     }
 }
index 83273a7aae6fc631ffb451fd14a88171ea26031e..ae241e458fc1504657b49ffaadb4b54db929684e 100644 (file)
 
 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));
index 3873cdf615b88c78d55f2add60edf296d0a19b3a..9299e3e365e33dccb3de736177ccd1f9bed3f6d6 100644 (file)
@@ -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() {
index 4b90b99cb31b56e90e991d1fef6df16f3c6a5d1b..127b845ad4ce4d9a89fef13a7787293a1dd22c61 100644 (file)
@@ -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() { }
index b65c33939c878bc6b8c9f1112a8478eb6f0b721e..424a5e4e8efa64f15507b2d576cf822c67a67598 100644 (file)
@@ -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,
index cac6b4ef349329941af62738891cb20242107adf..6327a3f238d41adf4f60b83ef03c53e384ffac15 100644 (file)
@@ -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 @@
     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 @@
     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 @@
 
 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];
index ce9b3b78a9cdaf7aab9e9879bef2552db3f783e7..debde77b21128d08853803e6a500898682218ba7 100644 (file)
@@ -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!") );
 }
index 99db34673aeac110075238065efb9f4b717d76a2..624a38b789b1c9c3e6bbfa03fa61f563ea89c508 100644 (file)
@@ -35,28 +35,25 @@ fn select<A>(&&b: int, +x1: A, +x2: A) -> A {
 
 // 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)
 }
 
index ddf69cda63f121486e0d617dd6bf10d19525ec26..20e6efa11f0903aa9ab190dffee2e4b903c2717d 100644 (file)
@@ -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() {
index f32fc27e3aa0c9c177d9616556a7299f791a199d..d987203344723b351dcf51d4de5811ad72ee3e88 100644 (file)
 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() {
index 2f87142d688243295081f89d7473499605f72d4c..63300342bd33ce2d1f49e6aa0216643d9b1b4d29 100644 (file)
@@ -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() {
index 729e11dfc641568d9c0958d140ec156b89aadd75..4e126379410be9ca5723690f9038e817f97ccc2c 100644 (file)
@@ -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)); }
index c50dfe7916988d061f91f531374b8b20dd7e30b3..89dad2d462ccaa013cada7f93b15628862fdda05 100644 (file)
@@ -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() {
index ce370854a41fe7ff732f963141a09e0fefcb7cae..283ed8ae2c188e5d666b8251c5b40bab23e5ba8c 100644 (file)
@@ -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));
index f97412f420718e03dd212fcd1b7f264852ddacdf..d4d16f2b43ebd432387cd498e507690b739c6876 100644 (file)
@@ -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));
index aadc0650958500db282d34588ca772ca32f2a7d7..d4f8d50b92b647b8b8e738aed8ce6081294c8f06 100644 (file)
@@ -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));
index c1ee7a2c00a222e3e4698a24a6a2f31f1b02ece3..9d0e5fa1f13d4dcee944774017367078ae0abab2 100644 (file)
@@ -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));
index 40f01fb63c1c5288eaf6bea8d7520e6f19798a83..a8a579422a372fe8d0b835cfd66c95ebc42f6dec 100644 (file)
@@ -12,7 +12,7 @@
 
 mod base {
     pub trait HasNew<T> {
-        pure fn new() -> T;
+        fn new() -> T;
     }
 
     pub struct Foo {
@@ -20,7 +20,7 @@ pub struct Foo {
     }
 
     impl ::base::HasNew<Foo> for Foo {
-        pure fn new() -> Foo {
+        fn new() -> Foo {
                        unsafe { io::println("Foo"); }
             Foo { dummy: () }
         }
@@ -31,7 +31,7 @@ pub struct Bar {
     }
 
     impl ::base::HasNew<Bar> for Bar {
-        pure fn new() -> Bar {
+        fn new() -> Bar {
                        unsafe { io::println("Bar"); }
             Bar { dummy: () }
         }
index 8b626611c410caaf1f33c7e489bcb576e01ea25d..4228f72b7caa4c7cb9b17bc14481113ccd3b355d 100644 (file)
@@ -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() {
index a7ac8554b3d4a793baa99dde49e333987712a08b..0af35a6c619e5df9ad196ffbc59bf378fcf62c1d 100644 (file)
@@ -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));