diff --git a/.gitignore b/.gitignore index 72ce2b3..53eaa21 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /target **/*.rs.bk -tags diff --git a/Cargo.lock b/Cargo.lock index 70e678f..45d4183 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,7 +121,7 @@ dependencies = [ "ansi-parser", "backtrace", "color-spantrace", - "eyre 0.6.12", + "eyre", "indenter", "once_cell", "owo-colors", @@ -169,16 +169,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632" -[[package]] -name = "eyre" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" -dependencies = [ - "indenter", - "once_cell", -] - [[package]] name = "eyre" version = "1.0.0" diff --git a/color-eyre/Cargo.toml b/color-eyre/Cargo.toml index 795f6f6..2b5b658 100644 --- a/color-eyre/Cargo.toml +++ b/color-eyre/Cargo.toml @@ -18,9 +18,9 @@ issue-url = ["url"] track-caller = [] [dependencies] -eyre = "0.6.1" +eyre = { version = "1.0.0", path = "../eyre" } tracing-error = { version = "0.2.0", optional = true } -backtrace = { version = "0.3.48", features = ["gimli-symbolize"] } +backtrace = { version = "0.3.59" } indenter = { workspace = true } owo-colors = { workspace = true } color-spantrace = { version = "0.2", path = "../color-spantrace", optional = true } diff --git a/color-eyre/README.md b/color-eyre/README.md index e991641..e3c50a8 100644 --- a/color-eyre/README.md +++ b/color-eyre/README.md @@ -57,8 +57,7 @@ color-eyre = { version = "0.6", default-features = false } color-eyre defaults to capturing span traces. This is because `SpanTrace` capture is significantly cheaper than `Backtrace` capture. However, like backtraces, span traces are most useful for debugging applications, and it's -not uncommon to want to disable span trace capture by default to keep noise out -developer. +not uncommon to want to disable span trace capture by default to keep noise out. To disable span trace capture you must explicitly set one of the env variables that regulate `SpanTrace` capture to `"0"`: @@ -211,9 +210,9 @@ For an example of how to setup custom filters, check out [`examples/custom_filte [`eyre::Result`]: https://docs.rs/eyre/*/eyre/type.Result.html [`Handler`]: https://docs.rs/color-eyre/*/color_eyre/struct.Handler.html [`examples/usage.rs`]: https://github.com/eyre-rs/color-eyre/blob/master/examples/usage.rs -[`examples/custom_filter.rs`]: https://github.com/eyre-rs/eyre/tree/master/color-eyre/blob/master/examples/custom_filter.rs -[`examples/custom_section.rs`]: https://github.com/eyre-rs/eyre/tree/master/color-eyre/blob/master/examples/custom_section.rs -[`examples/multiple_errors.rs`]: https://github.com/eyre-rs/eyre/tree/master/color-eyre/blob/master/examples/multiple_errors.rs +[`examples/custom_filter.rs`]: https://github.com/eyre-rs/eyre/blob/master/color-eyre/examples/custom_filter.rs +[`examples/custom_section.rs`]: https://github.com/eyre-rs/eyre/blob/master/color-eyre/examples/custom_section.rs +[`examples/multiple_errors.rs`]: https://github.com/eyre-rs/eyre/blob/master/color-eyre/examples/multiple_errors.rs #### License diff --git a/color-spantrace/build.rs b/color-spantrace/build.rs index aae2878..2475cff 100644 --- a/color-spantrace/build.rs +++ b/color-spantrace/build.rs @@ -20,6 +20,9 @@ enum Toolchain { impl Toolchain { fn set_feature(self) { + println!("cargo:rustc-check-cfg=cfg(nightly)"); + println!("cargo:rustc-check-cfg=cfg(beta)"); + println!("cargo:rustc-check-cfg=cfg(stable)"); match self { Toolchain::Nightly => println!("cargo:rustc-cfg=nightly"), Toolchain::Beta => println!("cargo:rustc-cfg=beta"), diff --git a/eyre/build.rs b/eyre/build.rs index d083edd..72f25a6 100644 --- a/eyre/build.rs +++ b/eyre/build.rs @@ -5,6 +5,13 @@ use std::{ }; fn main() { + println!("cargo:rustc-check-cfg=cfg(nightly)"); + println!("cargo:rustc-check-cfg=cfg(track_caller)"); + println!("cargo:rustc-check-cfg=cfg(generic_member_access)"); + println!("cargo:rustc-check-cfg=cfg(eyre_no_fmt_args_capture)"); + println!("cargo:rustc-check-cfg=cfg(backtrace)"); + println!("cargo:rustc-check-cfg=cfg(eyre_no_fmt_arguments_as_str)"); + println!("cargo:rustc-check-cfg=cfg(doc_cfg)"); let ac = autocfg::new(); // https://github.com/rust-lang/rust/issues/99301 [nightly] diff --git a/eyre/src/lib.rs b/eyre/src/lib.rs index 9b9dab2..386f444 100644 --- a/eyre/src/lib.rs +++ b/eyre/src/lib.rs @@ -39,16 +39,16 @@ //! to avoid using `eyre::Report` as your public error type. //! //! - You export an undocumented error interface that is otherwise still -//! accessible via downcast, making it hard for users to react to specific -//! errors while not preventing them from depending on details you didn't mean -//! to make part of your public API. +//! accessible via downcast, making it hard for users to react to specific +//! errors while not preventing them from depending on details you didn't mean +//! to make part of your public API. //! - This in turn makes the error types of all libraries you use a part of -//! your public API as well, and makes changing any of those libraries into -//! undetectable runtime breakage. +//! your public API as well, and makes changing any of those libraries into +//! undetectable runtime breakage. //! - If many of your errors are constructed from strings, you encourage your -//! users to use string comparison for reacting to specific errors, which is -//! brittle and turns updating error messages into potentially undetectable -//! runtime breakage. +//! users to use string comparison for reacting to specific errors, which is +//! brittle and turns updating error messages into potentially undetectable +//! runtime breakage. //! //! ## Details //!