Skip to content

Question: Shouldn't this return a non-zero exit code? #901

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

Closed
respeccing opened this issue Apr 3, 2016 · 3 comments
Closed

Question: Shouldn't this return a non-zero exit code? #901

respeccing opened this issue Apr 3, 2016 · 3 comments
Labels
bug Panic, non-idempotency, invalid code, etc. duplicate

Comments

@respeccing
Copy link

Shouldn't this return a non-zero exit code?

$ cat a.rs| ./rustfmt ; echo $?
stdin:4:5: 4:10 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `panic`
stdin:4     panic!();
            ^~~~~
fn main() {
    println!("Hello, world!<anon>:3");
    12
    panic!();
}
0

(note: stderr and stdout are both present in the above)

This is: a.rs
https://play.rust-lang.org/?gist=72b057fbddf6d3c34152ab70b0ef8abf&version=stable&backtrace=2

rustfmt commit tested: d9ccec6

$ rustc -Vv
!! executing '/home/zazdxscf/build/1nonpkgs/rust/rust//x86_64-unknown-linux-gnu/stage2/bin//rustc' with args: '-Vv'
rustc 1.9.0-dev (f2285bd 2016-04-02)
binary: rustc
commit-hash: f2285bd
commit-date: 2016-04-02
host: x86_64-unknown-linux-gnu
release: 1.9.0-dev

Affects: rust-lang/rust-playpen#194
(But that should probably discard the stderr output, rather than depend on a potential exit code, right?nope)

@nrc nrc added the bug Panic, non-idempotency, invalid code, etc. label Apr 4, 2016
@nrc
Copy link
Member

nrc commented Apr 4, 2016

cc @matklad

@matklad
Copy link
Member

matklad commented Apr 4, 2016

Yep, rustfmt currently returns non-zero status only when command line arguments are invalid. I think this is a duplicate of #150. I am working on it (#897 is prerequisite) :)

@nrc
Copy link
Member

nrc commented Apr 4, 2016

Thanks for the comment. Closing as a dup of #150

@nrc nrc closed this as completed Apr 4, 2016
@nrc nrc added the duplicate label Apr 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Panic, non-idempotency, invalid code, etc. duplicate
Projects
None yet
Development

No branches or pull requests

3 participants