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
I think a lint for code of the following form would be useful:
fnfoo<'a>(x:&'astr) -> &'astr{
x
}
This function signature contains explicit lifetimes which can be inferred by the compiler. I imagine that the lint would emit something like the following:
warning: unnecesary lifetime annotations
fn foo<'a>(x: &'a str) -> &'a str {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: signature can be written as follows:
fn foo(x: &str) -> &str {
Perhaps the suggested signature bit would be tricky. I also have no opinion regarding whether or not this lint would be on or off by default.
The text was updated successfully, but these errors were encountered:
bstrie
added
the
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
label
Nov 10, 2014
I think a lint for code of the following form would be useful:
This function signature contains explicit lifetimes which can be inferred by the compiler. I imagine that the lint would emit something like the following:
Perhaps the suggested signature bit would be tricky. I also have no opinion regarding whether or not this lint would be on or off by default.
The text was updated successfully, but these errors were encountered: