From e5b23ef9a03a444a25d94e4ae295670425fb27e5 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Fri, 27 May 2022 23:15:33 +0000 Subject: [PATCH] add missing unsafe block The // SAFETY comment already exists -- only the unsafe { .. } was omitted. --- rust/lib/src/traits.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() {