Skip to content

uefi: Fix return value lifetime for register_protocol_notify #1228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

nicholasbishop
Copy link
Member

Due to the rules of lifetime elision
(https://doc.rust-lang.org/reference/lifetime-elision.html), the lifetime of the SearchType returned from register_protocol_notify was infered to be the lifetime of Self. The correct lifetime is the protocol reference.

In practice this isn't likely to matter much to users, but I noticed it due to a compilation error when working on #893

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

Due to the rules of lifetime elision
(https://doc.rust-lang.org/reference/lifetime-elision.html), the lifetime of the
`SearchType` returned from `register_protocol_notify` was infered to be the
lifetime of `Self`. The correct lifetime is the `protocol` reference.
@phip1611 phip1611 added this pull request to the merge queue Jul 8, 2024
@phip1611
Copy link
Member

phip1611 commented Jul 8, 2024

Good catch!

Merged via the queue into rust-osdev:main with commit c80c232 Jul 8, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants