Skip to content

Bug in import #16217

@GuillaumeGomez

Description

@GuillaumeGomez

Hey, here's the problem :

pub mod Gsl {
    use ffi;

    pub struct VectorFloat {
        vec: *mut ffi::gsl_vector_float
    }

    impl VectorFloat {
      ...
    }
}

When I compile it, the compiler says :

> make
src/vector.rs:5:6: 5:9 warning: unused import, #[warn(unused_imports)] on by default
src/vector.rs:5  use ffi;

So I remove the import and then I get :

mkdir -p lib
rustc --out-dir=lib src/rgsl.rs
src/vector.rs:9:19: 9:40 error: failed to resolve. Use of undeclared module `ffi`
src/vector.rs:9         vec: *mut ffi::gsl_vector_float
                                  ^~~~~~~~~~~~~~~~~~~~~
src/vector.rs:9:19: 9:40 error: use of undeclared type name `ffi::gsl_vector_float`
src/vector.rs:9         vec: *mut ffi::gsl_vector_float
...

Is that normal ? Since the ffi import is used, I'm not supposed to have a unused warning, am I ?

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