From 5bcb63983680b0953c8125f375e53db8d64a5dc8 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 17 Aug 2013 17:58:00 -0700 Subject: [PATCH] std::rt: Remove extra boxes from MessageQueue and SleeperList --- src/libstd/rt/message_queue.rs | 7 +++---- src/libstd/rt/sleeper_list.rs | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/libstd/rt/message_queue.rs b/src/libstd/rt/message_queue.rs index 8518ddaeae1..d58c0120803 100644 --- a/src/libstd/rt/message_queue.rs +++ b/src/libstd/rt/message_queue.rs @@ -20,14 +20,13 @@ use unstable::sync::Exclusive; use clone::Clone; pub struct MessageQueue { - // XXX: Another mystery bug fixed by boxing this lock - priv queue: ~Exclusive<~[T]> + priv queue: Exclusive<~[T]> } impl MessageQueue { pub fn new() -> MessageQueue { MessageQueue { - queue: ~Exclusive::new(~[]) + queue: Exclusive::new(~[]) } } @@ -51,7 +50,7 @@ impl MessageQueue { } } -impl Clone for MessageQueue { +impl Clone for MessageQueue { fn clone(&self) -> MessageQueue { MessageQueue { queue: self.queue.clone() diff --git a/src/libstd/rt/sleeper_list.rs b/src/libstd/rt/sleeper_list.rs index d327023de97..967fde6f371 100644 --- a/src/libstd/rt/sleeper_list.rs +++ b/src/libstd/rt/sleeper_list.rs @@ -20,13 +20,13 @@ use rt::sched::SchedHandle; use clone::Clone; pub struct SleeperList { - priv stack: ~Exclusive<~[SchedHandle]> + priv stack: Exclusive<~[SchedHandle]> } impl SleeperList { pub fn new() -> SleeperList { SleeperList { - stack: ~Exclusive::new(~[]) + stack: Exclusive::new(~[]) } } @@ -56,4 +56,4 @@ impl Clone for SleeperList { stack: self.stack.clone() } } -} \ No newline at end of file +}