about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-02-21 08:35:12 -0800
committerbors <bors@rust-lang.org>2013-02-21 08:35:12 -0800
commitc0218fb10667a198b41e4d140f8d0760e27ca5e7 (patch)
tree79b8645af15e6fddbf895be80f8892329b9f62d7 /src/libstd
parent41a4151173df5cd93089e40238205c6356835807 (diff)
parentc0defda4994b2cf292901c24bef88b37a088861e (diff)
downloadrust-c0218fb10667a198b41e4d140f8d0760e27ca5e7.tar.gz
rust-c0218fb10667a198b41e4d140f8d0760e27ca5e7.zip
auto merge of #5069 : pcwalton/rust/plussing-2, r=pcwalton
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/flatpipes.rs10
-rw-r--r--src/libstd/workcache.rs28
2 files changed, 13 insertions, 25 deletions
diff --git a/src/libstd/flatpipes.rs b/src/libstd/flatpipes.rs
index f97e5ee6800..80f93323a8e 100644
--- a/src/libstd/flatpipes.rs
+++ b/src/libstd/flatpipes.rs
@@ -151,7 +151,7 @@ pub mod serial {
     }
 
     /// Create a pair of `FlatChan` and `FlatPort`, backed by pipes
-    pub fn pipe_stream<T: Encodable<DefaultEncoder>
+    pub fn pipe_stream<T: Encodable<DefaultEncoder> +
                           Decodable<DefaultDecoder>>(
                           ) -> (PipePort<T>, PipeChan<T>) {
         let (port, chan) = pipes::stream();
@@ -443,8 +443,8 @@ pub mod flatteners {
     SerializingFlattener
     */
 
-    pub fn deserialize_buffer<D: Decoder FromReader,
-                          T: Decodable<D>>(buf: &[u8]) -> T {
+    pub fn deserialize_buffer<D: Decoder + FromReader,
+                              T: Decodable<D>>(buf: &[u8]) -> T {
         let buf = vec::from_slice(buf);
         let buf_reader = @BufReader::new(buf);
         let reader = buf_reader as @Reader;
@@ -452,8 +452,8 @@ pub mod flatteners {
         Decodable::decode(&deser)
     }
 
-    pub fn serialize_value<D: Encoder FromWriter,
-                       T: Encodable<D>>(val: &T) -> ~[u8] {
+    pub fn serialize_value<D: Encoder + FromWriter,
+                           T: Encodable<D>>(val: &T) -> ~[u8] {
         let bytes_writer = @BytesWriter();
         let writer = bytes_writer as @Writer;
         let ser = FromWriter::from_writer(writer);
diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs
index 4de7c1b9925..a06dee723c8 100644
--- a/src/libstd/workcache.rs
+++ b/src/libstd/workcache.rs
@@ -260,9 +260,7 @@ impl Context {
         Context{db: db, logger: lg, cfg: cfg, freshness: LinearMap::new()}
     }
 
-    fn prep<T:Owned
-              Encodable<json::Encoder>
-              Decodable<json::Decoder>>(
+    fn prep<T:Owned + Encodable<json::Encoder> + Decodable<json::Decoder>>(
                   @self,
                   fn_name:&str,
                   blk: fn(@Mut<Prep>)->Work<T>) -> Work<T> {
@@ -278,9 +276,8 @@ trait TPrep {
     fn declare_input(&self, kind:&str, name:&str, val:&str);
     fn is_fresh(&self, cat:&str, kind:&str, name:&str, val:&str) -> bool;
     fn all_fresh(&self, cat:&str, map:&WorkMap) -> bool;
-    fn exec<T:Owned
-        Encodable<json::Encoder>
-        Decodable<json::Decoder>>(&self, blk: ~fn(&Exec) -> T) -> Work<T>;
+    fn exec<T:Owned + Encodable<json::Encoder> + Decodable<json::Decoder>>(
+        &self, blk: ~fn(&Exec) -> T) -> Work<T>;
 }
 
 impl TPrep for @Mut<Prep> {
@@ -318,11 +315,8 @@ impl TPrep for @Mut<Prep> {
         return true;
     }
 
-    fn exec<T:Owned
-        Encodable<json::Encoder>
-        Decodable<json::Decoder>>(&self,
-                                  blk: ~fn(&Exec) -> T) -> Work<T> {
-
+    fn exec<T:Owned + Encodable<json::Encoder> + Decodable<json::Decoder>>(
+            &self, blk: ~fn(&Exec) -> T) -> Work<T> {
         let mut bo = Some(blk);
 
         do self.borrow_imm |p| {
@@ -360,20 +354,15 @@ impl TPrep for @Mut<Prep> {
     }
 }
 
-impl<T:Owned
-       Encodable<json::Encoder>
-       Decodable<json::Decoder>>
-    Work<T> {
+impl<T:Owned + Encodable<json::Encoder> + Decodable<json::Decoder>> Work<T> {
     static fn new(p: @Mut<Prep>, e: Either<T,PortOne<(Exec,T)>>) -> Work<T> {
         Work { prep: p, res: Some(e) }
     }
 }
 
 // FIXME (#3724): movable self. This should be in impl Work.
-fn unwrap<T:Owned
-            Encodable<json::Encoder>
-            Decodable<json::Decoder>>(w: Work<T>) -> T {
-
+fn unwrap<T:Owned + Encodable<json::Encoder> + Decodable<json::Decoder>>(
+        w: Work<T>) -> T {
     let mut ww = w;
     let mut s = None;
 
@@ -383,7 +372,6 @@ fn unwrap<T:Owned
         None => fail!(),
         Some(Left(v)) => v,
         Some(Right(port)) => {
-
             let (exe, v) = match recv(port) {
                 oneshot::send(data) => data
             };