-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-lintArea: New lintsArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.T-middleType: Probably requires verifiying typesType: Probably requires verifiying types
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.
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.T-middleType: Probably requires verifiying typesType: Probably requires verifiying types