Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
global_asm!我需要与宏相同的行为,但传递我的 Rust 代码中定义的常量。显而易见的选择是使用包含内联asm!指令的(私有)裸函数,但我看不出有任何方法可以防止链接器将此类函数删除为未使用。你能建议一个正确的方法吗?
global_asm!
asm!