#thiserror #error #derive-error #enums #detail

macro no-std thiserror-core-impl

Implementation detail of the thiserror crate

3 stable releases

1.0.50 Nov 19, 2023
1.0.38 Feb 19, 2023
1.0.37 Dec 10, 2022

#30 in #thiserror

Download history 42807/week @ 2024-07-23 35740/week @ 2024-07-30 41363/week @ 2024-08-06 48973/week @ 2024-08-13 37825/week @ 2024-08-20 48220/week @ 2024-08-27 50049/week @ 2024-09-03 38183/week @ 2024-09-10 39139/week @ 2024-09-17 39808/week @ 2024-09-24 44186/week @ 2024-10-01 43119/week @ 2024-10-08 45981/week @ 2024-10-15 45381/week @ 2024-10-22 42316/week @ 2024-10-29 49341/week @ 2024-11-05

192,301 downloads per month
Used in 30 crates (via thiserror-core)

MIT/Apache

57KB
1.5K SLoC

derive(Error) for no_std environments

This is a fork of thiserror using the nightly only, experimental error_in_core feature in no_std environments.

Usage

// Cargo.toml
[dependencies]
thiserror = { version = "1.0", package = "thiserror-core", default-features = false }

Compiler support: requires rustc 1.56+ @@ -23,200 +18,16 @@ thiserror = "1.0"

Example

// main.rs / lib.rs
#![no_std]
#![feature(error_in_core)]

Differences between thiserror and thiserror-core

Differences are kept to a minimum and changes in thiserror master will be adopted by rebasing thiserror-core.

With the default std feature enabled, any functional difference between thiserror and thiserror-core is considered a bug.

As soon as equivalent changes are adopted, this crate will be updated to re-export thiserror.

Dependencies

~250–700KB
~17K SLoC