Skip to content
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

Feature request: cargo check #131

Open
carols10cents opened this issue Apr 3, 2017 · 7 comments
Open

Feature request: cargo check #131

carols10cents opened this issue Apr 3, 2017 · 7 comments
Labels
enhancement Something new the playground could do help wanted Not immediately going to be prioritized — ask for mentoring instructions!

Comments

@carols10cents
Copy link
Member

Now that cargo check is stable, i think it'd be useful to offer!

@shepmaster shepmaster added enhancement Something new the playground could do help wanted Not immediately going to be prioritized — ask for mentoring instructions! labels Apr 3, 2017
@vi
Copy link

vi commented Aug 9, 2018

If a program involves loop{}s, sometimes just check is needed, not waiting for running timeout.

@shepmaster
Copy link
Member

How would cargo check be better than cargo build? For example, I recently learned:

note that cargo check won't invoke LLVM so e.g. cargo check won't catch errors like this:

#![feature(asm)]
#![crate_type = "lib"]
pub unsafe fn foo() {
    asm!("asdadasdasdas");
}

@vi
Copy link

vi commented Aug 10, 2018

"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} "$@"

@shepmaster
Copy link
Member

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.

@carols10cents
Copy link
Member Author

cargo check is usually faster, i think that's why I suggested it originally, i don't really remember though honestly!

@shepmaster
Copy link
Member

I think this is mostly a non-starter until rust-lang/cargo#3501 is resolved; otherwise we have to build the code twice, doubling the storage requirements.

@RalfJung
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something new the playground could do help wanted Not immediately going to be prioritized — ask for mentoring instructions!
Projects
None yet
Development

No branches or pull requests

4 participants