rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

'"type-parameter-0-0" is not a valid Ident' when using blocklist-item "std::.*"

Open Supreeeme opened this issue 2 years ago • 3 comments

Input C/C++ Header

#include <string> // or any other std header
void func1();

Bindgen Invocation

$ bindgen input.h --blocklist-item "std::.*" -- -x c++

Actual Results

panicked at '"type-parameter-0-0" is not a valid Ident', /home/supreme/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.51/src/fallback.rs:752:9

Expected Results

Successful binding generation without anything from std

Supreeeme avatar Mar 11 '23 16:03 Supreeeme

I can actually get around this like so:

bindgen input.h --blocklist-item 'std::\w+.*' --blocklist-item 'std::_.*' -- -x c++

Then there's just an empty std mod in the generated bindings.

Supreeeme avatar Mar 11 '23 17:03 Supreeeme

I have exactly the same issue, but I am using blocklist_type instead, from the build.rs script, like so:

.blocklist_type("std::.*")

c0dearm avatar May 05 '23 14:05 c0dearm

Same issue when trying to make bindings for v8 (specifically, libv8_monolith.a) and using the following line in my build.rs:

 .blocklist_item("^std::.*")

vvelecho avatar Apr 09 '24 13:04 vvelecho