immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.91k stars 229 forks source link

analyze: setting `RUST_LOG=c2rust_analyze::context=trace` causes panic #931

Closed spernsteiner closed 1 year ago

spernsteiner commented 1 year ago

On current master (b34d4e1465f3c1c0cf73811955c1e383aa25c2fd), the following command produces a test failure:

RUST_LOG=c2rust_analyze::context=trace cargo test statics

The failure is due to a panic on a trace! invocation:

thread 'rustc' panicked at '
[TRACE @ c2rust-analyze/src/context.rs:604 @ c2rust_analyze::context]: assign_pointer_to_static(DefId(0:3 ~ statics[bcaa]::UNUSED))
', c2rust-analyze/src/log.rs:50:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

But only error! calls should trigger a panic.

Setting RUST_LOG=trace does not produce a panic (the test succeeds).

@kkysen, any ideas?