Rust有在构建时检查配置的能力,例如使用
#[cfg(target_os = "linux")]
或if cfg!(target_os = "linux") {...}
,其中target_os
是一个特性。是否有所有(或至少常用的)可以在Rust中检查的特性列表?
请参考相关问题,了解有关属性的信息是否有任何详尽的标准属性列表?。