Skip to content

Commit c74f2a5

Browse files
authored
Unrolled build for #144373
Rollup merge of #144373 - hkBst:remove-deprecated-1, r=jhpratt remove deprecated Error::description in impls [libs-api permission](rust-lang/libs-team#615 (comment)) r? `@cuviper` or `@jhpratt`
2 parents 5ab6924 + 845311a commit c74f2a5

File tree

41 files changed

+79
-379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+79
-379
lines changed

compiler/rustc_thread_pool/src/lib.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -787,18 +787,7 @@ impl ThreadPoolBuildError {
787787
}
788788
}
789789

790-
const GLOBAL_POOL_ALREADY_INITIALIZED: &str =
791-
"The global thread pool has already been initialized.";
792-
793790
impl Error for ThreadPoolBuildError {
794-
#[allow(deprecated)]
795-
fn description(&self) -> &str {
796-
match self.kind {
797-
ErrorKind::GlobalPoolAlreadyInitialized => GLOBAL_POOL_ALREADY_INITIALIZED,
798-
ErrorKind::IOError(ref e) => e.description(),
799-
}
800-
}
801-
802791
fn source(&self) -> Option<&(dyn Error + 'static)> {
803792
match &self.kind {
804793
ErrorKind::GlobalPoolAlreadyInitialized => None,
@@ -810,7 +799,9 @@ impl Error for ThreadPoolBuildError {
810799
impl fmt::Display for ThreadPoolBuildError {
811800
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
812801
match &self.kind {
813-
ErrorKind::GlobalPoolAlreadyInitialized => GLOBAL_POOL_ALREADY_INITIALIZED.fmt(f),
802+
ErrorKind::GlobalPoolAlreadyInitialized => {
803+
"The global thread pool has already been initialized.".fmt(f)
804+
}
814805
ErrorKind::IOError(e) => e.fmt(f),
815806
}
816807
}

library/alloc/src/boxed.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,11 +2128,6 @@ impl<F: ?Sized + Future + Unpin, A: Allocator> Future for Box<F, A> {
21282128

21292129
#[stable(feature = "box_error", since = "1.8.0")]
21302130
impl<E: Error> Error for Box<E> {
2131-
#[allow(deprecated, deprecated_in_future)]
2132-
fn description(&self) -> &str {
2133-
Error::description(&**self)
2134-
}
2135-
21362131
#[allow(deprecated)]
21372132
fn cause(&self) -> Option<&dyn Error> {
21382133
Error::cause(&**self)

library/alloc/src/boxed/convert.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,7 @@ impl<'a> From<String> for Box<dyn Error + Send + Sync + 'a> {
608608
fn from(err: String) -> Box<dyn Error + Send + Sync + 'a> {
609609
struct StringError(String);
610610

611-
impl Error for StringError {
612-
#[allow(deprecated)]
613-
fn description(&self) -> &str {
614-
&self.0
615-
}
616-
}
611+
impl Error for StringError {}
617612

618613
impl fmt::Display for StringError {
619614
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

library/alloc/src/collections/btree/map/entry.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,6 @@ impl<'a, K: Debug + Ord, V: Debug, A: Allocator + Clone> fmt::Display
136136
impl<'a, K: core::fmt::Debug + Ord, V: core::fmt::Debug> core::error::Error
137137
for crate::collections::btree_map::OccupiedError<'a, K, V>
138138
{
139-
#[allow(deprecated)]
140-
fn description(&self) -> &str {
141-
"key already exists"
142-
}
143139
}
144140

145141
impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> {

library/alloc/src/ffi/c_str.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,17 +1061,10 @@ impl IntoStringError {
10611061
}
10621062
}
10631063

1064-
impl IntoStringError {
1065-
fn description(&self) -> &str {
1066-
"C string contained non-utf8 bytes"
1067-
}
1068-
}
1069-
10701064
#[stable(feature = "cstring_into", since = "1.7.0")]
10711065
impl fmt::Display for IntoStringError {
1072-
#[allow(deprecated, deprecated_in_future)]
10731066
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1074-
self.description().fmt(f)
1067+
"C string contained non-utf8 bytes".fmt(f)
10751068
}
10761069
}
10771070

@@ -1291,23 +1284,13 @@ impl PartialEq<CString> for Cow<'_, CStr> {
12911284
}
12921285

12931286
#[stable(feature = "rust1", since = "1.0.0")]
1294-
impl core::error::Error for NulError {
1295-
#[allow(deprecated)]
1296-
fn description(&self) -> &str {
1297-
"nul byte found in data"
1298-
}
1299-
}
1287+
impl core::error::Error for NulError {}
13001288

13011289
#[stable(feature = "cstring_from_vec_with_nul", since = "1.58.0")]
13021290
impl core::error::Error for FromVecWithNulError {}
13031291

13041292
#[stable(feature = "cstring_into", since = "1.7.0")]
13051293
impl core::error::Error for IntoStringError {
1306-
#[allow(deprecated)]
1307-
fn description(&self) -> &str {
1308-
"C string contained non-utf8 bytes"
1309-
}
1310-
13111294
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
13121295
Some(&self.error)
13131296
}

library/alloc/src/string.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,20 +2285,10 @@ impl fmt::Display for FromUtf16Error {
22852285
}
22862286

22872287
#[stable(feature = "rust1", since = "1.0.0")]
2288-
impl Error for FromUtf8Error {
2289-
#[allow(deprecated)]
2290-
fn description(&self) -> &str {
2291-
"invalid utf-8"
2292-
}
2293-
}
2288+
impl Error for FromUtf8Error {}
22942289

22952290
#[stable(feature = "rust1", since = "1.0.0")]
2296-
impl Error for FromUtf16Error {
2297-
#[allow(deprecated)]
2298-
fn description(&self) -> &str {
2299-
"invalid utf-16"
2300-
}
2301-
}
2291+
impl Error for FromUtf16Error {}
23022292

23032293
#[cfg(not(no_global_oom_handling))]
23042294
#[stable(feature = "rust1", since = "1.0.0")]

library/alloc/src/sync.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4113,11 +4113,6 @@ impl<T: ?Sized, A: Allocator> Drop for UniqueArcUninit<T, A> {
41134113

41144114
#[stable(feature = "arc_error", since = "1.52.0")]
41154115
impl<T: core::error::Error + ?Sized> core::error::Error for Arc<T> {
4116-
#[allow(deprecated, deprecated_in_future)]
4117-
fn description(&self) -> &str {
4118-
core::error::Error::description(&**self)
4119-
}
4120-
41214116
#[allow(deprecated)]
41224117
fn cause(&self) -> Option<&dyn core::error::Error> {
41234118
core::error::Error::cause(&**self)

library/core/src/array/mod.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,18 +184,12 @@ pub struct TryFromSliceError(());
184184
impl fmt::Display for TryFromSliceError {
185185
#[inline]
186186
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
187-
#[allow(deprecated)]
188-
self.description().fmt(f)
187+
"could not convert slice to array".fmt(f)
189188
}
190189
}
191190

192191
#[stable(feature = "try_from", since = "1.34.0")]
193-
impl Error for TryFromSliceError {
194-
#[allow(deprecated)]
195-
fn description(&self) -> &str {
196-
"could not convert slice to array"
197-
}
198-
}
192+
impl Error for TryFromSliceError {}
199193

200194
#[stable(feature = "try_from_slice_error", since = "1.36.0")]
201195
#[rustc_const_unstable(feature = "const_try", issue = "74935")]

library/core/src/char/convert.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,16 @@ enum CharErrorKind {
193193
}
194194

195195
#[stable(feature = "char_from_str", since = "1.20.0")]
196-
impl Error for ParseCharError {
197-
#[allow(deprecated)]
198-
fn description(&self) -> &str {
199-
match self.kind {
200-
CharErrorKind::EmptyString => "cannot parse char from empty string",
201-
CharErrorKind::TooManyChars => "too many characters in string",
202-
}
203-
}
204-
}
196+
impl Error for ParseCharError {}
205197

206198
#[stable(feature = "char_from_str", since = "1.20.0")]
207199
impl fmt::Display for ParseCharError {
208200
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
209-
#[allow(deprecated)]
210-
self.description().fmt(f)
201+
match self.kind {
202+
CharErrorKind::EmptyString => "cannot parse char from empty string",
203+
CharErrorKind::TooManyChars => "too many characters in string",
204+
}
205+
.fmt(f)
211206
}
212207
}
213208

library/core/src/char/decode.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,4 @@ impl fmt::Display for DecodeUtf16Error {
126126
}
127127

128128
#[stable(feature = "decode_utf16", since = "1.9.0")]
129-
impl Error for DecodeUtf16Error {
130-
#[allow(deprecated)]
131-
fn description(&self) -> &str {
132-
"unpaired surrogate found"
133-
}
134-
}
129+
impl Error for DecodeUtf16Error {}

0 commit comments

Comments
 (0)