Torvalds slams Rust formatting: Completely crazy!
Linus Torvalds criticizes the Rust format check in the Linux 6.18 merge. Current guidelines and workarounds for resolving conflicts are discussed.

Torvalds slams Rust formatting: Completely crazy!
Controversies surrounding Rust integration in the Linux kernel are increasing. Linus Torvalds harshly criticized the Rust format check during the Linux 6.18 merge window, calling it "mindless and completely insane." He particularly criticized the way multi-line import statements are combined into a single line. These statements came minutes before the release of Linux 6.18-rc2, which included quick fixes to address Torvalds' criticisms. Miguel Ojeda, the lead developer for Rust in the Linux project, played a key role and commented on the necessary adjustments for the upcoming version.
As Phoronix reports, merge and rebase conflicts are a recurring problem. The default formatting provided by 'rustfmt' could not properly handle Torvalds' reformulations of import statements, which has caused difficulties in the past. The updated guidelines, which were quickly implemented, provide for a temporary workaround - a subsequent empty comment will make the code compliant with 'rustfmt' again.
The debate about formatting practices
The core of the discussion initially revolved around a pull request for Linux 6.18, which was submitted by maintainer Dave Airlie on October 1st. Torvalds was critical of the flat indentation hierarchy in the changelog and even questioned the quality of Airlie's editor. This technical debate over Rust's formatting tool and the associated merge issues shows how important precise formatting is to the success of a project as complex as the Linux kernel, as It's FOSS documents.
Regarding the challenges posed by incorrect formatting, Miguel explains that more robust configuration options for import formatting are only available in the nightly builds. He recommends running the auto-formatter tool only after conflict resolutions to avoid future problems with the continuous integration system. This underlines the years of experience that are essential when making such decisions.
Rust and its role in the kernel
In the midst of these technical disputes, the role of programming languages in the Linux kernel is critically examined. Torvalds emphasizes that no one is forced to work with Rust, but that doesn't mean that Rust code can be automatically rejected. On the contrary: According to Ars Technica, a collaboration between C developers and Rust developers could be fruitful.
Rust integration is widely seen as a benefit for new code and driver development. Greg Kroah-Hartman, a veteran kernel developer, points out that many of the security problems in recent years have been caused by "stupid little corner cases in C" that don't exist in Rust. Given that there are 30 million lines of C code that aren't going away any time soon, looking at Rust integration going forward is essential.
The discussion around Rust in the Linux kernel has not only technical, but also strategic implications for software development, which should be pursued in order to understand the challenges and opportunities that this new programming landscape offers.