-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add lint &ref x
patterns that could be just x
#1536
Conversation
Maybe "struct"? not sure, you should mostly be using
the one is for
"Type ConteXt", if you have a lifetime of that name, it usually means that you can feed it into many functions expecting a |
It's like the second time in a week someone has asked that. Maybe we should update the CONTRIBUTE.md file (or rustc's doc itself?) |
I'd update the latter and link from the former. |
IIRC |
Thank you very much for explanations! I'm sorry I couldn't finish this long time ago. I started working on it again, but I haven't been able to build clippy with Rust Nightly for some time even if I grab the latest version. I'm a little bit confused since I get a lot of errors not related to my modifications : https://pastebin.com/uU4H3vhm |
yea, clippy needs to be fixed to work on the latest nightly, see #1646 |
Note that you can use |
Ahw, I see. Thank you, I will use that. |
clippy now works with the latest nightly again. |
Just a reminder that you have a PR open @CBenoit . There's no hurry whatsoever! |
Thank you for reminding me! |
Hello! I'm trying to finish this lint. I tried running util/dogfood.sh, but could not do it because of the following error :
I don't know what can be done about that… Furthermore, I don't know why but the lint in its current state doen't works anymore even though it previously gave the result presented in the first post… Also, I wanted to try checking the pattern is in a closure's |
There's no need to run It's not bad to write
What do you mean by "not working anymore"? |
Ok! It works now. But at the end, what meaning does Yes, but there is no way of checking if it is specifically in a clojure? I have to use another It doesn't lint my test code anymore. Maybe the reason is that my fork doesn't provide the lint, but I ran the "update_lints.py" beforehand. |
I think There's an issue (https://github.com/Manishearth/rust-clippy/issues/1846) with our test suite. |
r=me when we get travis back in line |
Where were the tests for this new lint? |
I didn't had the time to write it yet (and don't know yet how to do it). Furthermore, it seems that the lint doesn't works anymore as mentioned four days ago... I didn't figure out why yet. |
Can we add a suggestion to remove the |
@CBenoit I was planning on adding the suggestion after the merge, but if you still want to do the tests, I can hold off and do that later. To add a new test simply add a file in |
OK! Thank you, I'll open a new pull request soon. |
Pull request for https://github.com/Manishearth/rust-clippy/issues/1434
This is an unfinished PR to discuss, I need to complete doc comment and investigate for false positives.
I will perform a rebase before the actual merge.
Currently, with the following code:
I get the following warning:
I put comments here Manishearth/rust-clippy@master...CBenoit:master#diff-c4b7ab8d347ac2a35bfd4dd00d14d6a2R40 to check my understanding of the code.
By the way, as I tried to understand the code of needless_borrow lint I came across three side questions:
S
ofrustc::ty::TyS
stands for?Thanks!