-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
Steps to reproduce
I tried this code:
use std::error::Error;
use std::io::Error as IoError;
use std::io::ErrorKind as IoErrorKind;
#[expect(deprecated)]
fn desc(err: Box<dyn Error>) {
eprintln!("{}", err.description());
}
fn main() {
let io_err = IoError::new(IoErrorKind::Other, "an I/O error occurred");
desc(Box::new(io_err));
}
I expected to both 1.90.0 and nightly-2025-10-12 prints "an I/O error occurred", but it didn't.
cargo +1.90.0 run
# > an I/O error occurred
cargo +nightly-2025-10-12 run
# > description() is deprecated; use Display
Root causes
This breaking change is introduced by #144373, and its motivation is:
Considering that description has been deprecated for over 5 years, it's reasonable to assume it is no longer used much and it's therefore acceptable to return a lower-quality error message. If anyone actually encounters this in practice then it would be additional motivation to update their outdated dependencies which still use description.
Not a strong enough motivation to me
This is because:
- It motivation is essentially “has been deprecated for over 5 years”, but it does not involve any actually issues encountered by downstream.
- Downstream is actually doing the string-comparison using
std::io::Error::description()
. - Changing the content of the returned
&str
is not a very VISIBLE warning for downstream. Without looking at the changelog of the next Rust stable release, the only chance for downstream to notice that is encountering the actual issue in testing or production.
It is surprising for me to see this kind of change in a non-major release.
Suggestions
Revert #144373.
Ddystopia
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.