memflow-mirror icon indicating copy to clipboard operation
memflow-mirror copied to clipboard

error[E0282]: type annotations needed for `Box<_>`

Open 2meito opened this issue 4 months ago • 1 comments

When compiling the guest-agent on Windows, I received the following error:

error[E0282]: type annotations needed for `Box<_>`
  --> C:\Users\Link\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\time-0.3.34\src\format_description\parse\mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
   = note: this is an inference error on crate `time` caused by an API change in Rust 1.80.0; update `time` to version `>=0.3.35` by calling `cargo update`

   Compiling serde_derive v1.0.197
   Compiling scroll_derive v0.12.0
   Compiling abi_stable_derive v0.10.3
For more information about this error, try `rustc --explain E0282`.
error: could not compile `time` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Executing cargo update and attempting to compile again produced this error:

error[E0277]: expected a `Fn(&_)` closure, found `std::sync::mpsc::Sender<Events>`
  --> mirror-guest\src\main.rs:41:17
   |
41 |         .sender(send)
   |          ------ ^^^^ expected an `Fn(&_)` closure, found `std::sync::mpsc::Sender<Events>`
   |          |
   |          required by a bound introduced by this call
   |
   = help: the trait `for<'a> Fn(&'a _)` is not implemented for `std::sync::mpsc::Sender<Events>`
note: required by a bound in `TrayIconBuilder::<T>::sender`
  --> C:\Users\Link\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\trayicon-0.1.5\src\trayiconbuilder.rs:79:38
   |
79 |     pub fn sender(mut self, cb: impl Fn(&T) + 'static) -> Self {
   |                                      ^^^^^^ required by this bound in `TrayIconBuilder::<T>::sender`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `mirror-guest` (bin "mirror-guest") due to 1 previous error

Easiest workaround for me was running:

git reset .
cargo +1.79.0 build --release --bin mirror-guest --all-features

2meito avatar Aug 03 '25 19:08 2meito

Use this instead (more convinient):

cargo update -p time

aASDa213ASD avatar Aug 05 '25 18:08 aASDa213ASD