about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-12-14 04:09:34 +0100
committerGitHub <noreply@github.com>2024-12-14 04:09:34 +0100
commit0b5003eaf083a3525a7b2ee8b4745b8c95344afe (patch)
treecfc89566599ed9a466971038d64dfe84874a6a33
parent198d2d486db63c3a9f577c7b42eca6134a7f67b3 (diff)
parent38eb608a4302ac7895a29bb715e881b8021f11ee (diff)
Rollup merge of #134255 - bjoernager:master, r=Noratrieb
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
-rw-r--r--library/core/src/error.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/error.rs b/library/core/src/error.rs
index 91549f49f9f..9dbea57fa1f 100644
--- a/library/core/src/error.rs
+++ b/library/core/src/error.rs
@@ -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>`].
@@ -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()
     }
 }