Skip to contentSkip to conversation

rust: alloc: fix missing import needed for `rusttest`

PATCH In review Miguel Ojeda 2 participants 2 messages Aug 16, 2025 – Aug 17, 2025

Subsystems (3)
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH 1/1 rust: alloc: fix missing import needed for `rusttest`

There is a missing import of NumaNode that is used in the rusttest target:

    error[E0412]: cannot find type `NumaNode` in this scope
      --> rust/kernel/alloc/allocator_test.rs:43:15
       |
    43 |         _nid: NumaNode,
       |               ^^^^^^^^ not found in this scope
       |
    help: consider importing this struct
       |
    12 + use crate::alloc::NumaNode;
       |

Thus fix it by adding it.

Fixes 8405eafa6e94 ("rust: add support for NUMA ids in allocations")

---
akpm: please feel free to rebase this into the patch directly if that is simpler/preferred.

We are looking into removing this file, possibly this cycle, so it is not a big deal but meanwhile it would be nice to keep the branch clean nevertheless.

 rust/kernel/alloc/allocator_test.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/alloc/allocator_test.rs +1 -1
index 283c02376458..13435ef8e652 100644
@@ -9,7 +9,7 @@
 
 #![allow(missing_docs)]
 
-use super::{flags::*, AllocError, Allocator, Flags};
+use super::{flags::*, AllocError, Allocator, Flags, NumaNode};
 use core::alloc::Layout;
 use core::cmp;
 use core::ptr;

--
2.50.1

maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · Miguel Ojeda

There is a missing import of NumaNode that is used in the rusttest target:

    error[E0412]: cannot find type `NumaNode` in this scope
      --> rust/kernel/alloc/allocator_test.rs:43:15
       |
    43 |         _nid: NumaNode,
       |               ^^^^^^^^ not found in this scope
       |
    help: consider importing this struct
       |
    12 + use crate::alloc::NumaNode;
       |
Quoted 4 lines

Thus fix it by adding it.

Fixes 8405eafa6e94 ("rust: add support for NUMA ids in allocations")