| 1 | [package] |
| 2 | name = "thiserror" |
| 3 | version = "2.0.12" |
| 4 | authors = ["David Tolnay <dtolnay@gmail.com>" ] |
| 5 | categories = ["rust-patterns" ] |
| 6 | description = "derive(Error)" |
| 7 | documentation = "https://docs.rs/thiserror" |
| 8 | edition = "2021" |
| 9 | keywords = ["error" , "error-handling" , "derive" ] |
| 10 | license = "MIT OR Apache-2.0" |
| 11 | repository = "https://github.com/dtolnay/thiserror" |
| 12 | rust-version = "1.61" |
| 13 | |
| 14 | [features] |
| 15 | default = ["std" ] |
| 16 | |
| 17 | # Std feature enables support for formatting std::path::{Path, PathBuf} |
| 18 | # conveniently in an error message. |
| 19 | # |
| 20 | # #[derive(Error, Debug)] |
| 21 | # #[error("failed to create configuration file {path}")] |
| 22 | # pub struct MyError { |
| 23 | # pub path: PathBuf, |
| 24 | # pub source: std::io::Error, |
| 25 | # } |
| 26 | # |
| 27 | # Without std, this would need to be written #[error("... {}", path.display())]. |
| 28 | std = [] |
| 29 | |
| 30 | [dependencies] |
| 31 | thiserror-impl = { version = "=2.0.12" , path = "impl" } |
| 32 | |
| 33 | [dev-dependencies] |
| 34 | anyhow = "1.0.73" |
| 35 | ref-cast = "1.0.18" |
| 36 | rustversion = "1.0.13" |
| 37 | trybuild = { version = "1.0.81" , features = ["diff" ] } |
| 38 | |
| 39 | [workspace] |
| 40 | members = ["impl" , "tests/no-std" ] |
| 41 | |
| 42 | [package.metadata.docs.rs] |
| 43 | targets = ["x86_64-unknown-linux-gnu" ] |
| 44 | rustdoc-args = [ |
| 45 | "--generate-link-to-definition" , |
| 46 | "--extern-html-root-url=core=https://doc.rust-lang.org" , |
| 47 | "--extern-html-root-url=alloc=https://doc.rust-lang.org" , |
| 48 | "--extern-html-root-url=std=https://doc.rust-lang.org" , |
| 49 | ] |
| 50 | |