On 8/7/25 14:30, Zhao Liu wrote:
error[E0283]: type annotations needed
    --> hw/timer/hpet/src/device.rs:884:55
     |
884 |         self.num_timers == self.num_timers_save.get().into()
     |                         --                            ^^^^
     |                         |
     |                         type must be known at this point
     |
     = note: multiple `impl`s satisfying `usize: PartialEq<_>` found in the 
following crates: `core`, `vm_memory`:
             - impl PartialEq<vm_memory::endian::BeSize> for usize;
             - impl PartialEq<vm_memory::endian::LeSize> for usize;
             - impl<host> PartialEq for usize
               where the constant `host` has type `bool`;
help: try using a fully qualified path to specify the expected types
     |
884 |         self.num_timers == <u8 as 
Into<T>>::into(self.num_timers_save.get())
     |                            ++++++++++++++++++++++                        
  ~

Oh, interesting.  In this case, you can write:

    usize::from(self.num_timers_save.get())

Paolo


Reply via email to