Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stable backtrace feature #143

Merged
merged 1 commit into from Mar 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -20,6 +20,15 @@ jobs:
toolchain: ${{matrix.rust}}
- run: cargo test
- run: cargo check --no-default-features
- run: cargo check --features backtrace

backtrace:
name: Rust 1.42.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@1.42.0
- run: cargo check --features backtrace

nostd:
name: Rust 1.36.0
Expand All @@ -37,6 +46,14 @@ jobs:
- uses: dtolnay/rust-toolchain@1.34.0
- run: cargo check

windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --features backtrace

clippy:
name: Clippy
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Expand Up @@ -14,6 +14,9 @@ categories = ["rust-patterns"]
default = ["std"]
std = []

[dependencies]
backtrace = { version = "0.3", optional = true }

[dev-dependencies]
futures = { version = "0.3", default-features = false }
rustversion = "1.0"
Expand Down
5 changes: 5 additions & 0 deletions build.rs
Expand Up @@ -4,6 +4,11 @@ use std::path::Path;
use std::process::{Command, ExitStatus, Stdio};
use std::str;

#[cfg(all(feature = "backtrace", not(feature = "std")))]
compile_error! {
"`backtrace` feature without `std` feature is not supported"
}

// This code exercises the surface area that we expect of the std Backtrace
// type. If the current toolchain is able to compile it, we go ahead and use
// backtrace in anyhow.
Expand Down