diff options
| author | bors <bors@rust-lang.org> | 2022-02-01 07:04:17 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-02-01 07:04:17 +0000 |
| commit | 93e8201ca75ebadc341c20c92ad24a4122c83991 (patch) | |
| tree | f1c0bbe3af9e7e5318afb05de365ec68d8826f08 /library/std/src | |
| parent | 25862ffc8d360b34dd8ec82a2f01750aaab976b7 (diff) | |
| parent | 81900f469239738d7166ad2022f60182817d57ca (diff) | |
| download | rust-93e8201ca75ebadc341c20c92ad24a4122c83991.tar.gz rust-93e8201ca75ebadc341c20c92ad24a4122c83991.zip | |
Auto merge of #93534 - ehuss:rollup-9ecozo9, r=ehuss
Rollup of 9 pull requests Successful merges: - #91343 (Fix suggestion to slice if scrutinee is a `Result` or `Option`) - #93019 (If an integer is entered with an upper-case base prefix (0Xbeef, 0O755, 0B1010), suggest to make it lowercase) - #93090 (`impl Display for io::ErrorKind`) - #93456 (Remove an unnecessary transmute from opaque::Encoder) - #93492 (Hide failed command unless in verbose mode) - #93504 (kmc-solid: Increase the default stack size) - #93513 (Allow any pretty printed line to have at least 60 chars) - #93532 (Update books) - #93533 (Update cargo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/io/error.rs | 18 | ||||
| -rw-r--r-- | library/std/src/sys/itron/thread.rs | 3 |
2 files changed, 19 insertions, 2 deletions
diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs index 210a9ec7183..074d693b831 100644 --- a/library/std/src/io/error.rs +++ b/library/std/src/io/error.rs @@ -361,13 +361,29 @@ impl ErrorKind { } } +#[stable(feature = "io_errorkind_display", since = "1.60.0")] +impl fmt::Display for ErrorKind { + /// Shows a human-readable description of the `ErrorKind`. + /// + /// This is similar to `impl Display for Error`, but doesn't require first converting to Error. + /// + /// # Examples + /// ``` + /// use std::io::ErrorKind; + /// assert_eq!("entity not found", ErrorKind::NotFound.to_string()); + /// ``` + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt.write_str(self.as_str()) + } +} + /// Intended for use for errors not exposed to the user, where allocating onto /// the heap (for normal construction via Error::new) is too costly. #[stable(feature = "io_error_from_errorkind", since = "1.14.0")] impl From<ErrorKind> for Error { /// Converts an [`ErrorKind`] into an [`Error`]. /// - /// This conversion allocates a new error with a simple representation of error kind. + /// This conversion creates a new error with a simple representation of error kind. /// /// # Examples /// diff --git a/library/std/src/sys/itron/thread.rs b/library/std/src/sys/itron/thread.rs index a8ecc1ada4a..5b718a460df 100644 --- a/library/std/src/sys/itron/thread.rs +++ b/library/std/src/sys/itron/thread.rs @@ -77,7 +77,8 @@ const LIFECYCLE_DETACHED_OR_JOINED: usize = usize::MAX; const LIFECYCLE_EXITED_OR_FINISHED_OR_JOIN_FINALIZE: usize = usize::MAX; // there's no single value for `JOINING` -pub const DEFAULT_MIN_STACK_SIZE: usize = 1024 * crate::mem::size_of::<usize>(); +// 64KiB for 32-bit ISAs, 128KiB for 64-bit ISAs. +pub const DEFAULT_MIN_STACK_SIZE: usize = 0x4000 * crate::mem::size_of::<usize>(); impl Thread { /// # Safety |
