On Fri Sep 19, 2025 at 10:56 PM CEST, Gary Guo wrote:
> Turbofish is cumbersome to write with just magic numbers, and the
> fact `{}` is needed to pass in constant expressions made this much
> worse. If the drivers try hard to avoid magic numbers, you would
> effective require  all code to be `::<{ ... }>()` and this is ugly.

In the absolute majority of cases users won't see any of that anyways, since
they'll use the register!() macro generated types.

   // Master Control Register (MCR)
   //
   // Stores the offset as associated constant.
   let mcr = regs::MCR::default();

   // Set the enabled bit.
   mcr.enable();

   // Write the data on the bus.
   //
   // Calls `io.write<Self::OFFSET>(self.data())` internally.
   mcr.write(&io);

For indexed registers it is indeed a problem though.

Reply via email to