我有这个 Rust 函数:
pub fn abc(x: &dyn Fn()) {
x()
}
Run Code Online (Sandbox Code Playgroud)
当我在Godbolt Compiler Explorer上使用 Rust 1.63.0 编译它时,我得到了生成的 x86-64 汇编代码:
example::abc:
push rax
call qword ptr [rsi + 40]
pop rax
ret
Run Code Online (Sandbox Code Playgroud)
偏移量从哪里来40?我想对生成的汇编代码有一个基本的了解。