Skip to content

Commit

Permalink
test: fix miri failure due to tracing deps (#280)
Browse files Browse the repository at this point in the history
This adds a Cargo patch for the `once_cell` crate to pick up an upstream
branch that fixes an int-to-pointer cast that Miri rejects.

The patch can be removed once matklad/once_cell#185 has merged.
  • Loading branch information
hawkw committed Jul 30, 2022
1 parent b11150b commit 10fa0bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ tracing-core = { git = "https://github.com/tokio-rs/tracing" }
# https://github.com/rust-osdev/volatile/pull/25 merges upstream. this is
# necessary to build with unstable features on recent nightlies.
volatile = { git = "https://github.com/hawkw/volatile", branch = "eliza/update-features" }
# patch `once_cell` to use https://github.com/matklad/once_cell/pull/185 so that
# Miri doesn't reject `tracing`'s use of `once_cell`.
#
# remove this patch once once_cell#185 is merged.
once_cell = { git = "https://github.com/hawkw/once_cell", branch = "eliza/saethlin/provenance" }

# Custom profile for Loom tests: enable release optimizations so that the loom
# tests are less slow, but don't disable debug assertions.
Expand Down
2 changes: 1 addition & 1 deletion cordyceps/src/list/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn const_new() {
const _: List<Entry> = List::new();
}

fn trace_init() -> tracing::dispatcher::DefaultGuard {
fn trace_init() -> impl Drop {
use tracing_subscriber::prelude::*;
tracing_subscriber::fmt()
.with_test_writer()
Expand Down

0 comments on commit 10fa0bf

Please sign in to comment.