Skip to content

Commit

Permalink
Only enable error_arc_ref past Rust 1.52
Browse files Browse the repository at this point in the history
Requires `impl Error for Arc<T>`, which only exists on recent versions.
  • Loading branch information
Techcable committed Jan 3, 2024
1 parent cc5e8e8 commit 61a63cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ release_max_level_trace = []
erased-serde = { version = "0.3", optional = true }
serde = { version = "1", optional = true }
serde_derive = { version = "1", optional = true }

[dev-dependencies]
# NOTE: This is just a macro (not a runtime dependency)
#
# It is used to conditionally enable use of newer rust language
# features depending on the compiler features.
# Currently, this is not needed because our MSRV is sufficient
# for all the features we use.
# However, in the future we may need to re-add it.
# rustversion = "1"
#
# For the time being, this is only needed for tests.
rustversion = "1"

[[example]]
name = "singlethread"
Expand Down
2 changes: 2 additions & 0 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ mod std_only {
info!(logger, "foo"; "error" => #&error);
}

// requires `impl Error for Arc<T>` - since 1.52
#[rustversion::since(1.52)]
#[test]
fn error_arc_ref() {
let error = TestError::new("foo");
Expand Down

0 comments on commit 61a63cb

Please sign in to comment.