• Linus Torvalds's avatar
    Merge tag 'rust-6.4' of https://github.com/Rust-for-Linux/linux · 31089765
    Linus Torvalds authored
    Pull rust updates from Miguel Ojeda
     "More additions to the Rust core. Importantly, this adds the pin-init
      API, which will be used by other abstractions, such as the
      synchronization ones added here too:
    
       - pin-init API: a solution for the safe pinned initialization
         problem.
    
         This allows to reduce the need for 'unsafe' code in the kernel when
         dealing with data structures that require a stable address. Commit
         90e53c5e ("rust: add pin-init API core") contains a nice
         introduction -- here is an example of how it looks like:
    
            #[pin_data]
            struct Example {
                #[pin]
                value: Mutex<u32>,
    
                #[pin]
                value_changed: CondVar,
            }
    
            impl Example {
                fn new() -> impl PinInit<Self> {
                    pin_init!(Self {
                        value <- new_mutex!(0),
                        value_changed <- new_condvar!(),
                    })
                }
     ...
    31089765
Makefile 17.8 KB