Bindgen frequently prints "rewriting static" in its output · Issue #126887 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@asomers

Description

@asomers

Code

Many crates that use bindgen are now failing. For example:

https://github.com/asomers/gstat-rs/blob/master/freebsd-libgeom-sys/build.rs
https://github.com/asomers/mdconfig/blob/master/bindgen/bindgen.sh
https://github.com/asomers/capsicum-net/blob/master/bindgen/bindgen.sh

The bindgen output looks like normal, except that it also has several rewriting static lines mixed in. For example:

#![allow(non_camel_case_types)] use casper_sys::cap_channel_t; use libc::sockaddr; /* automatically generated by rust-bindgen 0.69.4 */

rewriting static rewriting static pub const CAPNET_CONNECT: u32 = 16; pub const CAPNET_BIND: u32 = 32; pub type __uint8_t = ::std::os::raw::c_uchar; pub type __uint32_t = ::std::os::raw::c_uint;

Version it worked on

It most recently worked on: rustc 1.81.0-nightly from about 2024-06-21

Version with regression

rustc 1.81.0-nightly (bcf94dec5 2024-06-23)
binary: rustc
commit-hash: bcf94dec5ba6838e435902120c0384c360126a26
commit-date: 2024-06-23
host: x86_64-unknown-freebsd
release: 1.81.0-nightly
LLVM version: 18.1.7

I believe the bug was introduced by commit 30cdc2b .

@rustbot modify labels: +regression-from-stable-to-nightly-regression-untriaged