Skip to content

nightly-2025-10-12 adds a breaking change to std::io::Error::description() #147658

@ADD-SP

Description

@ADD-SP

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.

rust-lang/libs-team#615 (comment)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libsRelevant 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions