From 4634f7edaefafa3e5ece93499e08992b4c8c7145 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 21 Mar 2013 19:07:54 -0700 Subject: librustc: Remove all uses of `static` from functions. rs=destatic --- src/libsyntax/ast.rs | 2 +- src/libsyntax/codemap.rs | 10 +++++----- src/libsyntax/ext/auto_encode.rs | 4 ++-- src/libsyntax/ext/base.rs | 2 +- src/libsyntax/util/interner.rs | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index cbdcef3eff6..edf73155731 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -75,7 +75,7 @@ impl Encodable for ident { } impl Decodable for ident { - static fn decode(d: &D) -> ident { + fn decode(d: &D) -> ident { let intr = match unsafe { task::local_data::local_data_get(interner_key!()) } { diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index c84e3abf50b..06d915cfed8 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -30,7 +30,7 @@ use core::uint; use std::serialize::{Encodable, Decodable, Encoder, Decoder}; pub trait Pos { - static pure fn from_uint(n: uint) -> Self; + pure fn from_uint(n: uint) -> Self; pure fn to_uint(&self) -> uint; } @@ -45,7 +45,7 @@ pub struct CharPos(uint); // have been unsuccessful impl Pos for BytePos { - static pure fn from_uint(n: uint) -> BytePos { BytePos(n) } + pure fn from_uint(n: uint) -> BytePos { BytePos(n) } pure fn to_uint(&self) -> uint { **self } } @@ -80,7 +80,7 @@ impl to_bytes::IterBytes for BytePos { } impl Pos for CharPos { - static pure fn from_uint(n: uint) -> CharPos { CharPos(n) } + pure fn from_uint(n: uint) -> CharPos { CharPos(n) } pure fn to_uint(&self) -> uint { **self } } @@ -144,7 +144,7 @@ impl Encodable for span { } impl Decodable for span { - static fn decode(_d: &D) -> span { + fn decode(_d: &D) -> span { dummy_sp() } } @@ -286,7 +286,7 @@ pub struct CodeMap { } pub impl CodeMap { - static pub fn new() -> CodeMap { + pub fn new() -> CodeMap { CodeMap { files: @mut ~[], } diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index e5f818eef5c..54ca5dc0d72 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -32,7 +32,7 @@ impl Encodable for Node { } impl Decodable for node_id { - static fn decode(d: &D) -> Node { + fn decode(d: &D) -> Node { do d.read_struct("Node", 1) { Node { id: d.read_field(~"x", 0, || decode(d)) @@ -66,7 +66,7 @@ would yield functions like: D: Decoder, T: Decodable > spanned: Decodable { - static fn decode(d: &D) -> spanned { + fn decode(d: &D) -> spanned { do d.read_rec { { node: d.read_field(~"node", 0, || decode(d)), diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 50f89d37fae..4e3b4f2739e 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -439,7 +439,7 @@ pub enum MapChain { impl MapChain{ // Constructor. I don't think we need a zero-arg one. - static fn new(+init: ~LinearMap) -> @mut MapChain { + fn new(+init: ~LinearMap) -> @mut MapChain { @mut BaseMapChain(init) } diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index b4a85ce1617..d0850d2bd2a 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -22,14 +22,14 @@ pub struct Interner { // when traits can extend traits, we should extend index to get [] pub impl Interner { - static fn new() -> Interner { + fn new() -> Interner { Interner { map: @mut LinearMap::new(), vect: @mut ~[], } } - static fn prefill(init: &[T]) -> Interner { + fn prefill(init: &[T]) -> Interner { let rv = Interner::new(); for init.each() |v| { rv.intern(*v); } rv -- cgit 1.4.1-3-g733a5