Skip to content

Commit 3eda11a

Browse files
committed
test: Remove pure from the test suite
1 parent fbe22af commit 3eda11a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+153
-158
lines changed

src/test/auxiliary/cci_class_cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub mod kitty {
1818
}
1919

2020
impl ToStr for cat {
21-
pure fn to_str(&self) -> ~str { copy self.name }
21+
fn to_str(&self) -> ~str { copy self.name }
2222
}
2323

2424
priv impl cat {

src/test/auxiliary/crateresolve5-1.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ pub enum e {
2525

2626
pub fn nominal() -> e { e_val }
2727

28-
pub pure fn nominal_eq(e1: e, e2: e) -> bool { true }
28+
pub fn nominal_eq(e1: e, e2: e) -> bool { true }
2929

3030
impl Eq for e {
31-
pure fn eq(&self, other: &e) -> bool { nominal_eq(*self, *other) }
32-
pure fn ne(&self, other: &e) -> bool { !nominal_eq(*self, *other) }
31+
fn eq(&self, other: &e) -> bool { nominal_eq(*self, *other) }
32+
fn ne(&self, other: &e) -> bool { !nominal_eq(*self, *other) }
3333
}
3434

3535
pub fn f() -> int { 10 }

src/test/auxiliary/crateresolve5-2.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ pub enum e {
2323
}
2424

2525
impl Eq for e {
26-
pure fn eq(&self, other: &e) -> bool { !nominal_neq(*self, *other) }
27-
pure fn ne(&self, other: &e) -> bool { nominal_neq(*self, *other) }
26+
fn eq(&self, other: &e) -> bool { !nominal_neq(*self, *other) }
27+
fn ne(&self, other: &e) -> bool { nominal_neq(*self, *other) }
2828
}
2929

3030
pub fn nominal() -> e { e_val }
3131

32-
pub pure fn nominal_neq(e1: e, e2: e) -> bool { false }
32+
pub fn nominal_neq(e1: e, e2: e) -> bool { false }
3333

3434
pub fn f() -> int { 20 }

src/test/auxiliary/impl_privacy_xc_2.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ pub struct Fish {
77
mod unexported {
88
use super::Fish;
99
impl Eq for Fish {
10-
pure fn eq(&self, _: &Fish) -> bool { true }
11-
pure fn ne(&self, _: &Fish) -> bool { false }
10+
fn eq(&self, _: &Fish) -> bool { true }
11+
fn ne(&self, _: &Fish) -> bool { false }
1212
}
1313
}
1414

Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
pub mod num {
22
pub trait Num2 {
3-
pure fn from_int2(n: int) -> Self;
3+
fn from_int2(n: int) -> Self;
44
}
55
}
66

77
pub mod float {
88
impl ::num::Num2 for float {
9-
pure fn from_int2(n: int) -> float { return n as float; }
9+
fn from_int2(n: int) -> float { return n as float; }
1010
}
1111
}

src/test/auxiliary/trait_inheritance_overloading_xc.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ pub struct MyInt {
1818
}
1919

2020
impl Add<MyInt, MyInt> for MyInt {
21-
pure fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) }
21+
fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) }
2222
}
2323

2424
impl Sub<MyInt, MyInt> for MyInt {
25-
pure fn sub(&self, other: &MyInt) -> MyInt { mi(self.val - other.val) }
25+
fn sub(&self, other: &MyInt) -> MyInt { mi(self.val - other.val) }
2626
}
2727

2828
impl Mul<MyInt, MyInt> for MyInt {
29-
pure fn mul(&self, other: &MyInt) -> MyInt { mi(self.val * other.val) }
29+
fn mul(&self, other: &MyInt) -> MyInt { mi(self.val * other.val) }
3030
}
3131

3232
impl Eq for MyInt {
33-
pure fn eq(&self, other: &MyInt) -> bool { self.val == other.val }
33+
fn eq(&self, other: &MyInt) -> bool { self.val == other.val }
3434

35-
pure fn ne(&self, other: &MyInt) -> bool { !self.eq(other) }
35+
fn ne(&self, other: &MyInt) -> bool { !self.eq(other) }
3636
}
3737

3838
impl MyNum for MyInt;
3939

40-
pure fn mi(v: int) -> MyInt { MyInt { val: v } }
40+
fn mi(v: int) -> MyInt { MyInt { val: v } }
4141

src/test/bench/shootout-k-nucleotide-pipes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ fn sort_and_fmt(mm: HashMap<~[u8], uint>, total: uint) -> ~str {
2727
return (xx as float) * 100f / (yy as float);
2828
}
2929

