1[package]
2name = "thiserror"
3version = "2.0.12"
4authors = ["David Tolnay <dtolnay@gmail.com>"]
5categories = ["rust-patterns"]
6description = "derive(Error)"
7documentation = "https://docs.rs/thiserror"
8edition = "2021"
9keywords = ["error", "error-handling", "derive"]
10license = "MIT OR Apache-2.0"
11repository = "https://github.com/dtolnay/thiserror"
12rust-version = "1.61"
13
14[features]
15default = ["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())].
28std = []
29
30[dependencies]
31thiserror-impl = { version = "=2.0.12", path = "impl" }
32
33[dev-dependencies]
34anyhow = "1.0.73"
35ref-cast = "1.0.18"
36rustversion = "1.0.13"
37trybuild = { version = "1.0.81", features = ["diff"] }
38
39[workspace]
40members = ["impl", "tests/no-std"]
41
42[package.metadata.docs.rs]
43targets = ["x86_64-unknown-linux-gnu"]
44rustdoc-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