Returned reference independent of parameter

⚓ Rust    📅 2025-08-06    👤 surdeus    👁️ 5      

surdeus

fn foo<'a>(&self, arg: &’a mut Type) → &’a mut Type {
    // …
    return arg;
}

This demands &self outlives ’a . Is there any way or any planned way to specify that the return is independent of the lifetime of the first argument?

3 posts - 2 participants

Read full topic

🏷️ Rust_feed