diff --git a/src/buf/mod.rs b/src/buf/mod.rs index b52e99a75bd8ab7ccab761c404f10755094b51bf..1ce2c00577bf620f80b31c497517f4acde03f6df 100644 --- a/src/buf/mod.rs +++ b/src/buf/mod.rs @@ -295,7 +295,7 @@ impl<T: io::Write> WriteExt for T { * */ -impl Buf for Box<Buf+'static> { +impl Buf for Box<Buf+Send+'static> { fn remaining(&self) -> usize { (**self).remaining() } @@ -313,7 +313,7 @@ impl Buf for Box<Buf+'static> { } } -impl fmt::Debug for Box<Buf+'static> { +impl fmt::Debug for Box<Buf+Send+'static> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { write!(fmt, "Box<Buf> {{ remaining: {} }}", self.remaining()) } @@ -409,7 +409,7 @@ macro_rules! impl_read { impl_read!(ByteBuf); impl_read!(ROByteBuf); impl_read!(RopeBuf); -impl_read!(Box<Buf+'static>); +impl_read!(Box<Buf+Send+'static>); macro_rules! impl_write { ($ty:ty) => { diff --git a/src/str/bytes.rs b/src/str/bytes.rs index 902e9300d53efc8d6bda8d3145440815f7362876..12667573b0b7b8488f3b02a50ad939d8ca2ee12d 100644 --- a/src/str/bytes.rs +++ b/src/str/bytes.rs @@ -132,9 +132,9 @@ fn inline<B: ByteStr>() -> bool { impl ByteStr for Bytes { - type Buf = Box<Buf+'static>; + type Buf = Box<Buf+Send+'static>; - fn buf(&self) -> Box<Buf+'static> { + fn buf(&self) -> Box<Buf+Send+'static> { self.obj().buf() } @@ -200,7 +200,7 @@ unsafe impl Sync for Bytes { } trait ByteStrPriv { - fn buf(&self) -> Box<Buf+'static>; + fn buf(&self) -> Box<Buf+Send+'static>; fn clone(&self) -> Bytes; @@ -221,7 +221,7 @@ trait ByteStrPriv { impl<B: ByteStr> ByteStrPriv for B { - fn buf(&self) -> Box<Buf+'static> { + fn buf(&self) -> Box<Buf+Send+'static> { Box::new(self.buf()) } diff --git a/src/str/mod.rs b/src/str/mod.rs index 0a830a764f6803e9cdd239164852e19ec51918b3..9065c2608e0812bf2332113fa5f25d0f8ae1629b 100644 --- a/src/str/mod.rs +++ b/src/str/mod.rs @@ -18,7 +18,7 @@ use std::any::Any; pub trait ByteStr : Clone + Sized + Send + Sync + Any + ToBytes + ops::Index<usize, Output=u8> + 'static { // Until HKT lands, the buf must be bound by 'static - type Buf: Buf+'static; + type Buf: Buf+Send+'static; /// Returns a read-only `Buf` for accessing the byte contents of the /// `ByteStr`. diff --git a/src/str/rope.rs b/src/str/rope.rs index d3798555bab5c81d0cd25466e5cf51efa5e62985..ec7b807608c3587f5c2bcbe651b7417c7791e4af 100644 --- a/src/str/rope.rs +++ b/src/str/rope.rs @@ -294,7 +294,7 @@ pub struct RopeBuf { // escape (which it shouldn't) it is safe. Doing this properly would // require HKT. pieces: PieceIter<'static>, - leaf_buf: Option<Box<Buf+'static>>, + leaf_buf: Option<Box<Buf+Send+'static>>, } impl RopeBuf {