Skip to content

Commit 4634f7e

Browse files
committed
librustc: Remove all uses of static from functions. rs=destatic
1 parent 1616ffd commit 4634f7e

Some content is hidden

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

79 files changed

+281
-286
lines changed

src/libcore/bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub pure fn is_false(v: bool) -> bool { !v }
4949

5050
/// Parse logic value from `s`
5151
impl FromStr for bool {
52-
static pure fn from_str(s: &str) -> Option<bool> {
52+
pure fn from_str(s: &str) -> Option<bool> {
5353
if s == "true" {
5454
Some(true)
5555
} else if s == "false" {

src/libcore/dlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub fn concat<T>(lists: @mut DList<@mut DList<T>>) -> @mut DList<T> {
126126
}
127127
128128
priv impl<T> DList<T> {
129-
static pure fn new_link(data: T) -> DListLink<T> {
129+
pure fn new_link(data: T) -> DListLink<T> {
130130
Some(@mut DListNode {
131131
data: data,
132132
linked: true,

src/libcore/from_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
use option::Option;
1414

1515
pub trait FromStr {
16-
static pure fn from_str(s: &str) -> Option<Self>;
16+
pure fn from_str(s: &str) -> Option<Self>;
1717
}

src/libcore/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ pub mod linear {
373373
374374
pub impl<K:Hash + IterBytes + Eq,V> LinearMap<K, V> {
375375
/// Create an empty LinearMap
376-
static fn new() -> LinearMap<K, V> {
376+
fn new() -> LinearMap<K, V> {
377377
linear_map_with_capacity(INITIAL_CAPACITY)
378378
}
379379
@@ -639,7 +639,7 @@ pub mod linear {
639639

640640
pub impl <T:Hash + IterBytes + Eq> LinearSet<T> {
641641
/// Create an empty LinearSet
642-
static fn new() -> LinearSet<T> { LinearSet{map: LinearMap::new()} }
642+
fn new() -> LinearSet<T> { LinearSet{map: LinearMap::new()} }
643643

644644
/// Reserve space for at least `n` elements in the hash table.
645645
fn reserve_at_least(&mut self, n: uint) {

src/libcore/iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ pub trait Buildable<A> {
8989
* as an argument a function that will push an element
9090
* onto the sequence being constructed.
9191
*/
92-
static pure fn build_sized(size: uint,
93-
builder: &fn(push: &pure fn(A))) -> Self;
92+
pure fn build_sized(size: uint,
93+
builder: &fn(push: &pure fn(A))) -> Self;
9494
}
9595

9696
#[inline(always)]

src/libcore/num/f32.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,20 +277,20 @@ impl cmp::Ord for f32 {
277277

278278
impl num::Zero for f32 {
279279
#[inline(always)]
280-
static pure fn zero() -> f32 { 0.0 }
280+
pure fn zero() -> f32 { 0.0 }
281281
}
282282

283283
impl num::One for f32 {
284284
#[inline(always)]
285-
static pure fn one() -> f32 { 1.0 }
285+
pure fn one() -> f32 { 1.0 }
286286
}
287287

288288
impl NumCast for f32 {
289289
/**
290290
* Cast `n` to an `f32`
291291
*/
292292
#[inline(always)]
293-
static pure fn from<N:NumCast>(n: N) -> f32 { n.to_f32() }
293+
pure fn from<N:NumCast>(n: N) -> f32 { n.to_f32() }
294294

295295
#[inline(always)] pure fn to_u8(&self) -> u8 { *self as u8 }
296296
#[inline(always)] pure fn to_u16(&self) -> u16 { *self as u16 }
@@ -568,12 +568,12 @@ pub pure fn from_str_radix(num: &str, rdx: uint) -> Option<f32> {
568568

569569
impl from_str::FromStr for f32 {
570570
#[inline(always)]
571-
static pure fn from_str(val: &str) -> Option<f32> { from_str(val) }
571+
pure fn from_str(val: &str) -> Option<f32> { from_str(val) }
572572
}
573573

574574
impl num::FromStrRadix for f32 {
575575
#[inline(always)]
576-
static pure fn from_str_radix(val: &str, rdx: uint) -> Option<f32> {
576+
pure fn from_str_radix(val: &str, rdx: uint) -> Option<f32> {
577577
from_str_radix(val, rdx)
578578
}
579579
}

src/libcore/num/f64.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl NumCast for f64 {
304304
* Cast `n` to an `f64`
305305
*/
306306
#[inline(always)]
307-
static pure fn from<N:NumCast>(n: N) -> f64 { n.to_f64() }
307+
pure fn from<N:NumCast>(n: N) -> f64 { n.to_f64() }
308308

309309
#[inline(always)] pure fn to_u8(&self) -> u8 { *self as u8 }
310310
#[inline(always)] pure fn to_u16(&self) -> u16 { *self as u16 }
@@ -325,12 +325,12 @@ impl NumCast for f64 {
325325

326326
impl num::Zero for f64 {
327327
#[inline(always)]
328-
static pure fn zero() -> f64 { 0.0 }
328+
pure fn zero() -> f64 { 0.0 }
329329
}
330330

331331
impl num::One for f64 {
332332
#[inline(always)]
333-
static pure fn one() -> f64 { 1.0 }
333+
pure fn one() -> f64 { 1.0 }
334334
}
335335

336336
#[cfg(notest)]
@@ -592,12 +592,12 @@ pub pure fn from_str_radix(num: &str, rdx: uint) -> Option<f64> {
592592

593593
impl from_str::FromStr for f64 {
594594
#[inline(always)]
595-
static pure fn from_str(val: &str) -> Option<f64> { from_str(val) }
595+
pure fn from_str(val: &str) -> Option<f64> { from_str(val) }
596596
}
597597

598598
impl num::FromStrRadix for f64 {
599599
#[inline(always)]
600-
static pure fn from_str_radix(val: &str, rdx: uint) -> Option<f64> {
600+
pure fn from_str_radix(val: &str, rdx: uint) -> Option<f64> {
601601
from_str_radix(val, rdx)
602602
}
603603
}

src/libcore/num/float.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,12 @@ pub pure fn from_str_radix(num: &str, radix: uint) -> Option<float> {
304304
305305
impl from_str::FromStr for float {
306306
#[inline(always)]
307-
static pure fn from_str(val: &str) -> Option<float> { from_str(val) }
307+
pure fn from_str(val: &str) -> Option<float> { from_str(val) }
308308
}
309309
310310
impl num::FromStrRadix for float {
311311
#[inline(always)]
312-
static pure fn from_str_radix(val: &str, radix: uint) -> Option<float> {
312+
pure fn from_str_radix(val: &str, radix: uint) -> Option<float> {
313313
from_str_radix(val, radix)
314314
}
315315
}
@@ -408,20 +408,20 @@ impl Ord for float {
408408
409409
impl num::Zero for float {
410410
#[inline(always)]
411-
static pure fn zero() -> float { 0.0 }
411+
pure fn zero() -> float { 0.0 }
412412
}
413413
414414
impl num::One for float {
415415
#[inline(always)]
416-
static pure fn one() -> float { 1.0 }
416+
pure fn one() -> float { 1.0 }
417417
}
418418
419419
impl NumCast for float {
420420
/**
421421
* Cast `n` to a `float`
422422
*/
423423
#[inline(always)]
424-
static pure fn from<N:NumCast>(n: N) -> float { n.to_float() }
424+
pure fn from<N:NumCast>(n: N) -> float { n.to_float() }
425425
426426
#[inline(always)] pure fn to_u8(&self) -> u8 { *self as u8 }
427427
#[inline(always)] pure fn to_u16(&self) -> u16 { *self as u16 }

src/libcore/num/int-template.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ impl Eq for T {
163163
164164
impl num::Zero for T {
165165
#[inline(always)]
166-
static pure fn zero() -> T { 0 }
166+
pure fn zero() -> T { 0 }
167167
}
168168
169169
impl num::One for T {
170170
#[inline(always)]
171-
static pure fn one() -> T { 1 }
171+
pure fn one() -> T { 1 }
172172
}
173173
174174
#[cfg(notest)]
@@ -221,14 +221,14 @@ pub pure fn parse_bytes(buf: &[u8], radix: uint) -> Option<T> {
221221
222222
impl FromStr for T {
223223
#[inline(always)]
224-
static pure fn from_str(s: &str) -> Option<T> {
224+
pure fn from_str(s: &str) -> Option<T> {
225225
from_str(s)
226226
}
227227
}
228228
229229
impl FromStrRadix for T {
230230
#[inline(always)]
231-
static pure fn from_str_radix(&self, s: &str, radix: uint) -> Option<T> {
231+
pure fn from_str_radix(s: &str, radix: uint) -> Option<T> {
232232
from_str_radix(s, radix)
233233
}
234234
}

src/libcore/num/int-template/i16.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl NumCast for i16 {
2222
* Cast `n` to a `i16`
2323
*/
2424
#[inline(always)]
25-
static pure fn from<N:NumCast>(n: N) -> i16 { n.to_i16() }
25+
pure fn from<N:NumCast>(n: N) -> i16 { n.to_i16() }
2626

2727
#[inline(always)] pure fn to_u8(&self) -> u8 { *self as u8 }
2828
#[inline(always)] pure fn to_u16(&self) -> u16 { *self as u16 }

0 commit comments

Comments
 (0)