luqmana / rust-opencl

OpenCL bindings for Rust.
Other
170 stars 42 forks source link

Error with multiple importing of std type #78

Closed AdamBrouwersHarries closed 7 years ago

AdamBrouwersHarries commented 8 years ago

Under the nightly build of the rust compiler, a2866e387 2015-11-30, this library no longer compiles, giving the following error:

src/ext.rs:201:9: 201:15 error: a type named `std` has already been imported in this module [E0251]
src/ext.rs:201     use cl::*;
                   ^~~~~~
src/ext.rs:201:9: 201:15 help: run `rustc --explain E0251` to see a detailed explanation
src/hl.rs:14:5: 14:11 error: a type named `std` has already been imported in this module [E0251]
src/hl.rs:14 use cl::*;
             ^~~~~~
src/hl.rs:14:5: 14:11 help: run `rustc --explain E0251` to see a detailed explanation
error: aborting due to 2 previous errors
Could not compile `opencl`.

Running rustc --explain E0251 gives the following explanation:

Two items of the same name cannot be imported without rebinding one of the
items under a new local name.

An example of this error:

use foo::baz; use bar::*; // error, do use foo::baz as quux instead on the previous line

fn main() {}

mod foo { pub struct baz; }

mod bar { pub mod baz {} }

I've fixed this locally, however I've opened this issue as documentation.

eholk commented 7 years ago

I'm going to mark this as closed, since it looks like I just merged your fix.