flier / rust-fasthash

A suite of non-cryptographic hash functions for Rust.
Apache License 2.0
138 stars 28 forks source link

bindgen error #3

Closed cbreeden closed 7 years ago

cbreeden commented 7 years ago

I get the following error when I try to compile:

error[E0091]: type parameter `_T2` is unused

The code generated by is here:

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct std_pair<_T1, _T2> {
    pub first: _T1,
    pub second: _T2,
}
pub type std_pair_first_type<_T1> = _T1;
pub type std_pair_second_type<_T2> = _T2;
pub type std_pair__PCCP<_T1, _T2> = ();
pub type uint32 = u32;
...

Have you run into this issue?

flier commented 7 years ago

It seems your bindgen generated wrong binding class for C++ stdlib.

Could you provides OS, rust, LLVM and bindgen version?

cbreeden commented 7 years ago

It's not clear to me which LLVM version is being used, but for clang:

clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-unknown-linux-gnu

I'm on ArchLinux (Manjaro distribution)

Linux breeden-desktop 4.7.10-1-MANJARO #1 SMP PREEMPT Sat Oct 22 19:15:11 UTC 2016 x86_64 GNU/Linux

I was running this on rustc 1.16-nightly:

rustc 1.16.0-nightly (bf6d7b665 2017-01-15)

I'm not sure what bindgen version I was using. I assume it was the same one pulled from

fasthash = "0.2.2"

So probably

libbindgen = "0.1.7"

This sounds like an issue with bindgen though, doesn't it?

flier commented 7 years ago

Interesting, seems libbindgen generate an empty type different to other system

pub type std_pair__PCCP<_T1, _T2> = ();
flier commented 7 years ago

Besize, you may need use disable i128 feature in rust nightly version, because it has added build-in i128 supports

$ rustup run nightly cargo test --no-default-features --features sse42