rust/example/std_example.rs

27 lines
597 B
Rust
Raw Normal View History

2019-02-16 15:42:20 +01:00
#![feature(core_intrinsics)]
2019-02-11 19:40:07 +01:00
use std::io::Write;
fn main() {
let _ = ::std::iter::repeat('a' as u8).take(10).collect::<Vec<_>>();
let stderr = ::std::io::stderr();
let mut stderr = stderr.lock();
writeln!(stderr, "some {} text", "<unknown>").unwrap();
2019-02-16 14:02:15 +01:00
2019-02-16 15:42:20 +01:00
let _ = std::process::Command::new("true").env("c", "d").spawn();
println!("cargo:rustc-link-lib=z");
2019-02-16 16:24:03 +01:00
static ONCE: std::sync::Once = std::sync::ONCE_INIT;
ONCE.call_once(|| {});
LoopState::Continue(()) == LoopState::Break(());
}
#[derive(PartialEq)]
enum LoopState {
Continue(()),
Break(())
2019-02-11 19:40:07 +01:00
}