Skip to content

Commit aa3ab2b

Browse files
authored
Merge pull request #385 from dtolnay/docnostd
Update documentation on no-std error type conversions
2 parents afe93e7 + 44c3767 commit aa3ab2b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ Cargo.toml. A global allocator is required.
136136
anyhow = { version = "1.0", default-features = false }
137137
```
138138

139-
Since the `?`-based error conversions would normally rely on the
140-
`std::error::Error` trait which is only available through std, no_std mode will
141-
require an explicit `.map_err(Error::msg)` when working with a non-Anyhow error
142-
type inside a function that returns Anyhow's error type.
139+
With versions of Rust older than 1.81, no_std mode may require an additional
140+
`.map_err(Error::msg)` when working with a non-Anyhow error type inside a
141+
function that returns Anyhow's error type, as the trait that `?`-based error
142+
conversions are defined by is only available in std in those old versions.
143143

144144
<br>
145145

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@
201201
//! anyhow = { version = "1.0", default-features = false }
202202
//! ```
203203
//!
204-
//! Since the `?`-based error conversions would normally rely on the
205-
//! `std::error::Error` trait which is only available through std, no_std mode
206-
//! will require an explicit `.map_err(Error::msg)` when working with a
207-
//! non-Anyhow error type inside a function that returns Anyhow's error type.
204+
//! With versions of Rust older than 1.81, no_std mode may require an additional
205+
//! `.map_err(Error::msg)` when working with a non-Anyhow error type inside a
206+
//! function that returns Anyhow's error type, as the trait that `?`-based error
207+
//! conversions are defined by is only available in std in those old versions.
208208
209209
#![doc(html_root_url = "https://docs.rs/anyhow/1.0.87")]
210210
#![cfg_attr(error_generic_member_access, feature(error_generic_member_access))]

0 commit comments

Comments
 (0)