]> git.dujemihanovic.xyz Git - linux.git/commit
rust: avoid unused import warning in `rusttest`
authorMiguel Ojeda <ojeda@kernel.org>
Sun, 19 May 2024 21:07:35 +0000 (23:07 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 11 Jun 2024 21:33:28 +0000 (23:33 +0200)
commita126eca844353360ebafa9088d22865cb8e022e3
treeec6bd5133ec87ca3f97ca23c7050e696f46f47fb
parent83a7eefedc9b56fe7bfeff13b6c7356688ffa670
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>
rust/kernel/alloc/vec_ext.rs