Skip to contentSkip to conversation

linux-next: build failure after merge of the driver-core tree

DISCUSSION Stephen Rothwell 2 participants 2 messages Nov 7, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the driver-core tree, today's linux-next build (x86_64 allmodconfig) failed like this:

error: variable does not need to be mutable
--> rust/kernel/debugfs/traits.rs:266:13

    |
266 |         let mut this = self.lock();
    |             ----^^^^
    |             |
    |             help: remove this `mut`
    |

= note: -D unused-mut implied by -D warnings
= help: to override -D warnings add #[allow(unused_mut)]

error[E0596]: cannot borrow data in dereference of lock::Guard<'_, T, MutexBackend> as mutable
--> rust/kernel/debugfs/traits.rs:268:9

    |
268 |         this.read_from_slice_mut(reader, offset)
    |         ^^^^ cannot borrow as mutable
    |

= help: trait DerefMut is required to modify through a dereference, but it is not implemented for lock::Guard<'_, T, MutexBackend>

error: aborting due to 2 previous errors

For more information about this error, try rustc --explain E0596.

Caused by commit

a9fca8a7b2c5 ("rust: debugfs: support blobs from smart pointers")

(maybe interacting with some other change).

I have used the driver-core tree from next-20251106 for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
maintainer
#1 lore raw
Quoted 5 lines · Stephen Rothwell

Caused by commit

a9fca8a7b2c5 ("rust: debugfs: support blobs from smart pointers")

(maybe interacting with some other change).

This is a conflict with commit da123f0ee40f ("rust: lock: guard: Add T: Unpin bound to DerefMut") from the tip tree.

The following diff [1] should fix the problem; I will also add a patch in the driver-core tree for this, since this also works without the above commit.

rust/kernel/debugfs/traits.rs +1 -1
index 6bd21ff0ed90..7266c39188ba 100644
@@ -257,7 +257,7 @@ fn read_from_slice(
 }
 
 // Delegate for `Mutex<T>`: Support a `T` with an outer `Mutex`.
-impl<T: BinaryReaderMut> BinaryReader for Mutex<T> {
+impl<T: BinaryReaderMut + Unpin> BinaryReader for Mutex<T> {
     fn read_from_slice(
         &self,
         reader: &mut UserSliceReader,