Skip to content

Instantly share code, notes, and snippets.

@pimeys
Created November 6, 2018 11:40
Show Gist options
  • Save pimeys/e6eb9f344978614fe75d30b5394af6e1 to your computer and use it in GitHub Desktop.
Save pimeys/e6eb9f344978614fe75d30b5394af6e1 to your computer and use it in GitHub Desktop.
// WARNING: This output format is intended for human consumers only
// and is subject to change without notice. Knock yourself out.
fn main() -> (){
let mut _0: (); // return place
let mut _1: ();
let mut _2: std::fmt::Arguments;
let mut _3: &[&str];
let mut _4: &[&str; 1];
let mut _5: &[&str; 1];
let mut _6: &[std::fmt::ArgumentV1];
let mut _7: &[std::fmt::ArgumentV1; 0];
let mut _8: &[std::fmt::ArgumentV1; 0];
let mut _9: ();
let mut _10: u8;
bb0: {
StorageLive(_2); // bb0[0]: scope 0 at <::std::macros::println macros>:2:29: 2:63
StorageLive(_3); // bb0[1]: scope 0 at src/main.rs:2:14: 2:29
StorageLive(_4); // bb0[2]: scope 0 at src/main.rs:2:14: 2:29
StorageLive(_5); // bb0[3]: scope 0 at src/main.rs:2:14: 2:29
_5 = &(promoted[1]: [&str; 1]); // bb0[4]: scope 0 at src/main.rs:2:14: 2:29
_4 = _5; // bb0[5]: scope 0 at src/main.rs:2:14: 2:29
_3 = move _4 as &[&str] (Unsize); // bb0[6]: scope 0 at src/main.rs:2:14: 2:29
StorageDead(_4); // bb0[7]: scope 0 at src/main.rs:2:28: 2:29
StorageLive(_6); // bb0[8]: scope 0 at src/main.rs:2:14: 2:29
StorageLive(_7); // bb0[9]: scope 0 at src/main.rs:2:14: 2:29
StorageLive(_8); // bb0[10]: scope 0 at src/main.rs:2:14: 2:29
StorageLive(_9); // bb0[11]: scope 0 at src/main.rs:2:14: 2:29
_10 = discriminant(_9); // bb0[12]: scope 0 at src/main.rs:2:14: 2:29
_8 = &(promoted[0]: [std::fmt::ArgumentV1; 0]); // bb0[13]: scope 0 at src/main.rs:2:14: 2:29
_7 = _8; // bb0[14]: scope 0 at src/main.rs:2:14: 2:29
_6 = move _7 as &[std::fmt::ArgumentV1] (Unsize); // bb0[15]: scope 0 at src/main.rs:2:14: 2:29
StorageDead(_7); // bb0[16]: scope 0 at src/main.rs:2:28: 2:29
_2 = const std::fmt::Arguments::new_v1(move _3, move _6) -> bb1; // bb0[17]: scope 0 at <::std::macros::println macros>:2:29: 2:63
// ty::Const
// + ty: fn(&[&str], &[std::fmt::ArgumentV1]) -> std::fmt::Arguments {std::fmt::Arguments::new_v1}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::println macros>:2:29: 2:63
// + ty: fn(&[&str], &[std::fmt::ArgumentV1]) -> std::fmt::Arguments {std::fmt::Arguments::new_v1}
// + literal: Const { ty: fn(&[&str], &[std::fmt::ArgumentV1]) -> std::fmt::Arguments {std::fmt::Arguments::new_v1}, val: Scalar(Bits { size: 0, bits: 0 }) }
}
bb1: {
StorageDead(_6); // bb1[0]: scope 0 at <::std::macros::println macros>:2:62: 2:63
StorageDead(_3); // bb1[1]: scope 0 at <::std::macros::println macros>:2:62: 2:63
_1 = const std::io::_print(move _2) -> bb2; // bb1[2]: scope 0 at <::std::macros::println macros>:2:3: 2:65
// ty::Const
// + ty: for<'r> fn(std::fmt::Arguments<'r>) {std::io::_print}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::println macros>:2:3: 2:26
// + ty: for<'r> fn(std::fmt::Arguments<'r>) {std::io::_print}
// + literal: Const { ty: for<'r> fn(std::fmt::Arguments<'r>) {std::io::_print}, val: Scalar(Bits { size: 0, bits: 0 }) }
}
bb2: {
StorageDead(_2); // bb2[0]: scope 0 at <::std::macros::println macros>:2:64: 2:65
StorageDead(_8); // bb2[1]: scope 0 at <::std::macros::println macros>:2:66: 2:67
StorageDead(_9); // bb2[2]: scope 0 at <::std::macros::println macros>:2:66: 2:67
StorageDead(_5); // bb2[3]: scope 0 at <::std::macros::println macros>:2:66: 2:67
return; // bb2[4]: scope 0 at src/main.rs:3:2: 3:2
}
}
promoted[0] in main: [std::fmt::ArgumentV1; 0] ={
let mut _0: [std::fmt::ArgumentV1; 0]; // return place
let mut _1: [std::fmt::ArgumentV1; 0];
bb0: {
_1 = []; // bb0[0]: scope 0 at src/main.rs:2:14: 2:29
_0 = move _1; // bb0[1]: scope 0 at src/main.rs:2:14: 2:29
return; // bb0[2]: scope 0 at src/main.rs:2:14: 2:29
}
}
promoted[1] in main: [&str; 1] ={
let mut _0: [&str; 1]; // return place
let mut _1: [&str; 1];
let mut _2: &str;
let mut _3: &str;
bb0: {
_3 = const "Hello, world!\n"; // bb0[0]: scope 0 at src/main.rs:2:14: 2:29
// ty::Const
// + ty: &str
// + val: ScalarPair(Ptr(Pointer { alloc_id: AllocId(0), offset: Size { raw: 0 } }), Scalar(Bits { size: 8, bits: 14 }))
// mir::Constant
// + span: src/main.rs:2:14: 2:29
// + ty: &str
// + literal: Const { ty: &str, val: ScalarPair(Ptr(Pointer { alloc_id: AllocId(0), offset: Size { raw: 0 } }), Scalar(Bits { size: 8, bits: 14 })) }
_2 = _3; // bb0[1]: scope 0 at src/main.rs:2:14: 2:29
_1 = [move _2]; // bb0[2]: scope 0 at src/main.rs:2:14: 2:29
_0 = move _1; // bb0[3]: scope 0 at src/main.rs:2:14: 2:29
return; // bb0[4]: scope 0 at src/main.rs:2:14: 2:29
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment