diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-03-21 19:07:54 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-03-22 10:27:39 -0700 |
| commit | 4634f7edaefafa3e5ece93499e08992b4c8c7145 (patch) | |
| tree | aa695c6ea7ffa0d19919584e9636b3f78b1f40ab /src/libcore/rt | |
| parent | 1616ffd0c2627502b1015b6388480ed7429ef042 (diff) | |
| download | rust-4634f7edaefafa3e5ece93499e08992b4c8c7145.tar.gz rust-4634f7edaefafa3e5ece93499e08992b4c8c7145.zip | |
librustc: Remove all uses of `static` from functions. rs=destatic
Diffstat (limited to 'src/libcore/rt')
| -rw-r--r-- | src/libcore/rt/context.rs | 6 | ||||
| -rw-r--r-- | src/libcore/rt/sched.rs | 12 | ||||
| -rw-r--r-- | src/libcore/rt/stack.rs | 4 | ||||
| -rw-r--r-- | src/libcore/rt/thread.rs | 2 | ||||
| -rw-r--r-- | src/libcore/rt/uv.rs | 24 | ||||
| -rw-r--r-- | src/libcore/rt/uvio.rs | 6 | ||||
| -rw-r--r-- | src/libcore/rt/work_queue.rs | 2 |
7 files changed, 28 insertions, 28 deletions
diff --git a/src/libcore/rt/context.rs b/src/libcore/rt/context.rs index dfb7bdf04c3..8da80f7a4e8 100644 --- a/src/libcore/rt/context.rs +++ b/src/libcore/rt/context.rs @@ -19,14 +19,14 @@ use cast::{transmute, transmute_mut_unsafe, pub struct Context(~Registers); pub impl Context { - static fn empty() -> Context { + fn empty() -> Context { Context(new_regs()) } /// Create a new context that will resume execution by running ~fn() /// # Safety Note /// The `start` closure must remain valid for the life of the Task - static fn new(start: &~fn(), stack: &mut StackSegment) -> Context { + fn new(start: &~fn(), stack: &mut StackSegment) -> Context { // The C-ABI function that is the task entry point extern fn task_start_wrapper(f: &~fn()) { (*f)() } @@ -49,7 +49,7 @@ pub impl Context { return Context(regs); } - static fn swap(out_context: &mut Context, in_context: &Context) { + fn swap(out_context: &mut Context, in_context: &Context) { let out_regs: &mut Registers = match out_context { &Context(~ref mut r) => r }; diff --git a/src/libcore/rt/sched.rs b/src/libcore/rt/sched.rs index 60dbc8b82da..4a140458fd3 100644 --- a/src/libcore/rt/sched.rs +++ b/src/libcore/rt/sched.rs @@ -50,11 +50,11 @@ pub struct Scheduler { // complaining type UnsafeTaskReceiver = sys::Closure; trait HackAroundBorrowCk { - static fn from_fn(&fn(&mut Scheduler, ~Task)) -> Self; + fn from_fn(&fn(&mut Scheduler, ~Task)) -> Self; fn to_fn(self) -> &fn(&mut Scheduler, ~Task); } impl HackAroundBorrowCk for UnsafeTaskReceiver { - static fn from_fn(f: &fn(&mut Scheduler, ~Task)) -> UnsafeTaskReceiver { + fn from_fn(f: &fn(&mut Scheduler, ~Task)) -> UnsafeTaskReceiver { unsafe { transmute(f) } } fn to_fn(self) -> &fn(&mut Scheduler, ~Task) { @@ -70,7 +70,7 @@ enum CleanupJob { pub impl Scheduler { - static pub fn new(event_loop: ~EventLoopObject) -> Scheduler { + pub fn new(event_loop: ~EventLoopObject) -> Scheduler { Scheduler { event_loop: event_loop, task_queue: WorkQueue::new(), @@ -114,7 +114,7 @@ pub impl Scheduler { return tlsched.take_scheduler(); } - static fn local(f: &fn(&mut Scheduler)) { + fn local(f: &fn(&mut Scheduler)) { let mut tlsched = ThreadLocalScheduler::new(); f(tlsched.get_scheduler()); } @@ -296,7 +296,7 @@ pub struct Task { } impl Task { - static pub fn new(stack_pool: &mut StackPool, start: ~fn()) -> Task { + pub fn new(stack_pool: &mut StackPool, start: ~fn()) -> Task { // XXX: Putting main into a ~ so it's a thin pointer and can // be passed to the spawn function. Another unfortunate // allocation @@ -337,7 +337,7 @@ impl Task { struct ThreadLocalScheduler(tls::Key); impl ThreadLocalScheduler { - static fn new() -> ThreadLocalScheduler { + fn new() -> ThreadLocalScheduler { unsafe { // NB: This assumes that the TLS key has been created prior. // Currently done in rust_start. diff --git a/src/libcore/rt/stack.rs b/src/libcore/rt/stack.rs index b5e7d4f3aa2..9b164eb08fa 100644 --- a/src/libcore/rt/stack.rs +++ b/src/libcore/rt/stack.rs @@ -15,7 +15,7 @@ pub struct StackSegment { } pub impl StackSegment { - static fn new(size: uint) -> StackSegment { + fn new(size: uint) -> StackSegment { // Crate a block of uninitialized values let mut stack = vec::with_capacity(size); unsafe { @@ -37,7 +37,7 @@ pub impl StackSegment { pub struct StackPool(()); impl StackPool { - static pub fn new() -> StackPool { StackPool(()) } + pub fn new() -> StackPool { StackPool(()) } fn take_segment(&self, min_size: uint) -> StackSegment { StackSegment::new(min_size) diff --git a/src/libcore/rt/thread.rs b/src/libcore/rt/thread.rs index 5dccf90096e..c45e4295ab1 100644 --- a/src/libcore/rt/thread.rs +++ b/src/libcore/rt/thread.rs @@ -20,7 +20,7 @@ struct Thread { } impl Thread { - static pub fn start(main: ~fn()) -> Thread { + pub fn start(main: ~fn()) -> Thread { fn substart(main: &fn()) -> *raw_thread { unsafe { rust_raw_thread_start(&main) } } diff --git a/src/libcore/rt/uv.rs b/src/libcore/rt/uv.rs index e57d0f51870..251f2a4a12b 100644 --- a/src/libcore/rt/uv.rs +++ b/src/libcore/rt/uv.rs @@ -74,7 +74,7 @@ impl Callback for NullCallback { } /// A type that wraps a native handle trait NativeHandle<T> { - static pub fn from_native_handle(T) -> Self; + pub fn from_native_handle(T) -> Self; pub fn native_handle(&self) -> T; } @@ -86,7 +86,7 @@ pub struct Loop { } pub impl Loop { - static fn new() -> Loop { + fn new() -> Loop { let handle = unsafe { uvll::loop_new() }; fail_unless!(handle.is_not_null()); NativeHandle::from_native_handle(handle) @@ -102,7 +102,7 @@ pub impl Loop { } impl NativeHandle<*uvll::uv_loop_t> for Loop { - static fn from_native_handle(handle: *uvll::uv_loop_t) -> Loop { + fn from_native_handle(handle: *uvll::uv_loop_t) -> Loop { Loop { handle: handle } } fn native_handle(&self) -> *uvll::uv_loop_t { @@ -132,7 +132,7 @@ type IdleCallback = ~fn(IdleWatcher, Option<UvError>); impl Callback for IdleCallback { } pub impl IdleWatcher { - static fn new(loop_: &mut Loop) -> IdleWatcher { + fn new(loop_: &mut Loop) -> IdleWatcher { unsafe { let handle = uvll::idle_new(); fail_unless!(handle.is_not_null()); @@ -177,7 +177,7 @@ pub impl IdleWatcher { } impl NativeHandle<*uvll::uv_idle_t> for IdleWatcher { - static fn from_native_handle(handle: *uvll::uv_idle_t) -> IdleWatcher { + fn from_native_handle(handle: *uvll::uv_idle_t) -> IdleWatcher { IdleWatcher(handle) } fn native_handle(&self) -> *uvll::uv_idle_t { @@ -307,7 +307,7 @@ pub impl StreamWatcher { } impl NativeHandle<*uvll::uv_stream_t> for StreamWatcher { - static fn from_native_handle( + fn from_native_handle( handle: *uvll::uv_stream_t) -> StreamWatcher { StreamWatcher(handle) } @@ -328,7 +328,7 @@ type ConnectionCallback = ~fn(StreamWatcher, Option<UvError>); impl Callback for ConnectionCallback { } pub impl TcpWatcher { - static fn new(loop_: &mut Loop) -> TcpWatcher { + fn new(loop_: &mut Loop) -> TcpWatcher { unsafe { let size = size_of::<uvll::uv_tcp_t>() as size_t; let handle = malloc(size) as *uvll::uv_tcp_t; @@ -421,7 +421,7 @@ pub impl TcpWatcher { } impl NativeHandle<*uvll::uv_tcp_t> for TcpWatcher { - static fn from_native_handle(handle: *uvll::uv_tcp_t) -> TcpWatcher { + fn from_native_handle(handle: *uvll::uv_tcp_t) -> TcpWatcher { TcpWatcher(handle) } fn native_handle(&self) -> *uvll::uv_tcp_t { @@ -441,7 +441,7 @@ impl Request for ConnectRequest { } impl ConnectRequest { - static fn new() -> ConnectRequest { + fn new() -> ConnectRequest { let connect_handle = unsafe { malloc(size_of::<uvll::uv_connect_t>() as size_t) }; @@ -465,7 +465,7 @@ impl ConnectRequest { } impl NativeHandle<*uvll::uv_connect_t> for ConnectRequest { - static fn from_native_handle( + fn from_native_handle( handle: *uvll:: uv_connect_t) -> ConnectRequest { ConnectRequest(handle) } @@ -480,7 +480,7 @@ impl Request for WriteRequest { } impl WriteRequest { - static fn new() -> WriteRequest { + fn new() -> WriteRequest { let write_handle = unsafe { malloc(size_of::<uvll::uv_write_t>() as size_t) }; @@ -503,7 +503,7 @@ impl WriteRequest { } impl NativeHandle<*uvll::uv_write_t> for WriteRequest { - static fn from_native_handle(handle: *uvll:: uv_write_t) -> WriteRequest { + fn from_native_handle(handle: *uvll:: uv_write_t) -> WriteRequest { WriteRequest(handle) } fn native_handle(&self) -> *uvll::uv_write_t { diff --git a/src/libcore/rt/uvio.rs b/src/libcore/rt/uvio.rs index a971ed92b7e..58a4a65ca90 100644 --- a/src/libcore/rt/uvio.rs +++ b/src/libcore/rt/uvio.rs @@ -29,14 +29,14 @@ pub struct UvEventLoop { } pub impl UvEventLoop { - static fn new() -> UvEventLoop { + fn new() -> UvEventLoop { UvEventLoop { uvio: UvIoFactory(Loop::new()) } } /// A convenience constructor - static fn new_scheduler() -> Scheduler { + fn new_scheduler() -> Scheduler { Scheduler::new(~UvEventLoop::new()) } } @@ -221,7 +221,7 @@ impl TcpListener for UvTcpListener { pub struct UvStream(StreamWatcher); impl UvStream { - static fn new(watcher: StreamWatcher) -> UvStream { + fn new(watcher: StreamWatcher) -> UvStream { UvStream(watcher) } diff --git a/src/libcore/rt/work_queue.rs b/src/libcore/rt/work_queue.rs index 1be2eb26e62..dfa88b783c5 100644 --- a/src/libcore/rt/work_queue.rs +++ b/src/libcore/rt/work_queue.rs @@ -15,7 +15,7 @@ pub struct WorkQueue<T> { } pub impl<T> WorkQueue<T> { - static fn new() -> WorkQueue<T> { + fn new() -> WorkQueue<T> { WorkQueue { queue: ~[] } |
