Skip to content

Conversation

@gsokoll
Copy link
Contributor

@gsokoll gsokoll commented Jan 6, 2026

Add explicit '_ lifetime annotations to return types where &self implies a lifetime but the return type uses elision to hide it. This addresses the mismatched_lifetime_syntaxes lint enabled by default in recent Rust versions.

Fixes 16 warnings across 11 files:

  • RclPrimitive::handle() trait and all implementations
  • Various lock() methods returning MutexGuard
  • NodeState::use_undeclared_parameters() returning Parameters
  • LogParams::get_logger_name() returning &LoggerName

Closes #558

@gsokoll
Copy link
Contributor Author

gsokoll commented Jan 6, 2026

Rust Stable CI succeeds. Minimal and Windows CI failures seem to be due to other known issues:
#562
#449 (closed, but new regression ?)

@esteve
Copy link
Collaborator

esteve commented Jan 14, 2026

@gsokoll thanks! Once #566 is merged and we start using rustc 1.85, I'll merge this one and #565

Add explicit '_ lifetime annotations to return types where &self implies
a lifetime but the return type uses elision to hide it. This addresses
the mismatched_lifetime_syntaxes lint enabled by default in recent Rust
versions.

Fixes 16 warnings across 11 files:
- RclPrimitive::handle() trait and all implementations
- Various lock() methods returning MutexGuard
- NodeState::use_undeclared_parameters() returning Parameters
- LogParams::get_logger_name() returning &LoggerName

Closes ros2-rust#558
@esteve esteve force-pushed the fix/mismatched-lifetime-syntaxes branch from 5d2025e to 478a933 Compare January 14, 2026 18:59
Copy link
Collaborator

@esteve esteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsokoll thanks! LGTM, waiting for CI to finish

@esteve esteve merged commit 00df505 into ros2-rust:main Jan 14, 2026
9 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.

Add explicit lifetimes to fix mismatched_lifetime_syntaxes warnings

2 participants