# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2021"
rust-version = "1.83.0"
name = "error-stack"
version = "0.7.1"
authors = ["HASH"]
build = "build.rs"
exclude = [
    "package.json",
    "macros",
    "experimental",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A context-aware error-handling library that supports arbitrary attached user data"
documentation = "https://docs.rs/error-stack"
readme = "README.md"
keywords = [
    "error",
    "errorstack",
    "error-handling",
    "report",
    "no_std",
]
categories = [
    "rust-patterns",
    "no-std",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/hashintel/hash/tree/main/libs/error-stack"
resolver = "3"

[[package.metadata.sync.turborepo.extra-dependencies]]
name = "@rust/error-stack-macros"
version = "workspace:*"

[package.metadata.docs.rs]
all-features = true
cargo-args = [
    "-Z",
    "unstable-options",
    "-Z",
    "rustdoc-scrape-examples",
]
targets = ["x86_64-unknown-linux-gnu"]

[package.metadata.cargo-shear]
ignored = [
    "thiserror",
    "owo-colors",
]

[features]
anyhow = ["dep:anyhow"]
backtrace = ["std"]
default = [
    "std",
    "backtrace",
]
eyre = [
    "dep:eyre",
    "std",
]
futures = [
    "dep:futures-core",
    "dep:pin-project-lite",
]
hooks = ["dep:spin"]
serde = ["dep:serde_core"]
spantrace = [
    "dep:tracing-error",
    "tracing",
    "std",
]
std = ["anyhow?/std"]
tracing = ["dep:tracing"]
unstable = []

[lib]
name = "error_stack"
path = "src/lib.rs"

[[example]]
name = "demo"
path = "examples/demo.rs"
doc-scrape-examples = true
required-features = ["std"]

[[example]]
name = "detect"
path = "examples/detect.rs"
doc-scrape-examples = true
required-features = ["std"]

[[example]]
name = "exit_code"
path = "examples/exit_code.rs"
doc-scrape-examples = true
required-features = ["std"]

[[example]]
name = "parse_config"
path = "examples/parse_config.rs"
doc-scrape-examples = true
required-features = ["std"]

[[test]]
name = "common"
path = "tests/common.rs"
test = false

[[test]]
name = "compiletest"
path = "tests/compiletest.rs"

[[test]]
name = "test_attach"
path = "tests/test_attach.rs"

[[test]]
name = "test_attach_printable"
path = "tests/test_attach_printable.rs"

[[test]]
name = "test_backtrace"
path = "tests/test_backtrace.rs"

[[test]]
name = "test_change_context"
path = "tests/test_change_context.rs"

[[test]]
name = "test_compatibility"
path = "tests/test_compatibility.rs"

[[test]]
name = "test_conversion"
path = "tests/test_conversion.rs"

[[test]]
name = "test_debug"
path = "tests/test_debug.rs"

[[test]]
name = "test_display"
path = "tests/test_display.rs"

[[test]]
name = "test_downcast"
path = "tests/test_downcast.rs"

[[test]]
name = "test_extend"
path = "tests/test_extend.rs"

[[test]]
name = "test_frame"
path = "tests/test_frame.rs"

[[test]]
name = "test_iter"
path = "tests/test_iter.rs"

[[test]]
name = "test_macros"
path = "tests/test_macros.rs"

[[test]]
name = "test_provision"
path = "tests/test_provision.rs"

[[test]]
name = "test_serialize"
path = "tests/test_serialize.rs"

[[test]]
name = "test_span_trace"
path = "tests/test_span_trace.rs"

[dependencies.anyhow]
version = ">=1.0.73"
optional = true
default-features = false
public = true

[dependencies.eyre]
version = ">=0.6"
optional = true
default-features = false
public = true

[dependencies.futures-core]
version = ">=0.3"
optional = true
default-features = false
public = true

[dependencies.pin-project-lite]
version = "0.2.16"
optional = true
default-features = false

[dependencies.serde_core]
version = ">=1"
optional = true
default-features = false
public = true

[dependencies.spin]
version = ">=0.9"
features = [
    "rwlock",
    "once",
]
optional = true
default-features = false

[dependencies.tracing]
version = ">=0.1"
optional = true
default-features = false

[dependencies.tracing-error]
version = ">=0.2"
optional = true
default-features = false

[dev-dependencies.ansi-to-html]
version = "0.2.2"
default-features = false

[dev-dependencies.expect-test]
version = "1.5.1"
default-features = false

[dev-dependencies.futures]
version = "0.3.31"
features = ["executor"]
default-features = false

[dev-dependencies.futures-util]
version = "0.3.31"
default-features = false

[dev-dependencies.glob]
version = "0.3.3"

[dev-dependencies.insta]
version = "1.43.2"
features = [
    "filters",
    "ron",
]
default-features = false

[dev-dependencies.owo-colors]
version = "4.2.3"
default-features = false

[dev-dependencies.regex]
version = "1.11.2"
features = [
    "perf",
    "unicode",
]
default-features = false

[dev-dependencies.serde]
version = "1.0.228"
features = ["derive"]
default-features = false

[dev-dependencies.supports-color]
version = "3.0.2"
default-features = false

[dev-dependencies.supports-unicode]
version = "3.0.0"
default-features = false

[dev-dependencies.thiserror]
version = "2.0.17"
default-features = false

[dev-dependencies.tracing]
version = "0.1.41"
features = ["attributes"]
default-features = false

[dev-dependencies.tracing-subscriber]
version = "0.3.20"
default-features = false

[dev-dependencies.trybuild]
version = "1.0.113"
default-features = false

[build-dependencies.rustc_version]
version = "0.4.1"
default-features = false

[lints.clippy]
absolute_paths = "allow"
allow_attributes_without_reason = "allow"
arbitrary_source_item_ordering = "allow"
arithmetic_side_effects = "allow"
as_conversions = "allow"
blanket_clippy_restriction_lints = "allow"
cognitive_complexity = "allow"
default_numeric_fallback = "allow"
exhaustive_enums = "allow"
exhaustive_structs = "allow"
expect_used = "allow"
impl_trait_in_params = "allow"
implicit_return = "allow"
iter_over_hash_type = "allow"
let_underscore_must_use = "allow"
missing_assert_message = "allow"
missing_docs_in_private_items = "allow"
missing_inline_in_public_items = "allow"
missing_trait_methods = "allow"
mod_module_files = "allow"
module_name_repetitions = "allow"
multiple_inherent_impl = "allow"
multiple_unsafe_ops_per_block = "allow"
panic = "allow"
partial_pub_fields = "allow"
pattern_type_mismatch = "allow"
pub_use = "allow"
pub_with_shorthand = "allow"
question_mark_used = "allow"
redundant_pub_crate = "allow"
ref_patterns = "allow"
semicolon_outside_block = "allow"
separated_literal_suffix = "allow"
shadow_reuse = "allow"
shadow_same = "allow"
shadow_unrelated = "allow"
single_call_fn = "allow"
single_char_lifetime_names = "allow"
tests_outside_test_module = "allow"
unimplemented = "allow"
unneeded_field_pattern = "allow"
unreachable = "allow"
unwrap_in_result = "allow"

[lints.clippy.all]
level = "warn"
priority = -1

[lints.clippy.nursery]
level = "warn"
priority = -1

[lints.clippy.pedantic]
level = "warn"
priority = -1

[lints.clippy.restriction]
level = "warn"
priority = -1

[lints.rust]
unreachable_pub = "warn"
unsafe_code = "deny"

[lints.rust.future_incompatible]
level = "warn"
priority = -1

[lints.rust.nonstandard_style]
level = "warn"
priority = -1
