std c_void and libc c_void are different types · Issue #31536 · rust-lang/rust (original) (raw)

Using libc v0.2.7 and rustc 1.8.0-nightly (34af2de 2016-02-05)

extern crate libc; fn test() { let x = 1 as *mut libc::c_void; let y = 1 as *mut std::os::raw::c_void; let z = if true { x } else { y }; }

src/lib.rs:26:13: 26:37 error: if and else have incompatible types: expected *mut libc::c_void, found *mut std::os::raw::c_void (expected enum libc::c_void, found enum std::os::raw::c_void) [E0308] src/lib.rs:26 let z = if true { x } else { y };

These must be compatible, otherwise we cause incompatibilities in the ecosystem.