rustfmt
rustfmt copied to clipboard
Rustfmt removes values from extern static items
Rust v1.80 (rustfmt 1.7.0-stable (0514789 2024-07-21)) and Nightly (rustfmt 1.7.1-nightly (64ebd39 2024-08-03)) both remove values from static items:
extern "C" {
static TEST: i32 = 42;
}
When formatted it gets transformed into:
extern "C" {
static TEST: i32;
}
Rustfmt showed no error.
This code doesn't actually build in the first place, I'm using it with a proc-macro to implement externalized strings in wasm-bindgen (https://github.com/rustwasm/wasm-bindgen/issues/4031) which allows this to work.
This is similar to #4159.