// 外层属性:只作用在下一个结构体上 #[derive(Debug)] struct Point { x: i32, y: i32 } // 内层属性:作用到整个 crate(必须写在 main.rs / lib.rs 顶部) #![allow(dead_code)] fn main() {}