rust-playground
rust-playground copied to clipboard
Feature request: `cargo check`
Now that cargo check is stable, i think it'd be useful to offer!
If a program involves loop{}s, sometimes just check is needed, not waiting for running timeout.
How would cargo check be better than cargo build? For example, I recently learned:
note that
cargo checkwon't invoke LLVM so e.g.cargo checkwon't catch errors like this:#![feature(asm)] #![crate_type = "lib"] pub unsafe fn foo() { asm!("asdadasdasdas"); }
"Build" is actually "Run":
fn main() {
loop{}
}
"..." -> "Build. No bells and whistles, regular build coming right up :D"
Compiling playground v0.0.1 (file:///playground)
Finished dev [unoptimized + debuginfo] target(s) in 1.18s
Running `target/debug/playground`
/root/entrypoint.sh: line 8: 7 Killed timeout --signal=KILL ${timeout} "$@"
Yes, the build menu option is misnamed, as you've already reported #333, but that's not what I'm asking. I'm asking why cargo check would be better than cargo build for your purposes.
cargo check is usually faster, i think that's why I suggested it originally, i don't really remember though honestly!
I think this is mostly a non-starter until https://github.com/rust-lang/cargo/issues/3501 is resolved; otherwise we have to build the code twice, doubling the storage requirements.
How would cargo check be better than cargo build? For example, I recently learned:
cargo check is extremely useful when adding a test to the rustc test suite and deciding between check-pass and build-pass. This requires knowing if the issue reproduces with check-pass, which can be quite hard to figure out (and I just almost got it wrong). Being able to try this on the playground would be very helpful.