Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.