Rellum Rellum

S0137: cannot infer lifetime for returned reference

Generated from rellum-diagnostics/src/db.rs.

Explanation

When a function returns a reference and more than one input reference could be the source, elision cannot choose a sound lifetime relationship. The function must spell out the shared named lifetime explicitly.

Common causes

Canonical fixes

Before:

choose(a: &String, b: &String) : &String = a

After:

choose(a: &'a String, b: &'a String) : &'a String = a

Code example

choose(a: &String, b: &String) : &String = a