Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream bug/breaking change shown after removing Cargo.lock #83

Closed
uncomfyhalomacro opened this issue Mar 7, 2022 · 1 comment
Closed
Assignees
Labels
Bug Something isn't working

Comments

@uncomfyhalomacro
Copy link

Version Information:

  • Distribution Information: OpenSUSE TumbleWeed
    • Linux sentient-slate.bbrouter 5.16.11-1-default #1 SMP PREEMPT Thu Feb 24 05:07:05 UTC 2022 (90630c5) x86_64 x86_64 x86_64 GNU/Linux
  • swhkd version: at commit hash ed4b266b1000099150ba00e0b552f54a1c86f658

Describe the bug:
As what rust has suggested in https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html, removing Cargo.lock is required if creating an executable. However, because we didn't remove it, we have found ourselves in deep water. uwu

Expected behavior:
This should build correctly. Even with cargo install and cargo build

Actual behavior:
Build fails:

   Compiling evdev v0.11.5
   Compiling Simple-Wayland-HotKey-Daemon v1.1.4 (/home/uncomfy/Projects/swhkd)
error[E0631]: type mismatch in function arguments
   --> src/daemon.rs:111:67
    |
111 |     let keyboard_devices: Vec<Device> = evdev::enumerate().filter(check_keyboard).collect();
    |                                                            ------ ^^^^^^^^^^^^^^ expected signature of `for<'r> fn(&'r (PathBuf, Device)) -> _`
    |                                                            |
    |                                                            required by a bound introduced by this call
