Skip to content

Commit

Permalink
Merge branch 'master' into anyhow-compat
Browse files Browse the repository at this point in the history
  • Loading branch information
ten3roberts authored Aug 29, 2024
2 parents 037f999 + 7706273 commit 137217a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 27 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/target
**/*.rs.bk
tags
12 changes: 1 addition & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions color-eyre/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
9 changes: 4 additions & 5 deletions color-eyre/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`:
Expand Down Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions color-spantrace/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
7 changes: 7 additions & 0 deletions eyre/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
16 changes: 8 additions & 8 deletions eyre/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand Down

0 comments on commit 137217a

Please sign in to comment.