diff --git a/build/probe.rs b/build/probe.rs index 0dce6f5..2843787 100644 --- a/build/probe.rs +++ b/build/probe.rs @@ -5,7 +5,7 @@ #![feature(error_generic_member_access)] use std::error::{Error, Request}; -use std::fmt::{self, Debug, Display}; +use core::fmt::{self, Debug, Display}; struct MyError(Thing); struct Thing; diff --git a/src/aserror.rs b/src/aserror.rs index 54fc6f1..4cd0fec 100644 --- a/src/aserror.rs +++ b/src/aserror.rs @@ -1,5 +1,5 @@ use std::error::Error; -use std::panic::UnwindSafe; +use core::panic::UnwindSafe; #[doc(hidden)] pub trait AsDynError<'a>: Sealed { diff --git a/src/display.rs b/src/display.rs index 27098f1..3c43216 100644 --- a/src/display.rs +++ b/src/display.rs @@ -1,4 +1,4 @@ -use std::fmt::Display; +use core::fmt::Display; use std::path::{self, Path, PathBuf}; #[doc(hidden)] diff --git a/src/lib.rs b/src/lib.rs index 81a04b0..9b9c5af 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -62,7 +62,7 @@ //! which may be arbitrary expressions. For example: //! //! ```rust -//! # use std::i32; +//! # use core::i32; //! # use thiserror::Error; //! # //! #[derive(Error, Debug)] @@ -129,7 +129,7 @@ //! std::error::Error` will work as a source. //! //! ```rust -//! # use std::fmt::{self, Display}; +//! # use core::fmt::{self, Display}; //! # use thiserror::Error; //! # //! #[derive(Error, Debug)] diff --git a/tests/test_display.rs b/tests/test_display.rs index 95a210f..c05d157 100644 --- a/tests/test_display.rs +++ b/tests/test_display.rs @@ -1,6 +1,6 @@ #![allow(clippy::needless_raw_string_hashes, clippy::uninlined_format_args)] -use std::fmt::{self, Display}; +use core::fmt::{self, Display}; use thiserror::Error; fn assert(expected: &str, value: T) { diff --git a/tests/test_error.rs b/tests/test_error.rs index fab934d..eb52cef 100644 --- a/tests/test_error.rs +++ b/tests/test_error.rs @@ -1,6 +1,6 @@ #![allow(dead_code)] -use std::fmt::{self, Display}; +use core::fmt::{self, Display}; use std::io; use thiserror::Error; diff --git a/tests/test_expr.rs b/tests/test_expr.rs index 028f34e..c5e3b4b 100644 --- a/tests/test_expr.rs +++ b/tests/test_expr.rs @@ -1,6 +1,6 @@ #![allow(clippy::iter_cloned_collect, clippy::uninlined_format_args)] -use std::fmt::Display; +use core::fmt::Display; use thiserror::Error; // Some of the elaborate cases from the rcc codebase, which is a C compiler in diff --git a/tests/test_generics.rs b/tests/test_generics.rs index c94d95e..ac5d6f3 100644 --- a/tests/test_generics.rs +++ b/tests/test_generics.rs @@ -1,6 +1,6 @@ #![allow(clippy::needless_late_init, clippy::uninlined_format_args)] -use std::fmt::{self, Debug, Display}; +use core::fmt::{self, Debug, Display}; use thiserror::Error; pub struct NoFormat; diff --git a/tests/test_path.rs b/tests/test_path.rs index a34a3d7..f054077 100644 --- a/tests/test_path.rs +++ b/tests/test_path.rs @@ -1,5 +1,5 @@ +use core::fmt::Display; use ref_cast::RefCast; -use std::fmt::Display; use std::path::{Path, PathBuf}; use thiserror::Error; diff --git a/tests/ui/fallback-impl-with-display.rs b/tests/ui/fallback-impl-with-display.rs index 3341187..23dcf28 100644 --- a/tests/ui/fallback-impl-with-display.rs +++ b/tests/ui/fallback-impl-with-display.rs @@ -1,4 +1,4 @@ -use std::fmt::{self, Display}; +use core::fmt::{self, Display}; use thiserror::Error; #[derive(Error, Debug)] diff --git a/tests/ui/lifetime.rs b/tests/ui/lifetime.rs index 698f8c4..a82909d 100644 --- a/tests/ui/lifetime.rs +++ b/tests/ui/lifetime.rs @@ -1,4 +1,4 @@ -use std::fmt::Debug; +use core::fmt::Debug; use thiserror::Error; #[derive(Error, Debug)]