Skip to content

Conversation

@jinetty
Copy link

@jinetty jinetty commented Aug 8, 2025

After Rust 1.89.0 version, Lifetime elision lint added. This creates error: hiding a lifetime that's elided elsewhere is confusing error and requires <'_> for obvious time validation.

error: hiding a lifetime that's elided elsewhere is confusing
  --> sudo\src\rpc_bindings.rs:16:19
   |
16 |     pub fn new(s: &str) -> Utf8Str {
   |                   ^^^^     ------- the same lifetime is hidden here
   |                   |
   |                   the lifetime is elided here
   |
   = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
   = note: `-D mismatched-lifetime-syntaxes` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(mismatched_lifetime_syntaxes)]`
help: use `'_` for type paths
   |
16 |     pub fn new(s: &str) -> Utf8Str<'_> {
   |                                   ++++

error: could not compile `sudo` (bin "sudo") due to 1 previous error

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.

1 participant