1 2 3 4 5 6 7 8 9 10 11 12 13
// 错误:`#delegate` 用于 const item,应当报错"只能用于方法" use batch_impl::batch_impl; trait HasConst { const VALUE: u32; } #[batch_impl(usize #delegate(VALUE){0})] trait HasConst { const VALUE: u32; } fn main() {}