-
Notifications
You must be signed in to change notification settings - Fork 2.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
Implement cargo check #2834
Implement cargo check #2834
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks for the PR @azerupi! Exciting to see progress on this! Some thoughts of mine:
|
Hi, thanks for the feedback! :)
Indeed, that would not be useful. If there is some mentoring involved I would be willing to take the jump and try to implement this both on the rustc and cargo side. But it's the first time I work on either code bases, so I will definitely need some guidance and time.
This is very much possible, I am not familiar with the code and didn't test it thoroughly enough to say.
Of course! However, according to your first point it may be better to set this PR on hold or close it until the necessary changes are made in rustc? |
Hm I was trying to find a tracking issue pertaining to |
☔ The latest upstream changes (presumably #2867) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm gonna close this for now as we'll need to get the |
Attempt to implement #1313
It's the first time I dive into the code of Cargo, so take your time to review this properly. It's mostly copy paste from other commands with little tweaks until it worked like intended (at least I think it does).
Also sorry for the noise, I have rustfmt set up to run on save.
To summarize what I did and why
For linters that are integrated in text editors / IDEs compiling with
-Z no-trans
reduces the error reporting time. But the problem is that you can't pass custom arguments to rustc when you have multiple targets, for example a lib and a bin or multiple bins. To allow custom arguments to rustc for multiple targets would not be "safe" because cargo has no idea what is passed to rustc and some needed artifacts may or may not be created. See #2642To allow
-Z no-trans
on multiple targets without having to remove the restrictions oncargo rustc
I have added a new commandcargo check
I created a new flag in
It is set to false for all commands except
cargo check
.In
compile_ws
I added an extraif
for whencompile_check
is true (this occurs only whitcargo check
). When it is true cargo passes-Z no-trans
to rustc.That's it.