diff --git a/rust/lib/src/traits.rs b/rust/lib/src/traits.rs index 5322eccb0..ee698b777 100644 --- a/rust/lib/src/traits.rs +++ b/rust/lib/src/traits.rs @@ -314,7 +314,7 @@ where // - list is properly aligned, dereferencable, and points to an initialized CL, since it is valid // - the lifetime of the resulting reference is limited to this function, during which time // nothing else refers to this memory. - let slice = list.as_mut().unwrap().slice(); + let slice = unsafe { list.as_mut() }.unwrap().slice(); if let Some(elt_ref) = slice.get_mut(index) { let mut rv = None; if let Some(elt) = elt_ref.as_mut() {