2014-12-21 01:21:27 -06:00
|
|
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2015-03-18 02:57:29 -05:00
|
|
|
// ignore-aarch64
|
2016-08-08 18:39:37 -05:00
|
|
|
// ignore-emscripten
|
2015-03-05 20:33:58 -06:00
|
|
|
#![feature(std_misc, os)]
|
2015-03-18 02:57:29 -05:00
|
|
|
|
2015-02-23 12:59:17 -06:00
|
|
|
#[cfg(unix)]
|
2014-12-21 01:21:27 -06:00
|
|
|
fn main() {
|
2015-02-23 12:59:17 -06:00
|
|
|
use std::process::Command;
|
|
|
|
use std::env;
|
|
|
|
use std::os::unix::prelude::*;
|
|
|
|
use std::ffi::OsStr;
|
|
|
|
|
2015-02-16 08:04:02 -06:00
|
|
|
if env::args().len() == 1 {
|
2015-02-23 12:59:17 -06:00
|
|
|
assert!(Command::new(&env::current_exe().unwrap())
|
|
|
|
.arg(<OsStr as OsStrExt>::from_bytes(b"\xff"))
|
2014-12-21 01:21:27 -06:00
|
|
|
.status().unwrap().success())
|
|
|
|
}
|
|
|
|
}
|
2015-02-23 12:59:17 -06:00
|
|
|
|
|
|
|
#[cfg(windows)]
|
|
|
|
fn main() {}
|