30-
pure fn le_by_val<TT:Copy,UU:Copy + Ord>(kv0: &(TT,UU),
30+
fn le_by_val<TT:Copy,UU:Copy + Ord>(kv0: &(TT,UU),
3131
kv1: &(TT,UU)) -> bool {
3232
let (_, v0) = *kv0;
3333
let (_, v1) = *kv1;
3434
return v0 >= v1;
3535
}
3636

37-
pure fn le_by_key<TT:Copy + Ord,UU:Copy>(kv0: &(TT,UU),
37+
fn le_by_key<TT:Copy + Ord,UU:Copy>(kv0: &(TT,UU),
3838
kv1: &(TT,UU)) -> bool {
3939
let (k0, _) = *kv0;
4040
let (k1, _) = *kv1;

src/test/bench/shootout-mandelbrot.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct cmplx {
3333
}
3434

3535
impl ops::Mul<cmplx,cmplx> for cmplx {
36-
pure fn mul(&self, x: &cmplx) -> cmplx {
36+
fn mul(&self, x: &cmplx) -> cmplx {
3737
cmplx {
3838
re: self.re*(*x).re - self.im*(*x).im,
3939
im: self.re*(*x).im + self.im*(*x).re
@@ -42,7 +42,7 @@ impl ops::Mul<cmplx,cmplx> for cmplx {
4242
}
4343

4444
impl ops::Add<cmplx,cmplx> for cmplx {
45-
pure fn add(&self, x: &cmplx) -> cmplx {
45+
fn add(&self, x: &cmplx) -> cmplx {
4646
cmplx {
4747
re: self.re + (*x).re,
4848
im: self.im + (*x).im
@@ -52,7 +52,7 @@ impl ops::Add<cmplx,cmplx> for cmplx {
5252

5353
struct Line {i: uint, b: ~[u8]}
5454

55-
pure fn cabs(x: cmplx) -> f64
55+
fn cabs(x: cmplx) -> f64
5656
{
5757
x.re*x.re + x.im*x.im
5858
}

src/test/compile-fail/auto-ref-slice-plus-ref.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ fn main() {
2020
}
2121

2222
trait MyIter {
23-
pure fn test_mut(&mut self);
23+
fn test_mut(&mut self);
2424
}
2525

2626
impl MyIter for &'self [int] {
27-
pure fn test_mut(&mut self) { }
27+
fn test_mut(&mut self) { }
2828
}

src/test/compile-fail/borrowck-loan-in-overloaded-op.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
struct foo(~uint);
1414

1515
impl Add<foo, foo> for foo {
16-
pure fn add(f: &foo) -> foo {
16+
fn add(f: &foo) -> foo {
1717
foo(~(**self + **(*f)))
1818
}
1919
}

src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct Point {
1414
}
1515

1616
impl ops::Add<int,int> for Point {
17-
pure fn add(&self, z: &int) -> int {
17+
fn add(&self, z: &int) -> int {
1818
self.x + self.y + (*z)
1919
}
2020
}

src/test/compile-fail/borrowck-loan-rcvr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct point { x: int, y: int }
1313
trait methods {
1414
fn impurem(&self);
1515
fn blockm(&self, f: &fn());
16-
pure fn purem(&self);
16+
fn purem(&self);
1717
}
1818

1919
impl methods for point {
@@ -22,7 +22,7 @@ impl methods for point {
2222

2323
fn blockm(&self, f: &fn()) { f() }
2424

25-
pure fn purem(&self) {
25+
fn purem(&self) {
2626
}
2727
}
2828

src/test/compile-fail/issue-3344.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
struct thing(uint);
1212
impl cmp::Ord for thing { //~ ERROR missing method `gt`
13-
pure fn lt(&self, other: &thing) -> bool { **self < **other }
14-
pure fn le(&self, other: &thing) -> bool { **self < **other }
15-
pure fn ge(&self, other: &thing) -> bool { **self < **other }
13+
fn lt(&self, other: &thing) -> bool { **self < **other }
14+
fn le(&self, other: &thing) -> bool { **self < **other }
15+
fn ge(&self, other: &thing) -> bool { **self < **other }
1616
}
1717
fn main() {}

src/test/compile-fail/issue-3707.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ struct Obj {
1414
}
1515

1616
pub impl Obj {
17-
pure fn boom() -> bool {
17+
fn boom() -> bool {
1818
return 1+1 == 2
1919
}
20-
pure fn chirp() {
20+
fn chirp() {
2121
self.boom(); //~ ERROR wat
2222
}
2323
}

src/test/compile-fail/issue-3820.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct Thing {
1414
}
1515

1616
impl Mul<int, Thing>*/ for Thing/* { //~ ERROR Look ma, no Mul!
17-
pure fn mul(c: &int) -> Thing {
17+
fn mul(c: &int) -> Thing {
1818
Thing {x: self.x * *c}
1919
}
2020
}

src/test/compile-fail/issue-3953.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ struct Lol(int);
2525
impl Hahaha for Lol { }
2626

2727
impl Eq for Lol {
28-
pure fn eq(&self, other: &Lol) -> bool { **self != **other }
29-
pure fn ne(&self, other: &Lol) -> bool { **self == **other }
28+
fn eq(&self, other: &Lol) -> bool { **self != **other }
29+
fn ne(&self, other: &Lol) -> bool { **self == **other }
3030
}
3131

3232
fn main() {

src/test/compile-fail/issue-3973.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl ToStr for Point { //~ ERROR implements a method not defined in the trait
2020
Point { x: x, y: y }
2121
}
2222

23-
pure fn to_str(&self) -> ~str {
23+
fn to_str(&self) -> ~str {
2424
fmt!("(%f, %f)", self.x, self.y)
2525
}
2626
}

src/test/compile-fail/missing-derivable-attr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
// except according to those terms.
1010

1111
trait MyEq {
12-
pure fn eq(&self, other: &Self) -> bool;
12+
fn eq(&self, other: &Self) -> bool;
1313
}
1414

1515
struct A {
1616
x: int
1717
}
1818

1919
impl MyEq for int {
20-
pure fn eq(&self, other: &int) -> bool { *self == *other }
20+
fn eq(&self, other: &int) -> bool { *self == *other }
2121
}
2222

2323
impl MyEq for A; //~ ERROR missing method

src/test/run-fail/die-macro-pure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// error-pattern:test
22

3-
pure fn f() {
3+
fn f() {
44
fail!(~"test");
55
}
66

src/test/run-fail/if-check-fail.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// error-pattern:Number is odd
12-
pure fn even(x: uint) -> bool {
12+
fn even(x: uint) -> bool {
1313
if x < 2u {
1414
return false;
1515
} else if x == 2u { return true; } else { return even(x - 2u); }

src/test/run-pass/auto-encode.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ enum Expr {
6060
}
6161

6262
impl cmp::Eq for Expr {
63-
pure fn eq(&self, other: &Expr) -> bool {
63+
fn eq(&self, other: &Expr) -> bool {
6464
match *self {
6565
Val(e0a) => {
6666
match *other {
@@ -82,18 +82,18 @@ impl cmp::Eq for Expr {
8282
}
8383
}
8484
}
85-
pure fn ne(&self, other: &Expr) -> bool { !(*self).eq(other) }
85+
fn ne(&self, other: &Expr) -> bool { !(*self).eq(other) }
8686
}
8787

8888
impl cmp::Eq for Point {
89-
pure fn eq(&self, other: &Point) -> bool {
89+
fn eq(&self, other: &Point) -> bool {
9090
self.x == other.x && self.y == other.y
9191
}
92-
pure fn ne(&self, other: &Point) -> bool { !(*self).eq(other) }
92+
fn ne(&self, other: &Point) -> bool { !(*self).eq(other) }
9393
}
9494

9595
impl<T:cmp::Eq> cmp::Eq for Quark<T> {
96-
pure fn eq(&self, other: &Quark<T>) -> bool {
96+
fn eq(&self, other: &Quark<T>) -> bool {
9797
match *self {
9898
Top(ref q) => {
9999
match *other {
@@ -109,14 +109,14 @@ impl<T:cmp::Eq> cmp::Eq for Quark<T> {
109109
},
110110
}
111111
}
112-
pure fn ne(&self, other: &Quark<T>) -> bool { !(*self).eq(other) }
112+
fn ne(&self, other: &Quark<T>) -> bool { !(*self).eq(other) }
113113
}
114114

115115
impl cmp::Eq for CLike {
116-
pure fn eq(&self, other: &CLike) -> bool {
116+
fn eq(&self, other: &CLike) -> bool {
117117
(*self) as int == *other as int
118118
}
119-
pure fn ne(&self, other: &CLike) -> bool { !self.eq(other) }
119+
fn ne(&self, other: &CLike) -> bool { !self.eq(other) }
120120
}
121121

122122
#[auto_encode]

src/test/run-pass/auto-ref-slice-plus-ref.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
// and also references them to create the &self pointer
1313

1414
trait MyIter {
15-
pure fn test_imm(&self);
16-
pure fn test_const(&const self);
15+
fn test_imm(&self);
16+
fn test_const(&const self);
1717
}
1818

1919
impl MyIter for &'self [int] {
20-
pure fn test_imm(&self) { fail_unless!(self[0] == 1) }
21-
pure fn test_const(&const self) { fail_unless!(self[0] == 1) }
20+
fn test_imm(&self) { fail_unless!(self[0] == 1) }
21+
fn test_const(&const self) { fail_unless!(self[0] == 1) }
2222
}
2323

2424
impl MyIter for &'self str {
25-
pure fn test_imm(&self) { fail_unless!(*self == "test") }
26-
pure fn test_const(&const self) { fail_unless!(*self == "test") }
25+
fn test_imm(&self) { fail_unless!(*self == "test") }
26+
fn test_const(&const self) { fail_unless!(*self == "test") }
2727
}
2828

2929
pub fn main() {

0 commit comments

Comments
 (0)