From 3ca2cdd795f1569354f8d7366383d7802201bdbf Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 5 Nov 2024 20:50:58 -0800 Subject: [PATCH 1/2] Update dev-dependencies to thiserror v2 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 644181c..97eed33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ backtrace = { version = "0.3.51", optional = true } futures = { version = "0.3", default-features = false } rustversion = "1.0.6" syn = { version = "2.0", features = ["full"] } -thiserror = "1.0.45" +thiserror = "2" trybuild = { version = "1.0.66", features = ["diff"] } [lib] From 2a3901c0b1ab6d7aed466db53a2675b61d3e3401 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 5 Nov 2024 20:57:33 -0800 Subject: [PATCH 2/2] Isolate old rustc version tests from needing anyhow dev-dependencies in lockfile Otherwise: error: failed to select a version for the requirement `syn = "^2.0.87"` candidate versions found which didn't match: 2.0.56, 2.0.55, 2.0.54, ... location searched: crates.io index required by package `thiserror-impl v2.0.0` ... which satisfies dependency `thiserror-impl = "=2.0.0"` of package `thiserror v2.0.0` ... which satisfies dependency `thiserror = "^2"` of package `anyhow v1.0.92` --- .github/workflows/ci.yml | 6 +++--- tests/crate/Cargo.toml | 17 +++++++++++++++++ tests/crate/test.rs | 3 +++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 tests/crate/Cargo.toml create mode 100644 tests/crate/test.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e8a9ca..8ae4522 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,9 +63,9 @@ jobs: with: toolchain: ${{matrix.rust}} components: rust-src - - run: cargo check - - run: cargo check --no-default-features - - run: cargo check --features backtrace + - run: cargo check --manifest-path tests/crate/Cargo.toml + - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features + - run: cargo check --manifest-path tests/crate/Cargo.toml --features backtrace if: matrix.rust != '1.65.0' && matrix.rust != '1.52.0' && matrix.rust != '1.51.0' && matrix.rust != '1.50.0' && matrix.rust != '1.39.0' minimal: diff --git a/tests/crate/Cargo.toml b/tests/crate/Cargo.toml new file mode 100644 index 0000000..d927c00 --- /dev/null +++ b/tests/crate/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "anyhow_test" +version = "0.0.0" +authors = ["David Tolnay "] +edition = "2018" +publish = false + +[lib] +path = "test.rs" + +[dependencies] +anyhow = { path = "../..", default-features = false } + +[features] +default = ["std"] +std = ["anyhow/std"] +backtrace = ["anyhow/backtrace"] diff --git a/tests/crate/test.rs b/tests/crate/test.rs new file mode 100644 index 0000000..b978631 --- /dev/null +++ b/tests/crate/test.rs @@ -0,0 +1,3 @@ +#![no_std] + +pub use anyhow::*;