Skip to content

Conflict with std's c_void #180

Closed
Closed
@bluss

Description

@bluss

This issue is also reported against Rust. rust-lang/rust/issues/31536


Using libc v0.2.7 and rustc 1.8.0-nightly (34af2de40 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions