canselcik / libremarkable

The only public framework for developing applications with native refresh support for Remarkable Tablet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

evdev type mismatch

glyh opened this issue · comments

I've got this error message for evdev, when I was running make TARGET=armv7-unknown-linux-gnueabihf deploy-x-demo:

error[E0308]: mismatched types
   --> /cargo/registry/src/github.com-1ecc6299db9ec823/evdev-0.11.7/src/lib.rs:390:29
    |
390 |     let dur = Duration::new(tv.tv_sec.unsigned_abs(), tv.tv_usec as u32 * 1000);
    |               ------------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `u32`
    |               |
    |               arguments to this function are incorrect
    |
note: associated function defined here
   --> /rust/lib/rustlib/src/rust/library/core/src/time.rs:185:18
    |
185 |     pub const fn new(secs: u64, nanos: u32) -> Duration {
    |                  ^^^
help: you can convert a `u32` to a `u64`
    |
390 |     let dur = Duration::new(tv.tv_sec.unsigned_abs().into(), tv.tv_usec as u32 * 1000);
    |                                                     +++++++

For more information about this error, try `rustc --explain E0308`.
error: could not compile `evdev` due to previous error

Hi.

At first I couldn't reproduce this error. But then noticed that your version of evdev was newer then the one in my (older) Cargo.lock file.

Seems something between evdev 0.11.3 and 0.11.7 changed that broke it. I'm looking into it and will create a PR to fix it shortly.

Good catch! 👍

The same compilation error was found 9 days ago in issue emberian/evdev#95 (which lead to the PR fixing it)

This issue should be kept open until the version of evdev can be bumped to the next release (>0.12.0).

The issue at hand is fixed in the 0.6.1 release.

As said, when the new evdev release is around, we can update to it and close this issue. That will then be included in a future 0.6.2 or 0.7.0 release when we get to do that (not making that release for this fix alone though).