Skip to content

Conversation

linkmauve
Copy link

Since Rust 1.89.0, a warning is emitted by default when the lifetime of the return type is implicitly elided but matches an input parameter of the function.

rustc tells us how to fix it (but weirdly enough there is no cargo fix for it), so let’s do that, it makes the elided lifetime much more evident anyway.

I followed the checklist:

  • I added unittests (not relevant)
  • I ran make check without errors
  • I tested the overall application
  • I added an appropriate item to the changelog (not relevant)

@extrawurst
Copy link
Collaborator

Nice, can you enable that warning to be deny in the entire workspace then?

@linkmauve
Copy link
Author

I usually dislike projects using -Werror or similar (-D warnings in rustc I think), it would make more sense to put that only in your CI rather than forcing every developer to fix the warnings immediately? Plus you already build without warnings otherwise, it would be an obvious regression if a PR started doing so.

I couldn’t figure how to deny a warning in the entire workspace though, instead of in every crate like you’re currently doing.

Since Rust 1.89.0, a warning is emitted by default when the lifetime of
the return type is implicitly elided but matches an input parameter of
the function.

rustc tells us how to fix it (but weirdly enough there is no cargo fix
for it), so let’s do that, it makes the elided lifetime much more
evident anyway.
@linkmauve linkmauve force-pushed the no-mismatched_lifetime_syntaxes branch from 809547e to 5cfae3e Compare October 6, 2025 12:41
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