Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created June 25, 2019 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/b97ee4cab1e9cd191a6fc28be9a7004f to your computer and use it in GitHub Desktop.
Save rust-play/b97ee4cab1e9cd191a6fc28be9a7004f to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
#![allow(unreachable_code)]
fn main() {
println!("{:?}", {
let a = Box::new(0..5); for i in a { println!("{}", i); }
});
}
/* ~~~~=== stderr ===~~~~
Compiling playground v0.0.1 (/playground)
Finished dev [unoptimized + debuginfo] target(s) in 0.90s
Running `target/debug/playground`
*/
/* ~~~~=== stdout ===~~~~
0
1
2
3
4
()
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment