Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'rust-fixes-6.10' of https://github.com/Rust-for-Linux/linux

Pull rust fix from Miguel Ojeda:

- Avoid unused import warning in 'rusttest'.

* tag 'rust-fixes-6.10' of https://github.com/Rust-for-Linux/linux:
rust: avoid unused import warning in `rusttest`

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