[][src]Function tao_of_rust::ch04::general_concepts::simple_stack_frame

pub fn simple_stack_frame()

栈:

Base usage: 简单函数调用栈帧展示 参考图4-5

fn foo(x: u32) {   // ------+
    let y = x;     //       |  foo 函数栈帧
    let z = 100;   //       |  其实就是foo函数作用域
}                  // ------+
fn main(){       // ------+
    let x = 42;  //       |  main函数栈帧
    foo(x);      //       |
}                // ------+Run