Skip to content

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

Closed
@respeccing

Description

@respeccing

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions