Rust upgrade: fix static and cfg