From 569447489194b62aa22e47262e9ed681886d1fa0 Mon Sep 17 00:00:00 2001 From: Jethro Beekman Date: Wed, 2 Nov 2016 22:00:57 -0700 Subject: [PATCH] Make most of Cursor available without collections. Fixes #4 --- ...309e4b0ea05ee905205278fb6d131341c41f.patch | 44 ++++++++++------- ...bb879e6ef498ea04e08bd80688bf2fc4a183.patch | 44 ++++++++++------- ...541afdd18423940e97c7a02b517b1f6d61be.patch | 44 ++++++++++------- ...36872d7ea8bee91f8588e3c4a613c58c76cb.patch | 47 ++++++++++++------- ...949bf678abc1fae595e3f6eb59a5bf8a7564.patch | 44 ++++++++++------- ...da70d33cead1398adfecce1a75e7a61e3daf.patch | 44 ++++++++++------- ...9c627ebde2bbfa6021de146c502124da7975.patch | 44 ++++++++++------- ...18199d69bcc801668bfbeea8190b2c73a939.patch | 44 ++++++++++------- ...33385aa2ff150a5d6f83ecfe55afc7e19e68.patch | 44 ++++++++++------- ...817119e479b0610685e3fc7a6ff21cde5abc.patch | 44 ++++++++++------- ...e45988e81cb1a7bc9881aa7172d4f9caefd4.patch | 44 ++++++++++------- ...332a27b020f5252238946fa9dccc3843d52a.patch | 47 ++++++++++++------- ...4e0e3f27d1917d11ee80de827698beb53891.patch | 44 ++++++++++------- ...0cf8dcf411ce7e70ab2960639977d46d5b01.patch | 44 ++++++++++------- ...120ad218b8d9c50e25a525dcff689c515776.patch | 44 ++++++++++------- ...8783d91624261317316f996d8d2d09b7b6a4.patch | 44 ++++++++++------- ...5c8dd891ec6eb0809b8438656d1b39c2e2f5.patch | 44 ++++++++++------- ...c065b0e94b1e2ce7f14ab512475e79426ce4.patch | 44 ++++++++++------- ...50f5d377a41dd5833e4621e9a14879647503.patch | 44 ++++++++++------- ...1d7c8c21aa860bda29c62207a6726837952b.patch | 44 ++++++++++------- ...3eb369c9bdd0aef4917675e515f39f3b4a1e.patch | 44 ++++++++++------- ...079a6f70577d02f35bb80d27eef7e2b18a4a.patch | 44 ++++++++++------- ...593f42fafbac1ff3d827f6df96338b5b7d8b.patch | 44 ++++++++++------- ...4e828c3dc3b7c417197990741b024f8c4ca3.patch | 44 ++++++++++------- ...a6ad0845b76509c4f8967e8ca476471ab7e0.patch | 44 ++++++++++------- ...c8b84969fbe52cae7c9fd61858fddc6e016b.patch | 44 ++++++++++------- ...4c5d13f8819c72568f9675e84c1d17368c67.patch | 44 ++++++++++------- ...91c0b959111aef19f3aa06b7f1743419470c.patch | 44 ++++++++++------- ...73f00fa07b9a8246b104396f9922e54bff16.patch | 44 ++++++++++------- src/lib.rs | 2 +- 30 files changed, 817 insertions(+), 467 deletions(-) diff --git a/patches/0f02309e4b0ea05ee905205278fb6d131341c41f.patch b/patches/0f02309e4b0ea05ee905205278fb6d131341c41f.patch index 5270830..11db917 100644 --- a/patches/0f02309e4b0ea05ee905205278fb6d131341c41f.patch +++ b/patches/0f02309e4b0ea05ee905205278fb6d131341c41f.patch @@ -283,7 +283,7 @@ index 632ef3d..dd63ebe 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index a1002fd..3a00ffe 100644 +index a1002fd..292afd0 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index a1002fd..3a00ffe 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index a1002fd..3a00ffe 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = (&mut self.inner[(pos as usize)..]).write(buf)?; diff --git a/error.rs b/error.rs index 9a605fc..d3d0814 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 28492b3..924d626 100644 +index 28492b3..aafb081 100644 --- a/mod.rs +++ b/mod.rs @@ -248,49 +248,32 @@ @@ -998,8 +1012,6 @@ index 28492b3..924d626 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index 28492b3..924d626 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index 28492b3..924d626 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/117cbb879e6ef498ea04e08bd80688bf2fc4a183.patch b/patches/117cbb879e6ef498ea04e08bd80688bf2fc4a183.patch index 8bfc724..1ba44a8 100644 --- a/patches/117cbb879e6ef498ea04e08bd80688bf2fc4a183.patch +++ b/patches/117cbb879e6ef498ea04e08bd80688bf2fc4a183.patch @@ -282,7 +282,7 @@ index a26a932..83ea558 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 1b836b7..c77f287 100644 +index 1b836b7..4840c92 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,9 +8,10 @@ @@ -357,23 +357,33 @@ index 1b836b7..c77f287 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -209,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -209,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -218,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -227,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -381,22 +391,26 @@ index 1b836b7..c77f287 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +256,6 @@ impl Write for Cursor> { +@@ -267,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index ddf0030..748b830 100644 --- a/error.rs @@ -974,7 +988,7 @@ index 03f55f7..f767e0c 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 1053792..5acfe6a 100644 +index 1053792..ae6a3c7 100644 --- a/mod.rs +++ b/mod.rs @@ -247,42 +247,32 @@ @@ -997,8 +1011,6 @@ index 1053792..5acfe6a 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1013,7 +1025,8 @@ index 1053792..5acfe6a 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1027,9 +1040,8 @@ index 1053792..5acfe6a 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/161c541afdd18423940e97c7a02b517b1f6d61be.patch b/patches/161c541afdd18423940e97c7a02b517b1f6d61be.patch index fb2ae22..775575f 100644 --- a/patches/161c541afdd18423940e97c7a02b517b1f6d61be.patch +++ b/patches/161c541afdd18423940e97c7a02b517b1f6d61be.patch @@ -283,7 +283,7 @@ index 632ef3d..dd63ebe 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index a1002fd..3a00ffe 100644 +index a1002fd..292afd0 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index a1002fd..3a00ffe 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index a1002fd..3a00ffe 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = (&mut self.inner[(pos as usize)..]).write(buf)?; diff --git a/error.rs b/error.rs index 9a605fc..d3d0814 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 0f988c7..d6cd245 100644 +index 0f988c7..907172b 100644 --- a/mod.rs +++ b/mod.rs @@ -248,49 +248,32 @@ @@ -998,8 +1012,6 @@ index 0f988c7..d6cd245 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index 0f988c7..d6cd245 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index 0f988c7..d6cd245 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/1f9036872d7ea8bee91f8588e3c4a613c58c76cb.patch b/patches/1f9036872d7ea8bee91f8588e3c4a613c58c76cb.patch index d645761..24a1614 100644 --- a/patches/1f9036872d7ea8bee91f8588e3c4a613c58c76cb.patch +++ b/patches/1f9036872d7ea8bee91f8588e3c4a613c58c76cb.patch @@ -282,7 +282,7 @@ index 21a0cc1..27c5ac1 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index ae0085f..5392880 100644 +index ae0085f..0f8029d 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,11 @@ @@ -292,8 +292,9 @@ index ae0085f..5392880 100644 +use core::prelude::v1::*; use io::prelude::*; - use core::convert::TryInto; +-use core::convert::TryInto; -use cmp; ++#[cfg(feature = "collections")] use core::convert::TryInto; +use core::cmp; use io::{self, SeekFrom, Error, ErrorKind}; @@ -358,23 +359,33 @@ index ae0085f..5392880 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +203,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +203,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +211,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +219,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -382,22 +393,26 @@ index ae0085f..5392880 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -240,7 +230,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -240,7 +235,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos: usize = self.position().try_into().map_err(|_| { -@@ -270,7 +259,6 @@ impl Write for Cursor> { +@@ -270,8 +265,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index ddf0030..748b830 100644 --- a/error.rs @@ -883,7 +898,7 @@ index 3824a5f..312cf47 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 7310564..05d91fc 100644 +index 7310564..0fafc60 100644 --- a/mod.rs +++ b/mod.rs @@ -247,42 +247,32 @@ @@ -906,8 +921,6 @@ index 7310564..05d91fc 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -922,7 +935,8 @@ index 7310564..05d91fc 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -936,9 +950,8 @@ index 7310564..05d91fc 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/26f9949bf678abc1fae595e3f6eb59a5bf8a7564.patch b/patches/26f9949bf678abc1fae595e3f6eb59a5bf8a7564.patch index 6b57510..99ee2f8 100644 --- a/patches/26f9949bf678abc1fae595e3f6eb59a5bf8a7564.patch +++ b/patches/26f9949bf678abc1fae595e3f6eb59a5bf8a7564.patch @@ -282,7 +282,7 @@ index 4ff8c6a..fd4eb13 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 1b836b7..c77f287 100644 +index 1b836b7..4840c92 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,9 +8,10 @@ @@ -357,23 +357,33 @@ index 1b836b7..c77f287 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -209,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -209,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -218,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -227,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -381,22 +391,26 @@ index 1b836b7..c77f287 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +256,6 @@ impl Write for Cursor> { +@@ -267,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index ddf0030..748b830 100644 --- a/error.rs @@ -974,7 +988,7 @@ index 03f55f7..f767e0c 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 0de02cb..0f202c2 100644 +index 0de02cb..694f2fd 100644 --- a/mod.rs +++ b/mod.rs @@ -247,42 +247,32 @@ @@ -997,8 +1011,6 @@ index 0de02cb..0f202c2 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1013,7 +1025,8 @@ index 0de02cb..0f202c2 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1027,9 +1040,8 @@ index 0de02cb..0f202c2 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/552eda70d33cead1398adfecce1a75e7a61e3daf.patch b/patches/552eda70d33cead1398adfecce1a75e7a61e3daf.patch index ade6454..c450800 100644 --- a/patches/552eda70d33cead1398adfecce1a75e7a61e3daf.patch +++ b/patches/552eda70d33cead1398adfecce1a75e7a61e3daf.patch @@ -283,7 +283,7 @@ index 632ef3d..dd63ebe 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index a1002fd..3a00ffe 100644 +index a1002fd..292afd0 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index a1002fd..3a00ffe 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index a1002fd..3a00ffe 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = (&mut self.inner[(pos as usize)..]).write(buf)?; diff --git a/error.rs b/error.rs index 9a605fc..d3d0814 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 6dd7273..ba07b2c 100644 +index 6dd7273..002d94e 100644 --- a/mod.rs +++ b/mod.rs @@ -248,49 +248,32 @@ @@ -998,8 +1012,6 @@ index 6dd7273..ba07b2c 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index 6dd7273..ba07b2c 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index 6dd7273..ba07b2c 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/62b19c627ebde2bbfa6021de146c502124da7975.patch b/patches/62b19c627ebde2bbfa6021de146c502124da7975.patch index 67d7802..8c8bd5c 100644 --- a/patches/62b19c627ebde2bbfa6021de146c502124da7975.patch +++ b/patches/62b19c627ebde2bbfa6021de146c502124da7975.patch @@ -283,7 +283,7 @@ index a92ca95..e23b74f 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index a1002fd..3a00ffe 100644 +index a1002fd..292afd0 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index a1002fd..3a00ffe 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index a1002fd..3a00ffe 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = (&mut self.inner[(pos as usize)..]).write(buf)?; diff --git a/error.rs b/error.rs index e142c78..eeb11d5 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index a058337..d190cba 100644 +index a058337..b8439a9 100644 --- a/mod.rs +++ b/mod.rs @@ -247,49 +247,32 @@ @@ -998,8 +1012,6 @@ index a058337..d190cba 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index a058337..d190cba 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index a058337..d190cba 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/78ab18199d69bcc801668bfbeea8190b2c73a939.patch b/patches/78ab18199d69bcc801668bfbeea8190b2c73a939.patch index 37f232d..c99d11d 100644 --- a/patches/78ab18199d69bcc801668bfbeea8190b2c73a939.patch +++ b/patches/78ab18199d69bcc801668bfbeea8190b2c73a939.patch @@ -283,7 +283,7 @@ index 632ef3d..dd63ebe 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index a1002fd..3a00ffe 100644 +index a1002fd..292afd0 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index a1002fd..3a00ffe 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index a1002fd..3a00ffe 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = (&mut self.inner[(pos as usize)..]).write(buf)?; diff --git a/error.rs b/error.rs index 9a605fc..d3d0814 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index d914d14..d17f3cf 100644 +index d914d14..708e8bf 100644 --- a/mod.rs +++ b/mod.rs @@ -248,49 +248,32 @@ @@ -998,8 +1012,6 @@ index d914d14..d17f3cf 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index d914d14..d17f3cf 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index d914d14..d17f3cf 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/80d733385aa2ff150a5d6f83ecfe55afc7e19e68.patch b/patches/80d733385aa2ff150a5d6f83ecfe55afc7e19e68.patch index 10d3ba6..c112866 100644 --- a/patches/80d733385aa2ff150a5d6f83ecfe55afc7e19e68.patch +++ b/patches/80d733385aa2ff150a5d6f83ecfe55afc7e19e68.patch @@ -283,7 +283,7 @@ index a92ca95..e23b74f 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 2d78055..1db50ee 100644 +index 2d78055..a269a7c 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index 2d78055..1db50ee 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index 2d78055..1db50ee 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -240,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -268,7 +256,6 @@ impl Write for Cursor> { +@@ -268,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index e142c78..eeb11d5 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index a058337..d190cba 100644 +index a058337..b8439a9 100644 --- a/mod.rs +++ b/mod.rs @@ -247,49 +247,32 @@ @@ -998,8 +1012,6 @@ index a058337..d190cba 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index a058337..d190cba 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index a058337..d190cba 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/8128817119e479b0610685e3fc7a6ff21cde5abc.patch b/patches/8128817119e479b0610685e3fc7a6ff21cde5abc.patch index 955463f..d2e603d 100644 --- a/patches/8128817119e479b0610685e3fc7a6ff21cde5abc.patch +++ b/patches/8128817119e479b0610685e3fc7a6ff21cde5abc.patch @@ -283,7 +283,7 @@ index 632ef3d..dd63ebe 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index a1002fd..3a00ffe 100644 +index a1002fd..292afd0 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index a1002fd..3a00ffe 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index a1002fd..3a00ffe 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = (&mut self.inner[(pos as usize)..]).write(buf)?; diff --git a/error.rs b/error.rs index 9a605fc..d3d0814 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index bcce8ee..4a492d7 100644 +index bcce8ee..d56de11 100644 --- a/mod.rs +++ b/mod.rs @@ -248,49 +248,32 @@ @@ -998,8 +1012,6 @@ index bcce8ee..4a492d7 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index bcce8ee..4a492d7 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index bcce8ee..4a492d7 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/87aee45988e81cb1a7bc9881aa7172d4f9caefd4.patch b/patches/87aee45988e81cb1a7bc9881aa7172d4f9caefd4.patch index 5270830..11db917 100644 --- a/patches/87aee45988e81cb1a7bc9881aa7172d4f9caefd4.patch +++ b/patches/87aee45988e81cb1a7bc9881aa7172d4f9caefd4.patch @@ -283,7 +283,7 @@ index 632ef3d..dd63ebe 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index a1002fd..3a00ffe 100644 +index a1002fd..292afd0 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index a1002fd..3a00ffe 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index a1002fd..3a00ffe 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = (&mut self.inner[(pos as usize)..]).write(buf)?; diff --git a/error.rs b/error.rs index 9a605fc..d3d0814 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 28492b3..924d626 100644 +index 28492b3..aafb081 100644 --- a/mod.rs +++ b/mod.rs @@ -248,49 +248,32 @@ @@ -998,8 +1012,6 @@ index 28492b3..924d626 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index 28492b3..924d626 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index 28492b3..924d626 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/8d06332a27b020f5252238946fa9dccc3843d52a.patch b/patches/8d06332a27b020f5252238946fa9dccc3843d52a.patch index 398c294..61bcea0 100644 --- a/patches/8d06332a27b020f5252238946fa9dccc3843d52a.patch +++ b/patches/8d06332a27b020f5252238946fa9dccc3843d52a.patch @@ -282,7 +282,7 @@ index 93b2d34..47282c9 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index ae0085f..5392880 100644 +index ae0085f..0f8029d 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,11 @@ @@ -292,8 +292,9 @@ index ae0085f..5392880 100644 +use core::prelude::v1::*; use io::prelude::*; - use core::convert::TryInto; +-use core::convert::TryInto; -use cmp; ++#[cfg(feature = "collections")] use core::convert::TryInto; +use core::cmp; use io::{self, SeekFrom, Error, ErrorKind}; @@ -358,23 +359,33 @@ index ae0085f..5392880 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +203,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +203,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +211,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +219,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -382,22 +393,26 @@ index ae0085f..5392880 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -240,7 +230,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -240,7 +235,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos: usize = self.position().try_into().map_err(|_| { -@@ -270,7 +259,6 @@ impl Write for Cursor> { +@@ -270,8 +265,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index ddf0030..748b830 100644 --- a/error.rs @@ -883,7 +898,7 @@ index 3824a5f..312cf47 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 7310564..05d91fc 100644 +index 7310564..0fafc60 100644 --- a/mod.rs +++ b/mod.rs @@ -247,42 +247,32 @@ @@ -906,8 +921,6 @@ index 7310564..05d91fc 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -922,7 +935,8 @@ index 7310564..05d91fc 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -936,9 +950,8 @@ index 7310564..05d91fc 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/8e414e0e3f27d1917d11ee80de827698beb53891.patch b/patches/8e414e0e3f27d1917d11ee80de827698beb53891.patch index 9ab22e6..10486cc 100644 --- a/patches/8e414e0e3f27d1917d11ee80de827698beb53891.patch +++ b/patches/8e414e0e3f27d1917d11ee80de827698beb53891.patch @@ -283,7 +283,7 @@ index 632ef3d..dd63ebe 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index a1002fd..3a00ffe 100644 +index a1002fd..292afd0 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index a1002fd..3a00ffe 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index a1002fd..3a00ffe 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = (&mut self.inner[(pos as usize)..]).write(buf)?; diff --git a/error.rs b/error.rs index e142c78..eeb11d5 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index a058337..d190cba 100644 +index a058337..b8439a9 100644 --- a/mod.rs +++ b/mod.rs @@ -247,49 +247,32 @@ @@ -998,8 +1012,6 @@ index a058337..d190cba 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index a058337..d190cba 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index a058337..d190cba 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/92400cf8dcf411ce7e70ab2960639977d46d5b01.patch b/patches/92400cf8dcf411ce7e70ab2960639977d46d5b01.patch index 5bd493e..888669d 100644 --- a/patches/92400cf8dcf411ce7e70ab2960639977d46d5b01.patch +++ b/patches/92400cf8dcf411ce7e70ab2960639977d46d5b01.patch @@ -283,7 +283,7 @@ index a92ca95..e23b74f 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 2d78055..1db50ee 100644 +index 2d78055..a269a7c 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index 2d78055..1db50ee 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index 2d78055..1db50ee 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -240,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -268,7 +256,6 @@ impl Write for Cursor> { +@@ -268,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index 05ae8ed..5da1224 100644 --- a/error.rs @@ -974,7 +988,7 @@ index a408b43..823a3ad 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index d5b255e..c14c50e 100644 +index d5b255e..33502d5 100644 --- a/mod.rs +++ b/mod.rs @@ -247,49 +247,32 @@ @@ -1004,8 +1018,6 @@ index d5b255e..c14c50e 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1020,7 +1032,8 @@ index d5b255e..c14c50e 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1034,9 +1047,8 @@ index d5b255e..c14c50e 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/98e3120ad218b8d9c50e25a525dcff689c515776.patch b/patches/98e3120ad218b8d9c50e25a525dcff689c515776.patch index 8ea7dad..2f167ae 100644 --- a/patches/98e3120ad218b8d9c50e25a525dcff689c515776.patch +++ b/patches/98e3120ad218b8d9c50e25a525dcff689c515776.patch @@ -283,7 +283,7 @@ index a92ca95..e23b74f 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 2d78055..1db50ee 100644 +index 2d78055..a269a7c 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index 2d78055..1db50ee 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index 2d78055..1db50ee 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -240,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -268,7 +256,6 @@ impl Write for Cursor> { +@@ -268,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index 05ae8ed..5da1224 100644 --- a/error.rs @@ -974,7 +988,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index a058337..d190cba 100644 +index a058337..b8439a9 100644 --- a/mod.rs +++ b/mod.rs @@ -247,49 +247,32 @@ @@ -1004,8 +1018,6 @@ index a058337..d190cba 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1020,7 +1032,8 @@ index a058337..d190cba 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1034,9 +1047,8 @@ index a058337..d190cba 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/9a2c8783d91624261317316f996d8d2d09b7b6a4.patch b/patches/9a2c8783d91624261317316f996d8d2d09b7b6a4.patch index a3408dd..9027119 100644 --- a/patches/9a2c8783d91624261317316f996d8d2d09b7b6a4.patch +++ b/patches/9a2c8783d91624261317316f996d8d2d09b7b6a4.patch @@ -282,7 +282,7 @@ index a26a932..83ea558 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 1b836b7..c77f287 100644 +index 1b836b7..4840c92 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,9 +8,10 @@ @@ -357,23 +357,33 @@ index 1b836b7..c77f287 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -209,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -209,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -218,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -227,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -381,22 +391,26 @@ index 1b836b7..c77f287 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +256,6 @@ impl Write for Cursor> { +@@ -267,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index d90be2e..d23baa8 100644 --- a/error.rs @@ -973,7 +987,7 @@ index a408b43..823a3ad 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 1053792..5acfe6a 100644 +index 1053792..ae6a3c7 100644 --- a/mod.rs +++ b/mod.rs @@ -247,42 +247,32 @@ @@ -996,8 +1010,6 @@ index 1053792..5acfe6a 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1012,7 +1024,8 @@ index 1053792..5acfe6a 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1026,9 +1039,8 @@ index 1053792..5acfe6a 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/9f935c8dd891ec6eb0809b8438656d1b39c2e2f5.patch b/patches/9f935c8dd891ec6eb0809b8438656d1b39c2e2f5.patch index cda86a3..c813b53 100644 --- a/patches/9f935c8dd891ec6eb0809b8438656d1b39c2e2f5.patch +++ b/patches/9f935c8dd891ec6eb0809b8438656d1b39c2e2f5.patch @@ -283,7 +283,7 @@ index 632ef3d..dd63ebe 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index a1002fd..3a00ffe 100644 +index a1002fd..292afd0 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index a1002fd..3a00ffe 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index a1002fd..3a00ffe 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = (&mut self.inner[(pos as usize)..]).write(buf)?; diff --git a/error.rs b/error.rs index 9a605fc..d3d0814 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index a058337..d190cba 100644 +index a058337..b8439a9 100644 --- a/mod.rs +++ b/mod.rs @@ -247,49 +247,32 @@ @@ -998,8 +1012,6 @@ index a058337..d190cba 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index a058337..d190cba 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index a058337..d190cba 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/9fe3c065b0e94b1e2ce7f14ab512475e79426ce4.patch b/patches/9fe3c065b0e94b1e2ce7f14ab512475e79426ce4.patch index 80d0b31..ac8f2fd 100644 --- a/patches/9fe3c065b0e94b1e2ce7f14ab512475e79426ce4.patch +++ b/patches/9fe3c065b0e94b1e2ce7f14ab512475e79426ce4.patch @@ -283,7 +283,7 @@ index 632ef3d..dd63ebe 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index a1002fd..3a00ffe 100644 +index a1002fd..292afd0 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index a1002fd..3a00ffe 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index a1002fd..3a00ffe 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = (&mut self.inner[(pos as usize)..]).write(buf)?; diff --git a/error.rs b/error.rs index 9a605fc..d3d0814 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index ca15aa2..900ee2f 100644 +index ca15aa2..70879e5 100644 --- a/mod.rs +++ b/mod.rs @@ -248,49 +248,32 @@ @@ -998,8 +1012,6 @@ index ca15aa2..900ee2f 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index ca15aa2..900ee2f 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index ca15aa2..900ee2f 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/c1fb50f5d377a41dd5833e4621e9a14879647503.patch b/patches/c1fb50f5d377a41dd5833e4621e9a14879647503.patch index f7fddd7..71eca4d 100644 --- a/patches/c1fb50f5d377a41dd5833e4621e9a14879647503.patch +++ b/patches/c1fb50f5d377a41dd5833e4621e9a14879647503.patch @@ -283,7 +283,7 @@ index 08877fe..a1af9d9 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 420fede..670e362 100644 +index 420fede..d4242f7 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index 420fede..670e362 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = try!(Read::read(&mut try!(self.fill_buf()), buf)); -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = try!(Read::read(&mut try!(self.fill_buf()), buf)); ++ let n = try!(Read::read(&mut try!(self.get_buf()), buf)); + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index 420fede..670e362 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = try!((&mut self.inner[(pos as usize)..]).write(buf)); diff --git a/error.rs b/error.rs index e3f17c8..50e3658 100644 --- a/error.rs @@ -976,7 +990,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 61334f3..9d9263f 100644 +index 61334f3..26b9102 100644 --- a/mod.rs +++ b/mod.rs @@ -248,49 +248,32 @@ @@ -1006,8 +1020,6 @@ index 61334f3..9d9263f 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1022,7 +1034,8 @@ index 61334f3..9d9263f 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1036,9 +1049,8 @@ index 61334f3..9d9263f 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/cae91d7c8c21aa860bda29c62207a6726837952b.patch b/patches/cae91d7c8c21aa860bda29c62207a6726837952b.patch index 67d7802..8c8bd5c 100644 --- a/patches/cae91d7c8c21aa860bda29c62207a6726837952b.patch +++ b/patches/cae91d7c8c21aa860bda29c62207a6726837952b.patch @@ -283,7 +283,7 @@ index a92ca95..e23b74f 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index a1002fd..3a00ffe 100644 +index a1002fd..292afd0 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index a1002fd..3a00ffe 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index a1002fd..3a00ffe 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = (&mut self.inner[(pos as usize)..]).write(buf)?; diff --git a/error.rs b/error.rs index e142c78..eeb11d5 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index a058337..d190cba 100644 +index a058337..b8439a9 100644 --- a/mod.rs +++ b/mod.rs @@ -247,49 +247,32 @@ @@ -998,8 +1012,6 @@ index a058337..d190cba 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index a058337..d190cba 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index a058337..d190cba 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/ce943eb369c9bdd0aef4917675e515f39f3b4a1e.patch b/patches/ce943eb369c9bdd0aef4917675e515f39f3b4a1e.patch index 8796a83..c32449b 100644 --- a/patches/ce943eb369c9bdd0aef4917675e515f39f3b4a1e.patch +++ b/patches/ce943eb369c9bdd0aef4917675e515f39f3b4a1e.patch @@ -283,7 +283,7 @@ index 08877fe..a1af9d9 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 420fede..670e362 100644 +index 420fede..d4242f7 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index 420fede..670e362 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = try!(Read::read(&mut try!(self.fill_buf()), buf)); -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = try!(Read::read(&mut try!(self.fill_buf()), buf)); ++ let n = try!(Read::read(&mut try!(self.get_buf()), buf)); + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index 420fede..670e362 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = try!((&mut self.inner[(pos as usize)..]).write(buf)); diff --git a/error.rs b/error.rs index 9a605fc..d3d0814 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 60a720e..85ce207 100644 +index 60a720e..b6b24ea 100644 --- a/mod.rs +++ b/mod.rs @@ -248,49 +248,32 @@ @@ -998,8 +1012,6 @@ index 60a720e..85ce207 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index 60a720e..85ce207 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index 60a720e..85ce207 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/d311079a6f70577d02f35bb80d27eef7e2b18a4a.patch b/patches/d311079a6f70577d02f35bb80d27eef7e2b18a4a.patch index 6a21c98..d2e8a4c 100644 --- a/patches/d311079a6f70577d02f35bb80d27eef7e2b18a4a.patch +++ b/patches/d311079a6f70577d02f35bb80d27eef7e2b18a4a.patch @@ -282,7 +282,7 @@ index 21a0cc1..27c5ac1 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 1b836b7..c77f287 100644 +index 1b836b7..4840c92 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,9 +8,10 @@ @@ -357,23 +357,33 @@ index 1b836b7..c77f287 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -209,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -209,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -218,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -227,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -381,22 +391,26 @@ index 1b836b7..c77f287 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +256,6 @@ impl Write for Cursor> { +@@ -267,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index ddf0030..748b830 100644 --- a/error.rs @@ -882,7 +896,7 @@ index 3824a5f..312cf47 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 3becc0a..05d91fc 100644 +index 3becc0a..0fafc60 100644 --- a/mod.rs +++ b/mod.rs @@ -247,42 +247,32 @@ @@ -905,8 +919,6 @@ index 3becc0a..05d91fc 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -921,7 +933,8 @@ index 3becc0a..05d91fc 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -935,9 +948,8 @@ index 3becc0a..05d91fc 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/d40c593f42fafbac1ff3d827f6df96338b5b7d8b.patch b/patches/d40c593f42fafbac1ff3d827f6df96338b5b7d8b.patch index 45d1d65..a98e4ea 100644 --- a/patches/d40c593f42fafbac1ff3d827f6df96338b5b7d8b.patch +++ b/patches/d40c593f42fafbac1ff3d827f6df96338b5b7d8b.patch @@ -283,7 +283,7 @@ index a92ca95..e23b74f 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 2d78055..1db50ee 100644 +index 2d78055..a269a7c 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index 2d78055..1db50ee 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index 2d78055..1db50ee 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -240,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -268,7 +256,6 @@ impl Write for Cursor> { +@@ -268,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index 05ae8ed..5da1224 100644 --- a/error.rs @@ -974,7 +988,7 @@ index a408b43..823a3ad 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index a058337..d190cba 100644 +index a058337..b8439a9 100644 --- a/mod.rs +++ b/mod.rs @@ -247,49 +247,32 @@ @@ -1004,8 +1018,6 @@ index a058337..d190cba 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1020,7 +1032,8 @@ index a058337..d190cba 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1034,9 +1047,8 @@ index a058337..d190cba 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/d6aa4e828c3dc3b7c417197990741b024f8c4ca3.patch b/patches/d6aa4e828c3dc3b7c417197990741b024f8c4ca3.patch index f6cd4fb..31a6dbb 100644 --- a/patches/d6aa4e828c3dc3b7c417197990741b024f8c4ca3.patch +++ b/patches/d6aa4e828c3dc3b7c417197990741b024f8c4ca3.patch @@ -282,7 +282,7 @@ index dbb45d5..a138b3e 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 1b836b7..c77f287 100644 +index 1b836b7..4840c92 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,9 +8,10 @@ @@ -357,23 +357,33 @@ index 1b836b7..c77f287 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -209,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -209,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -218,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -227,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -381,22 +391,26 @@ index 1b836b7..c77f287 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +256,6 @@ impl Write for Cursor> { +@@ -267,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index ddf0030..748b830 100644 --- a/error.rs @@ -974,7 +988,7 @@ index 03f55f7..f767e0c 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 06609cf..a1bbe50 100644 +index 06609cf..106cf67 100644 --- a/mod.rs +++ b/mod.rs @@ -247,42 +247,32 @@ @@ -997,8 +1011,6 @@ index 06609cf..a1bbe50 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1013,7 +1025,8 @@ index 06609cf..a1bbe50 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1027,9 +1040,8 @@ index 06609cf..a1bbe50 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/dd56a6ad0845b76509c4f8967e8ca476471ab7e0.patch b/patches/dd56a6ad0845b76509c4f8967e8ca476471ab7e0.patch index a0a9167..f90017a 100644 --- a/patches/dd56a6ad0845b76509c4f8967e8ca476471ab7e0.patch +++ b/patches/dd56a6ad0845b76509c4f8967e8ca476471ab7e0.patch @@ -283,7 +283,7 @@ index a92ca95..e23b74f 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 2d78055..1db50ee 100644 +index 2d78055..a269a7c 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index 2d78055..1db50ee 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index 2d78055..1db50ee 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -240,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -268,7 +256,6 @@ impl Write for Cursor> { +@@ -268,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index e142c78..eeb11d5 100644 --- a/error.rs @@ -968,7 +982,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index a058337..d190cba 100644 +index a058337..b8439a9 100644 --- a/mod.rs +++ b/mod.rs @@ -247,49 +247,32 @@ @@ -998,8 +1012,6 @@ index a058337..d190cba 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1014,7 +1026,8 @@ index a058337..d190cba 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1028,9 +1041,8 @@ index a058337..d190cba 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/e107c8b84969fbe52cae7c9fd61858fddc6e016b.patch b/patches/e107c8b84969fbe52cae7c9fd61858fddc6e016b.patch index 2968c07..3cd73d2 100644 --- a/patches/e107c8b84969fbe52cae7c9fd61858fddc6e016b.patch +++ b/patches/e107c8b84969fbe52cae7c9fd61858fddc6e016b.patch @@ -282,7 +282,7 @@ index 4ff8c6a..fd4eb13 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 1b836b7..c77f287 100644 +index 1b836b7..4840c92 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,9 +8,10 @@ @@ -357,23 +357,33 @@ index 1b836b7..c77f287 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -209,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -209,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -218,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -227,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -381,22 +391,26 @@ index 1b836b7..c77f287 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -239,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +256,6 @@ impl Write for Cursor> { +@@ -267,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index ddf0030..748b830 100644 --- a/error.rs @@ -974,7 +988,7 @@ index 03f55f7..f767e0c 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 06609cf..a1bbe50 100644 +index 06609cf..106cf67 100644 --- a/mod.rs +++ b/mod.rs @@ -247,42 +247,32 @@ @@ -997,8 +1011,6 @@ index 06609cf..a1bbe50 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1013,7 +1025,8 @@ index 06609cf..a1bbe50 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1027,9 +1040,8 @@ index 06609cf..a1bbe50 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/e6cc4c5d13f8819c72568f9675e84c1d17368c67.patch b/patches/e6cc4c5d13f8819c72568f9675e84c1d17368c67.patch index 1770c6c..0b1047a 100644 --- a/patches/e6cc4c5d13f8819c72568f9675e84c1d17368c67.patch +++ b/patches/e6cc4c5d13f8819c72568f9675e84c1d17368c67.patch @@ -283,7 +283,7 @@ index a92ca95..e23b74f 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 2d78055..1db50ee 100644 +index 2d78055..a269a7c 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index 2d78055..1db50ee 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index 2d78055..1db50ee 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -240,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -268,7 +256,6 @@ impl Write for Cursor> { +@@ -268,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index 5333b0a..25bbd8b 100644 --- a/error.rs @@ -982,7 +996,7 @@ index a408b43..823a3ad 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 307d014..3f9472c 100644 +index 307d014..c9f84fb 100644 --- a/mod.rs +++ b/mod.rs @@ -247,49 +247,32 @@ @@ -1012,8 +1026,6 @@ index 307d014..3f9472c 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1028,7 +1040,8 @@ index 307d014..3f9472c 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1042,9 +1055,8 @@ index 307d014..3f9472c 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/f1e191c0b959111aef19f3aa06b7f1743419470c.patch b/patches/f1e191c0b959111aef19f3aa06b7f1743419470c.patch index 3c5a660..95c6e82 100644 --- a/patches/f1e191c0b959111aef19f3aa06b7f1743419470c.patch +++ b/patches/f1e191c0b959111aef19f3aa06b7f1743419470c.patch @@ -283,7 +283,7 @@ index ccebf36..17e6955 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 420fede..670e362 100644 +index 420fede..d4242f7 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index 420fede..670e362 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = try!(Read::read(&mut try!(self.fill_buf()), buf)); -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = try!(Read::read(&mut try!(self.fill_buf()), buf)); ++ let n = try!(Read::read(&mut try!(self.get_buf()), buf)); + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index 420fede..670e362 100644 impl<'a> Write for Cursor<&'a mut [u8]> { fn write(&mut self, data: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); -@@ -239,7 +228,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -239,7 +233,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -267,7 +255,6 @@ impl Write for Cursor> { +@@ -267,8 +261,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { fn write(&mut self, buf: &[u8]) -> io::Result { let pos = cmp::min(self.pos, self.inner.len() as u64); + let amt = try!((&mut self.inner[(pos as usize)..]).write(buf)); diff --git a/error.rs b/error.rs index e3f17c8..50e3658 100644 --- a/error.rs @@ -976,7 +990,7 @@ index 1d97611..110cfac 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 61334f3..9d9263f 100644 +index 61334f3..26b9102 100644 --- a/mod.rs +++ b/mod.rs @@ -248,49 +248,32 @@ @@ -1006,8 +1020,6 @@ index 61334f3..9d9263f 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1022,7 +1034,8 @@ index 61334f3..9d9263f 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1036,9 +1049,8 @@ index 61334f3..9d9263f 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/patches/fda473f00fa07b9a8246b104396f9922e54bff16.patch b/patches/fda473f00fa07b9a8246b104396f9922e54bff16.patch index 6d5afb3..6e4fed3 100644 --- a/patches/fda473f00fa07b9a8246b104396f9922e54bff16.patch +++ b/patches/fda473f00fa07b9a8246b104396f9922e54bff16.patch @@ -283,7 +283,7 @@ index a92ca95..e23b74f 100644 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LineWriter") diff --git a/cursor.rs b/cursor.rs -index 2d78055..1db50ee 100644 +index 2d78055..a269a7c 100644 --- a/cursor.rs +++ b/cursor.rs @@ -8,10 +8,10 @@ @@ -359,23 +359,33 @@ index 2d78055..1db50ee 100644 impl io::Seek for Cursor where T: AsRef<[u8]> { fn seek(&mut self, style: SeekFrom) -> io::Result { let pos = match style { -@@ -210,7 +202,6 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { +@@ -210,25 +202,27 @@ impl io::Seek for Cursor where T: AsRef<[u8]> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl Read for Cursor where T: AsRef<[u8]> { fn read(&mut self, buf: &mut [u8]) -> io::Result { - let n = Read::read(&mut self.fill_buf()?, buf)?; -@@ -219,7 +210,6 @@ impl Read for Cursor where T: AsRef<[u8]> { +- let n = Read::read(&mut self.fill_buf()?, buf)?; ++ let n = Read::read(&mut self.get_buf()?, buf)?; + self.pos += n as u64; + Ok(n) } } -#[stable(feature = "rust1", since = "1.0.0")] - impl BufRead for Cursor where T: AsRef<[u8]> { - fn fill_buf(&mut self) -> io::Result<&[u8]> { +-impl BufRead for Cursor where T: AsRef<[u8]> { +- fn fill_buf(&mut self) -> io::Result<&[u8]> { ++impl Cursor where T: AsRef<[u8]> { ++ fn get_buf(&mut self) -> io::Result<&[u8]> { let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64); -@@ -228,7 +218,6 @@ impl BufRead for Cursor where T: AsRef<[u8]> { + Ok(&self.inner.as_ref()[(amt as usize)..]) + } ++} ++ ++#[cfg(feature = "collections")] ++impl BufRead for Cursor where T: AsRef<[u8]> { ++ fn fill_buf(&mut self) -> io::Result<&[u8]> { self.get_buf() } fn consume(&mut self, amt: usize) { self.pos += amt as u64; } } @@ -383,22 +393,26 @@ index 2d78055..1db50ee 100644 impl<'a> Write for Cursor<&'a mut [u8]> { #[inline] fn write(&mut self, data: &[u8]) -> io::Result { -@@ -240,7 +229,6 @@ impl<'a> Write for Cursor<&'a mut [u8]> { +@@ -240,7 +234,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "rust1", since = "1.0.0")] ++#[cfg(feature = "collections")] impl Write for Cursor> { fn write(&mut self, buf: &[u8]) -> io::Result { // Make sure the internal buffer is as least as big as where we -@@ -268,7 +256,6 @@ impl Write for Cursor> { +@@ -268,8 +262,8 @@ impl Write for Cursor> { fn flush(&mut self) -> io::Result<()> { Ok(()) } } -#[stable(feature = "cursor_box_slice", since = "1.5.0")] - impl Write for Cursor> { +-impl Write for Cursor> { ++#[cfg(feature = "alloc")] ++impl Write for Cursor<::alloc::boxed::Box<[u8]>> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { + let pos = cmp::min(self.pos, self.inner.len() as u64); diff --git a/error.rs b/error.rs index 5333b0a..25bbd8b 100644 --- a/error.rs @@ -982,7 +996,7 @@ index a408b43..823a3ad 100644 const LO_U64: u64 = 0x0101010101010101; const HI_U64: u64 = 0x8080808080808080; diff --git a/mod.rs b/mod.rs -index 88fd418..94508d2 100644 +index 88fd418..5c487a6 100644 --- a/mod.rs +++ b/mod.rs @@ -247,49 +247,32 @@ @@ -1012,8 +1026,6 @@ index 88fd418..94508d2 100644 -#[stable(feature = "rust1", since = "1.0.0")] -pub use self::buffered::IntoInnerError; -#[stable(feature = "rust1", since = "1.0.0")] --pub use self::cursor::Cursor; --#[stable(feature = "rust1", since = "1.0.0")] +use core::fmt; +use core::iter::{Iterator}; +use core::marker::Sized; @@ -1028,7 +1040,8 @@ index 88fd418..94508d2 100644 + +#[cfg(feature="collections")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; +#[cfg(feature="collections")] pub use self::buffered::IntoInnerError; -+#[cfg(feature="collections")] pub use self::cursor::Cursor; + pub use self::cursor::Cursor; +-#[stable(feature = "rust1", since = "1.0.0")] pub use self::error::{Result, Error, ErrorKind}; -#[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat}; @@ -1042,9 +1055,8 @@ index 88fd418..94508d2 100644 pub mod prelude; -mod buffered; --mod cursor; +#[cfg(feature="collections")] mod buffered; -+#[cfg(feature="collections")] mod cursor; + mod cursor; mod error; mod impls; -mod lazy; diff --git a/src/lib.rs b/src/lib.rs index 664a5f7..6eca89b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,7 @@ //! the [std documentation](https://doc.rust-lang.org/nightly/std/io/index.html) //! for a full description of the functionality. #![allow(stable_features,unused_features)] -#![feature(question_mark,const_fn,collections,alloc,unicode,copy_from_slice,str_char)] +#![feature(question_mark,const_fn,collections,alloc,unicode,copy_from_slice,str_char,try_from)] #![no_std] #[cfg_attr(feature="collections",macro_use)]