Skip to content

Commit

Permalink
Rollup merge of #134255 - bjoernager:master, r=Noratrieb
Browse files Browse the repository at this point in the history
Update includes in `/library/core/src/error.rs`.

This PR removes the `crate::fmt::Result` include in `/library/core/src/error.rs`.

The main issue with this `use` statement is that it shadows the `Result` type from the prelude (i.e. `crate::result::Result`). This indirectly makes all docs references to `Result` in this module point to the wrong type (but only in `core::error` - not `std::error`, wherein this include isn't present to begin with).

Fixes: #134169
  • Loading branch information
matthiaskrgr authored Dec 14, 2024
2 parents 198d2d4 + 38eb608 commit 0b5003e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![stable(feature = "error_in_core", since = "1.81.0")]

use crate::any::TypeId;
use crate::fmt::{Debug, Display, Formatter, Result};
use crate::fmt::{self, Debug, Display, Formatter};

/// `Error` is a trait representing the basic expectations for error values,
/// i.e., values of type `E` in [`Result<T, E>`].
Expand Down Expand Up @@ -857,7 +857,7 @@ impl<'a> Request<'a> {

#[unstable(feature = "error_generic_member_access", issue = "99301")]
impl<'a> Debug for Request<'a> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.debug_struct("Request").finish_non_exhaustive()
}
}
Expand Down

0 comments on commit 0b5003e

Please sign in to comment.