You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bluss opened this issue
Sep 6, 2015
· 3 comments
· Fixed by #13395
Assignees
Labels
A-lintArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.T-middleType: Probably requires verifiying types
This can happen, where the user uses string literals but unintentionally borrows self.
fnfoo(&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.
The text was updated successfully, but these errors were encountered:
Manishearth
added
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
T-middle
Type: Probably requires verifiying types
A-lint
Area: New lints
labels
Sep 6, 2015
A-lintArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.T-middleType: Probably requires verifiying types
This can happen, where the user uses string literals but unintentionally borrows self.
The lint should suggest
&'static str
in the return type to avoid false borrowing, if the function body uses&'static str
. I guessError::description(&self) -> &str
is an exception, the borrowing is mandated by the trait.The text was updated successfully, but these errors were encountered: