@@ -840,6 +840,9 @@ pub trait Read {
840
840
of where errors happen is currently \
841
841
unclear and may change",
842
842
issue = "27802" ) ]
843
+ #[ rustc_deprecated( since = "1.27.0" , reason = "Use str::from_utf8 instead:
844
+ https://doc.rust-lang.org/nightly/std/str/struct.Utf8Error.html#examples" ) ]
845
+ #[ allow( deprecated) ]
843
846
fn chars ( self ) -> Chars < Self > where Self : Sized {
844
847
Chars { inner : self }
845
848
}
@@ -2010,16 +2013,22 @@ impl<R: Read> Iterator for Bytes<R> {
2010
2013
/// [chars]: trait.Read.html#method.chars
2011
2014
#[ unstable( feature = "io" , reason = "awaiting stability of Read::chars" ,
2012
2015
issue = "27802" ) ]
2016
+ #[ rustc_deprecated( since = "1.27.0" , reason = "Use str::from_utf8 instead:
2017
+ https://doc.rust-lang.org/nightly/std/str/struct.Utf8Error.html#examples" ) ]
2013
2018
#[ derive( Debug ) ]
2019
+ #[ allow( deprecated) ]
2014
2020
pub struct Chars < R > {
2015
2021
inner : R ,
2016
2022
}
2017
2023
2018
2024
/// An enumeration of possible errors that can be generated from the `Chars`
2019
2025
/// adapter.
2020
- #[ derive( Debug ) ]
2021
2026
#[ unstable( feature = "io" , reason = "awaiting stability of Read::chars" ,
2022
2027
issue = "27802" ) ]
2028
+ #[ rustc_deprecated( since = "1.27.0" , reason = "Use str::from_utf8 instead:
2029
+ https://doc.rust-lang.org/nightly/std/str/struct.Utf8Error.html#examples" ) ]
2030
+ #[ derive( Debug ) ]
2031
+ #[ allow( deprecated) ]
2023
2032
pub enum CharsError {
2024
2033
/// Variant representing that the underlying stream was read successfully
2025
2034
/// but it did not contain valid utf8 data.
@@ -2031,6 +2040,7 @@ pub enum CharsError {
2031
2040
2032
2041
#[ unstable( feature = "io" , reason = "awaiting stability of Read::chars" ,
2033
2042
issue = "27802" ) ]
2043
+ #[ allow( deprecated) ]
2034
2044
impl < R : Read > Iterator for Chars < R > {
2035
2045
type Item = result:: Result < char , CharsError > ;
2036
2046
@@ -2063,6 +2073,7 @@ impl<R: Read> Iterator for Chars<R> {
2063
2073
2064
2074
#[ unstable( feature = "io" , reason = "awaiting stability of Read::chars" ,
2065
2075
issue = "27802" ) ]
2076
+ #[ allow( deprecated) ]
2066
2077
impl std_error:: Error for CharsError {
2067
2078
fn description ( & self ) -> & str {
2068
2079
match * self {
@@ -2080,6 +2091,7 @@ impl std_error::Error for CharsError {
2080
2091
2081
2092
#[ unstable( feature = "io" , reason = "awaiting stability of Read::chars" ,
2082
2093
issue = "27802" ) ]
2094
+ #[ allow( deprecated) ]
2083
2095
impl fmt:: Display for CharsError {
2084
2096
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2085
2097
match * self {
0 commit comments