-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lint request: Prevent lifetimes that are only used for function output #1874
Comments
In the standard library the opposite is true; people tend to prefer the former style to the latter. |
Yea, the static lifetime might mess with some inference around multiple lifetimes. If this lint is deemed too controversial, it can always become a restriction lint or allow-by-default |
I should also add that this only works for |
Oh, there is a difference. What about making this a case only for public non- |
Where are we with regards to this lint?
If this is what we want, I reckon I can probably implement it :) |
The only way we can implement it without false positives is to check that the return type "has a |
Should there be a |
I personally think that a means to not have both Dunno if it's a good idea to toss this yet, I just think that it's not something that is high on the priority list. |
Similar to #305 |
The following:
Can be more clearly written as this. Also, using
'static
lifetime makes it clear that it was intended, especially in unsafe code where returning unbound lifetime may as well be a mistake.The text was updated successfully, but these errors were encountered: