svartalf / rust-battery

Rust crate providing cross-platform information about the notebook batteries.
https://crates.io/crates/battery
Apache License 2.0
354 stars 40 forks source link

Could not compile `battery` #6

Closed Dentrax closed 5 years ago

Dentrax commented 5 years ago

When i run cargo build --release I am getting this:

Compiling battery v0.6.0
   Compiling battery v0.6.0 (/home/dentrax/Projects/GitHub/rust-battery/battery)
   Compiling quote v0.6.11
   Compiling rand_chacha v0.1.1
   Compiling rand_pcg v0.1.2
   Compiling rand_os v0.1.2
   Compiling atty v0.2.11
   Compiling termion v1.5.1
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
  --> /home/dentrax/.cargo/registry/src/github.com-1ecc6299db9ec823/battery-0.6.0/src/lib.rs:34:9
   |
31 | mod types;
   | ---------- not an extern crate passed with `--extern`
...
34 | pub use types::{Manager, Batteries, Battery, State, Technology};
   |         ^^^^^
   |
   = help: add #![feature(uniform_paths)] to the crate attributes to enable
note: this import refers to the module defined here
  --> /home/dentrax/.cargo/registry/src/github.com-1ecc6299db9ec823/battery-0.6.0/src/lib.rs:31:1
   |
31 | mod types;
   | ^^^^^^^^^^

error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
  --> battery/src/lib.rs:34:9
   |
31 | mod types;
   | ---------- not an extern crate passed with `--extern`
...
34 | pub use types::{Manager, Batteries, Battery, State, Technology};
   |         ^^^^^
   |
   = help: add #![feature(uniform_paths)] to the crate attributes to enable
note: this import refers to the module defined here
  --> battery/src/lib.rs:31:1
   |
31 | mod types;
   | ^^^^^^^^^^

   Compiling clap v2.32.0
error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: Could not compile `battery`.
warning: build failed, waiting for other jobs to finish...
error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: Could not compile `battery`.
warning: build failed, waiting for other jobs to finish...
error: build failed

OS: Arch Linux

svartalf commented 5 years ago

Hey, @Dentrax! Thank you for report!

I have tested battery with Rust 1.32 and you're probably using Rust <= 1.31, where uniform paths were not stabilized yet.

1e50430140fc3405c0dfe78329d0012d5e6d3663 should fix the problem, it is already in master branch. Can you confirm that compilation is working now for you?

Dentrax commented 5 years ago

@svartalf

Thank you it is working fine now. :)

Compiled with: rustc 1.33.0-nightly (8e2063d02 2019-01-07)

svartalf commented 5 years ago

I'm glad to hear that :)