Merged to mainline yesterday for Linux 7.0 were yet more Rust changes in preparing for upcoming Rust releases as well as enhancing the kernel build reproducibility when engaging the Rust code.
Miguel Ojeda sent in the latest Rust toolchain and infrastructure updates, which were already merged by Linus Torvalds. This includes preparations for the upcoming Rust 1.95 to improve build reproducibility. Plus there is also another change in eyeing Rust 1.96. Additionally there are some other fixes and changes too:
“Toolchain and infrastructure:
– Remap paths to avoid absolute ones starting with the upcoming Rust 1.95.0 release. This improves build reproducibility, avoids leaking the exact path and avoids having the same path appear in two forms.
The approach here avoids remapping debug information as well, in order to avoid breaking tools that used the paths to access source files, which was the previous attempt that needed to be reverted.
– Allow ‘unused_features’ lint for the upcoming Rust 1.96.0 release. While well-intentioned, we do not benefit much from the new lint.
– Emit dependency information into ‘$(depfile)’ directly to avoid a temporary ‘.d’ file (it was an old approach).
‘kernel’ crate:
– ‘str’ module: fix warning under ‘!CONFIG_BLOCK’ by making ‘NullTerminatedFormatter’ public.
– ‘cpufreq’ module: suppress false positive Clippy warning.
‘pin-init’ crate:
– Remove ‘#[disable_initialized_field_access]’ attribute which was unsound. This means removing the support for structs with unaligned fields (through the ‘repr(packed)’ attribute), for now.
And document the load-bearing fact of field accessors (i.e. that they are required for soundness).
– Replace shadowed return token by ‘unsafe’-to-create token in order to remain sound in the face of the likely upcoming Type Alias Impl Trait (TAIT) and the next trait solver in upstream Rust.”
The code is merged and in position for Linux 7.0-rc4 coming out later today.
