Skip to content

Commit

Permalink
Merge pull request #299 from quartiq/core
Browse files Browse the repository at this point in the history
`std::fmt` -> `core::fmt`
  • Loading branch information
dtolnay committed May 17, 2024
2 parents 870d11b + ce974bc commit 6b2b871
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/aserror.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::error::Error;
use std::panic::UnwindSafe;
use core::panic::UnwindSafe;

#[doc(hidden)]
pub trait AsDynError<'a>: Sealed {
Expand Down
2 changes: 1 addition & 1 deletion src/display.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::fmt::Display;
use core::fmt::Display;
use std::path::{self, Path, PathBuf};

#[doc(hidden)]
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
//! which may be arbitrary expressions. For example:
//!
//! ```rust
//! # use std::i32;
//! # use core::i32;
//! # use thiserror::Error;
//! #
//! #[derive(Error, Debug)]
Expand Down Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_display.rs
Original file line number Diff line number Diff line change
@@ -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<T: Display>(expected: &str, value: T) {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(dead_code)]

use std::fmt::{self, Display};
use core::fmt::{self, Display};
use std::io;
use thiserror::Error;

Expand Down
2 changes: 1 addition & 1 deletion tests/test_expr.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_generics.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_path.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use core::fmt::Display;
use ref_cast::RefCast;
use std::fmt::Display;
use std::path::{Path, PathBuf};
use thiserror::Error;

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/fallback-impl-with-display.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::fmt::{self, Display};
use core::fmt::{self, Display};
use thiserror::Error;

#[derive(Error, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/lifetime.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::fmt::Debug;
use core::fmt::Debug;
use thiserror::Error;

#[derive(Error, Debug)]
Expand Down

0 comments on commit 6b2b871

Please sign in to comment.