Not a big fan of #vtable
Not a big fan of #vtable
Posted Jun 29, 2025 0:18 UTC (Sun) by Cyberax (✭ supporter ✭, #52523)Parent article: How to write Rust in the kernel: part 2
Posted Jun 29, 2025 3:20 UTC (Sun)
by iabervon (subscriber, #722)
[Link] (4 responses)
The "impl Driver for PhyAX88772C" thing is the usual way to associate a bunch of functions that are related together in Rust with what they're used for, and the odd "#[vtable]" thing is just making the idiomatic Rust code produce what the C code needs.
Posted Jun 29, 2025 3:23 UTC (Sun)
by Cyberax (✭ supporter ✭, #52523)
[Link] (3 responses)
Posted Jun 29, 2025 3:56 UTC (Sun)
by iabervon (subscriber, #722)
[Link] (2 responses)
Posted Jun 29, 2025 7:31 UTC (Sun)
by tialaramex (subscriber, #21167)
[Link]
error[E0407]: method `resum` is not a member of trait `Driver`
... but it has no suggestions for how to fix this, whereas in some other contexts it looks for similar symbols and would have suggested we meant `resume` instead, meaning it spells out what we got wrong.
In my experience improving error diagnostics in rustc is very achievable for a person who has some Rust but maybe isn't yet comfortable writing scary bit-banging code with it, and it's a huge confidence boost when the tests pass (rustc has lots of tests for this stuff) and the reviewers send your work to be integrated into a future compiler version. Unlike fiddling with a hardware driver, no reboots are required and people don't need identical hardware to test it.
Posted Jun 29, 2025 9:02 UTC (Sun)
by NYKevin (subscriber, #129325)
[Link]
Not a big fan of #vtable
Not a big fan of #vtable
Not a big fan of #vtable
Not a big fan of #vtable
Not a big fan of #vtable