...
312 | pub fn check_keyboard(device: &Device) -> bool {
    | ---------------------------------------------- found signature of `for<'r> fn(&'r Device) -> _`
    |
note: required by a bound in `std::iter::Iterator::filter`

error[E0599]: the method `collect` exists for struct `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>`, but its trait bounds were not satisfied
   --> src/daemon.rs:111:83
    |
111 |       let keyboard_devices: Vec<Device> = evdev::enumerate().filter(check_keyboard).collect();
    |                                                                                     ^^^^^^^ method cannot be called on `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>` due to unsatisfied trait bounds
    |
    = note: the following trait bounds were not satisfied:
            `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>: tokio_stream::Stream`
            which is required by `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>: StreamExt`
            `<for<'r> fn(&'r Device) -> bool {check_keyboard} as FnOnce<(&(PathBuf, Device),)>>::Output = bool`
            which is required by `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>: Iterator`
            `for<'r> fn(&'r Device) -> bool {check_keyboard}: FnMut<(&(PathBuf, Device),)>`
            which is required by `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>: Iterator`
            `&std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>: tokio_stream::Stream`
            which is required by `&std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>: StreamExt`
            `&mut std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>: tokio_stream::Stream`
            which is required by `&mut std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>: StreamExt`
            `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>: Iterator`
            which is required by `&mut std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>: Iterator`

error[E0631]: type mismatch in function arguments
   --> src/daemon.rs:185:74
    |
185 |                         let keyboard_devices = evdev::enumerate().filter(check_keyboard);
    |                                                                   ------ ^^^^^^^^^^^^^^ expected signature of `for<'r> fn(&'r (PathBuf, Device)) -> _`
    |                                                                   |
    |                                                                   required by a bound introduced by this call
...
312 | pub fn check_keyboard(device: &Device) -> bool {
    | ---------------------------------------------- found signature of `for<'r> fn(&'r Device) -> _`
    |
note: required by a bound in `std::iter::Iterator::filter`

error[E0631]: type mismatch in function arguments
   --> src/daemon.rs:186:43
    |
186 |                         for mut device in keyboard_devices {
    |                                           ^^^^^^^^^^^^^^^^ expected signature of `for<'r> fn(&'r (PathBuf, Device)) -> _`
...
312 | pub fn check_keyboard(device: &Device) -> bool {
    | ---------------------------------------------- found signature of `for<'r> fn(&'r Device) -> _`
    |
    = note: required because of the requirements on the impl of `Iterator` for `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>`
    = note: required because of the requirements on the impl of `IntoIterator` for `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>`

error[E0599]: no method named `ungrab` found for tuple `(PathBuf, Device)` in the current scope
   --> src/daemon.rs:187:45
    |
187 | ...                   let _ = &device.ungrab();
    |                                       ^^^^^^ method not found in `(PathBuf, Device)`

error[E0631]: type mismatch in function arguments
   --> src/daemon.rs:192:74
    |
192 |                         let keyboard_devices = evdev::enumerate().filter(check_keyboard);
    |                                                                   ------ ^^^^^^^^^^^^^^ expected signature of `for<'r> fn(&'r (PathBuf, Device)) -> _`
    |                                                                   |
    |                                                                   required by a bound introduced by this call
...
312 | pub fn check_keyboard(device: &Device) -> bool {
    | ---------------------------------------------- found signature of `for<'r> fn(&'r Device) -> _`
    |
note: required by a bound in `std::iter::Iterator::filter`

error[E0631]: type mismatch in function arguments
   --> src/daemon.rs:193:43
    |
193 |                         for mut device in keyboard_devices {
    |                                           ^^^^^^^^^^^^^^^^ expected signature of `for<'r> fn(&'r (PathBuf, Device)) -> _`
...
312 | pub fn check_keyboard(device: &Device) -> bool {
    | ---------------------------------------------- found signature of `for<'r> fn(&'r Device) -> _`
    |
    = note: required because of the requirements on the impl of `Iterator` for `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>`
    = note: required because of the requirements on the impl of `IntoIterator` for `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>`

error[E0599]: no method named `grab` found for tuple `(PathBuf, Device)` in the current scope
   --> src/daemon.rs:194:45
    |
194 | ...                   let _ = &device.grab();
    |                                       ^^^^ method not found in `(PathBuf, Device)`

error[E0631]: type mismatch in function arguments
   --> src/daemon.rs:205:74
    |
205 |                         let keyboard_devices = evdev::enumerate().filter(check_keyboard);
    |                                                                   ------ ^^^^^^^^^^^^^^ expected signature of `for<'r> fn(&'r (PathBuf, Device)) -> _`
    |                                                                   |
    |                                                                   required by a bound introduced by this call
...
312 | pub fn check_keyboard(device: &Device) -> bool {
    | ---------------------------------------------- found signature of `for<'r> fn(&'r Device) -> _`
    |
note: required by a bound in `std::iter::Iterator::filter`

error[E0631]: type mismatch in function arguments
   --> src/daemon.rs:206:43
    |
206 |                         for mut device in keyboard_devices {
    |                                           ^^^^^^^^^^^^^^^^ expected signature of `for<'r> fn(&'r (PathBuf, Device)) -> _`
...
312 | pub fn check_keyboard(device: &Device) -> bool {
    | ---------------------------------------------- found signature of `for<'r> fn(&'r Device) -> _`
    |
    = note: required because of the requirements on the impl of `Iterator` for `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>`
    = note: required because of the requirements on the impl of `IntoIterator` for `std::iter::Filter<evdev::EnumerateDevices, for<'r> fn(&'r Device) -> bool {check_keyboard}>`

error[E0599]: no method named `ungrab` found for tuple `(PathBuf, Device)` in the current scope
   --> src/daemon.rs:207:45
    |
207 | ...                   let _ = &device.ungrab();
    |                                       ^^^^^^ method not found in `(PathBuf, Device)`

Some errors have detailed explanations: E0599, E0631.
For more information about an error, try `rustc --explain E0599`.
error: could not compile `Simple-Wayland-HotKey-Daemon` due to 11 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed

To Reproduce:
Remove Cargo.lock, then run cargo build --release

Additional information:
UWU

@uncomfyhalomacro
Copy link
Author

Closing because I realized how dumb i was 😮‍💨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Development

No branches or pull requests

5 participants