Closed
Description
// crate.rs
#[crate_type = "lib"];
pub extern "C" {
fn rand() -> libc::c_int;
}
// test.rs
extern mod crate;
fn main () {
println(fmt!("%?", crate::rand()));
}
Compiling these as separate crates doesn't produce an error, but compiling them both as part of the same crate does, as does compiling a crate which uses a function from a different crate which was explicitly marked as unsafe
. It seems like this should be consistent.
Metadata
Metadata
Assignees
Labels
No labels