rust: avoid unused import warning in `rusttest`

When compiling for the `rusttest` target, the `core::ptr` import is
unused since its only use happens in the `reserve()` method which is
not compiled in that target:

warning: unused import: `core::ptr`
--> rust/kernel/alloc/vec_ext.rs:7:5
|
7 | use core::ptr;
| ^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default

Thus clean it.

Fixes: 97ab3e8eec0c ("rust: alloc: fix dangling pointer in VecExt<T>::reserve()")
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Danilo Krummrich <dakr@redhat.com>
Link: https://lore.kernel.org/r/20240519210735.587323-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

+5 -2
+5 -2
rust/kernel/alloc/vec_ext.rs
··· 4 5 use super::{AllocError, Flags}; 6 use alloc::vec::Vec; 7 - use core::ptr; 8 9 /// Extensions to [`Vec`]. 10 pub trait VecExt<T>: Sized { ··· 140 // `krealloc_aligned`. A `Vec<T>`'s `ptr` value is not guaranteed to be NULL and might be 141 // dangling after being created with `Vec::new`. Instead, we can rely on `Vec<T>`'s capacity 142 // to be zero if no memory has been allocated yet. 143 - let ptr = if cap == 0 { ptr::null_mut() } else { old_ptr }; 144 145 // SAFETY: `ptr` is valid because it's either NULL or comes from a previous call to 146 // `krealloc_aligned`. We also verified that the type is not a ZST.
··· 4 5 use super::{AllocError, Flags}; 6 use alloc::vec::Vec; 7 8 /// Extensions to [`Vec`]. 9 pub trait VecExt<T>: Sized { ··· 141 // `krealloc_aligned`. A `Vec<T>`'s `ptr` value is not guaranteed to be NULL and might be 142 // dangling after being created with `Vec::new`. Instead, we can rely on `Vec<T>`'s capacity 143 // to be zero if no memory has been allocated yet. 144 + let ptr = if cap == 0 { 145 + core::ptr::null_mut() 146 + } else { 147 + old_ptr 148 + }; 149 150 // SAFETY: `ptr` is valid because it's either NULL or comes from a previous call to 151 // `krealloc_aligned`. We also verified that the type is not a ZST.