panics but build is reported as successful (Nightly)


Hi all

I’m writing a file and when it panics cargo still reports a successful build. Have I
done anything wrong or have I stumbled upon an issue?


use std::process::Command;
use std::env;

fn main() {                                                    
    let output = Command::new("pg_tmp").output().expect(       
        "failed to execute pg_tmp",                            
    let key = "DATABASE_URL".to_owned();                       
    let database_url = String::from_utf8_lossy(&output.stdout);
    env::set_var(&key, database_url.as_ref());                 
        .args(&["migration", "run"])                           
    println!("rustc-env={}={:?}", &key, &database_url);        

I still get a successful build and panic when manually running the diesel migrations.

$ cargo build && cat target/debug/build/project-*/output
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running migration 20171014183009
syntax error at or near ")"
Running migration 20171014183009
syntax error at or near ")"

Version info

$ cargo --version
cargo 0.23.0-nightly (e447ac7e9 2017-09-27)
$ rustc --version
rustc 1.22.0-nightly (dcbbfb6e8 2017-10-12)


Where is it panicing? From the output, the last line of the script has run.

You probably want to check the contents of the status of the command.


Yeah it seems like I had some old output still left, it seems to work good now.

Sorry for the noise