1 //! This binary mocks the output of rustc when run with `--error-format=json` and `--json=artifacts`. 2 main()3fn main() { 4 let should_error = std::env::args().any(|arg| arg == "error"); 5 6 eprintln!(r#"{{"rendered": "should be\nin output"}}"#); 7 if should_error { 8 eprintln!("ERROR!\nthis should all\nappear in output."); 9 std::process::exit(1); 10 } 11 eprintln!(r#"{{"emit": "metadata"}}"#); 12 std::thread::sleep(std::time::Duration::from_secs(1)); 13 eprintln!(r#"{{"rendered": "should not be in output"}}"#); 14 } 15