-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.F-extern_types`#![feature(extern_types)]``#![feature(extern_types)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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.
Metadata
Metadata
Assignees
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.F-extern_types`#![feature(extern_types)]``#![feature(extern_types)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.