From 48fbf526ff148477e5b72bb06d02c19f4bef25dd Mon Sep 17 00:00:00 2001 From: Amos Wenger Date: Fri, 2 Aug 2024 16:58:58 +0200 Subject: [PATCH] Add rubicon 3.x support --- eyre/Cargo.toml | 1 + eyre/src/lib.rs | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/eyre/Cargo.toml b/eyre/Cargo.toml index 196400b..2a91bd0 100644 --- a/eyre/Cargo.toml +++ b/eyre/Cargo.toml @@ -21,6 +21,7 @@ track-caller = [] indenter = { workspace = true } once_cell = { workspace = true } pyo3 = { version = "0.20", optional = true, default-features = false } +rubicon = "3.3.5" [dev-dependencies] futures = { version = "0.3", default-features = false } diff --git a/eyre/src/lib.rs b/eyre/src/lib.rs index 64ca598..29ee316 100644 --- a/eyre/src/lib.rs +++ b/eyre/src/lib.rs @@ -470,7 +470,9 @@ pub struct Report { type ErrorHook = Box Box + Sync + Send + 'static>; -static HOOK: OnceCell = OnceCell::new(); +rubicon::process_local! { + static HOOK: OnceCell = OnceCell::new(); +} /// Error indicating that `set_hook` was unable to install the provided ErrorHook #[derive(Debug, Clone, Copy)] @@ -1320,3 +1322,8 @@ pub mod private { } } } + +rubicon::compatibility_check!( + ("version", env!("CARGO_PKG_VERSION")), + // no features would change the layout of structs +);