constants cannot refer to interior mutable data
const C2: &'static AtomicBool = & AtomicBool::new(false); // <- error[E0492]: constants cannot refer to interior mutable data
const C3: &'static [i32; 3] = &[1, 2, 3]; // <- OK
static S1: [i32; 3] = [1, 2, 3];
const C4: &'static [i32; 3] = &S1; // <- error[E0013]: constants cannot refer to statics
S1 не имеет interior mutable, почему нельзя C4 ?
исходя из этого
Обсуждают сегодня