Closed
Description
crate foo
:
#![feature(extern_types)]
extern "C" {
pub type Foo;
}
impl Foo {
pub fn new() -> FooBox {
let raw = unimplemented!("Get through ffi");
FooBox(raw)
}
}
pub struct FooBox(*mut Foo);
impl Drop for FooBox {
fn drop(&mut self) {
unimplemented!("call ffi drop");
}
}
crate foouser
:
extern crate foo;
fn main() {
let foo = foo::Foo::new();
println!("{:p}", &foo);
}
Error:
error[E0599]: no function or associated item named `new` found for type `foo::Foo` in the current scope
--> foouser.rs:4:15
|
4 | let foo = foo::Foo::new();
| ^^^^^^^^^^^^^ function or associated item not found in `foo::Foo`
This error does not occur if main
is located within the same crate.