Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bindgen frequently prints "rewriting static" in its output #126887

Closed
asomers opened this issue Jun 24, 2024 · 1 comment · Fixed by #126888
Closed

Bindgen frequently prints "rewriting static" in its output #126887

asomers opened this issue Jun 24, 2024 · 1 comment · Fixed by #126888
Labels
C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.

Comments

@asomers
Copy link
Contributor

asomers commented Jun 24, 2024

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

@asomers asomers added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Jun 24, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 24, 2024
@compiler-errors
Copy link
Member

#126888 should fix this

@dtolnay dtolnay added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. and removed regression-untriaged Untriaged performance or correctness regression. labels Jun 24, 2024
@bors bors closed this as completed in b94d275 Jun 24, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jun 24, 2024
Rollup merge of rust-lang#126888 - compiler-errors:oops-debug-printing, r=dtolnay

Remove stray println from rustfmt's `rewrite_static`

r? `@calebcartwright` `@ytmimi` -- though anyone should probably r+ this so it gets into nightly sooner than later, since it's obviously wrong.

This can just be fixed in-tree, since I don't think we want to wait until the next sync to fix this.

Fix rust-lang/rustfmt#6210
Fix rust-lang#126887
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jun 24, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 24, 2024
compiler-errors pushed a commit to compiler-errors/rustfmt that referenced this issue Jun 25, 2024
Remove stray println from rustfmt's `rewrite_static`

r? `@calebcartwright` `@ytmimi` -- though anyone should probably r+ this so it gets into nightly sooner than later, since it's obviously wrong.

This can just be fixed in-tree, since I don't think we want to wait until the next sync to fix this.

Fix rust-lang#6210
Fix rust-lang/rust#126887
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants