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
~/Downloads/test/vscode-test $ cargo check --all-targets
Checking vscode-test v0.1.0(file:///C:/Users/Mooma/Downloads/test/vscode-test)
error: expected one of `!`, `(`, `+`, `,`, `::`, or `<`, found `bar`
--> src\main.rs:3:17
|
3 | fn bar(foo:i32 bar: f32) -> f32{
| ^^^ expected one of `!`, `(`, `+`, `,`, `::`, or `<` here
error: expected one of `!`, `(`, `+`, `,`, `::`,or `<`,found `bar`
--> src\main.rs:3:17
|
3 | fn bar(foo:i32 bar: f32) -> f32 {
| ^^^ expected one of `!`, `(`, `+`, `,`, `::`, or `<` here
error: aborting due to previous error
error: aborting due to previous error
error:Could not compile `vscode-test`.
warning: build failed, waiting for other jobs to finish...
error:Could not compile `vscode-test`.To learn more, run the command again with --verbose.
The text was updated successfully, but these errors were encountered:
The duplicates are due to the same file (main.rs in this case) being used for different targets (binary and unit test). You can use the various target flags (--bin, --lib, --test, etc.) to limit which targets are checked. It depends on your use case. I have my editor set up to automatically check as a test (cargo check --bin vscode-test --profile=test in this case) to ensure that any tests get checked (a few lints will be disabled, such as missing_docs when checking as a test, but those are rare).
What's actually happening here is that the library is being compiled twice (once with --test and once for doc tests later on), and this is a dupe of #1534, #851, and #1198. This is intended behavior though, and you can use various flags like --test, --lib, or -j to not run rustc in parallel, so I'm going to close this.
When running
cargo check --all-targets
, messages are sometimes duplicated in the output.Version: cargo 1.27.0-nightly (9e53ac6 2018-05-07)
Example erroneous code in a simple new binary project:
Corresponding output:
The text was updated successfully, but these errors were encountered: