Closed
Description
This can happen, where the user uses string literals but unintentionally borrows self.
fn foo(&self) -> Result<(), &str> { Err("error") }
The lint should suggest &'static str
in the return type to avoid false borrowing, if the function body uses &'static str
. I guess Error::description(&self) -> &str
is an exception, the borrowing is mandated by the trait.