Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Binary-Eater/bc42152625b1d4ae60fc6c2721307890 to your computer and use it in GitHub Desktop.

Select an option

Save Binary-Eater/bc42152625b1d4ae60fc6c2721307890 to your computer and use it in GitHub Desktop.
Rust lifetime error
error[E0106]: missing lifetime specifier
--> rust/kernel/hid.rs:389:73
|
389 | ...p(_hdev: &Device<device::Core>, _rdesc: &mut [u8]) -> &[u8] {
| --------------------- --------- ^ expected named lifetime parameter
|
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `_hdev` or `_rdesc`
help: consider introducing a named lifetime parameter
|
389 | fn report_fixup<'a>(_hdev: &'a Device<device::Core>, _rdesc: &'a mut [u8]) -> &'a [u8] {
| ++++ ++ ++ ++
@Binary-Eater

Copy link
Copy Markdown
Author
Changelog:

    v6->v7:
      * Implemented HID items as bitflags
      * Used #[inline] for into_u16 and Device::as_raw
      * Defined a custom GroupUnknownError type
      * Fixed the description of DeviceId::new_usb
      * Made report_fixup use a single lifetime value due to references
        being covariant
      * Simplified error handling in report_fixup_callback
    v5->v6:
      * Converted From<u16> for Group to TryFrom<u16> to properly handle
        error case
      * Renamed into method for Group to into_u16 to not conflate with the
        From trait
      * Refactored new upstream changes to RegistrationOps
      * Implemented DriverLayout trait for hid::Adapter<T>
    v4->v5:
      * Add rust/ to drivers/hid/Makefile
      * Implement RawDeviceIdIndex trait
    v3->v4:
      * Removed specifying tree in MAINTAINERS file since that is up for
        debate
      * Minor rebase cleanup
      * Moved driver logic under drivers/hid/rust
    v2->v3:
      * Implemented AlwaysRefCounted trait using embedded struct device's
        reference counts instead of the separate reference counter in struct
        hid_device
      * Used &raw mut as appropriate
      * Binded include/linux/device.h for get_device and put_device
      * Cleaned up various comment related formatting
      * Minified dev_err! format string
      * Updated Group enum to be repr(u16)
      * Implemented From<u16> trait for Group
      * Added TODO comment when const_trait_impl stabilizes
      * Made group getter functions return a Group variant instead of a raw
        number
      * Made sure example code builds
    v1->v2:
      * Binded drivers/hid/hid-ids.h for use in Rust drivers
      * Remove pre-emptive referencing of a C HID driver instance before
        it is fully initialized in the driver registration path
      * Moved static getters to generic Device trait implementation, so
        they can be used by all device::DeviceContext
      * Use core macros for supporting DeviceContext transitions
      * Implemented the AlwaysRefCounted and AsRef traits
      * Make use for dev_err! as appropriate
    RFC->v1:
      * Use Danilo's core infrastructure
      * Account for HID device groups
      * Remove probe and remove callbacks
      * Implement report_fixup support
      * Properly comment code including SAFETY comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment