summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-06-25 01:06:56 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2026-06-25 01:06:56 +0300
commitdcebfd2c1404d1c931e86ec5168cdc006d503909 (patch)
tree1eca846f8c4946d0501528cf41d354e53f9c38ac /scripts
parent26ae421f7f49f8a6a32d15b1d21a782b46a1bad5 (diff)
parent191f49f1e38b1c10eb44b0f967c6175c884ef7db (diff)
downloadlinux-dcebfd2c1404d1c931e86ec5168cdc006d503909.tar.xz
Merge tag 'rust-fixes-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux
Pull rust fixes from Miguel Ojeda: "Toolchain and infrastructure: - Work around a 'rustc' bug by setting the 'frame-pointer' LLVM module flag under 'CONFIG_FRAME_POINTER'. The upcoming Rust 1.98.0 is fixed. - Doctests: fix incorrect replacement pattern. 'kernel' crate: - Mark 'Debug' impl as '#[inline]'" * tag 'rust-fixes-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux: rust: Kbuild: set frame-pointer llvm module flag for CONFIG_FRAME_POINTER rust: doctest: fix incorrect pattern in replacement rust: bitfield: mark `Debug` impl as `#[inline]`
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rustdoc_test_builder.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/scripts/rustdoc_test_builder.rs b/scripts/rustdoc_test_builder.rs
index f7540bcf595a..df864437cef7 100644
--- a/scripts/rustdoc_test_builder.rs
+++ b/scripts/rustdoc_test_builder.rs
@@ -28,7 +28,7 @@ fn main() {
//
// ```
// fn main() { #[allow(non_snake_case)] fn _doctest_main_rust_kernel_file_rs_28_0() {
- // fn main() { #[allow(non_snake_case)] fn _doctest_main_rust_kernel_file_rs_37_0() -> Result<(), impl ::core::fmt::Debug> {
+ // fn main() { #[allow(non_snake_case)] fn _doctest_main_rust_kernel_file_rs_37_0() -> Result<(), impl core::fmt::Debug> {
// ```
//
// It should be unlikely that doctest code matches such lines (when code is formatted properly).
@@ -47,12 +47,16 @@ fn main() {
})
.expect("No test function found in `rustdoc`'s output.");
- // Qualify `Result` to avoid the collision with our own `Result` coming from the prelude.
+ // Replicate `rustdoc` 1.87+ behaviour [1] by fully qualifying `Result` to avoid the collision
+ // with our own `Result` coming from the prelude.
+ //
+ // [1]: https://github.com/rust-lang/rust/pull/137807
+ //
+ // TODO: Remove this when MSRV is bumped above 1.87.
let body = body.replace(
- &format!("{rustdoc_function_name}() -> Result<(), impl ::core::fmt::Debug> {{"),
- &format!(
- "{rustdoc_function_name}() -> ::core::result::Result<(), impl ::core::fmt::Debug> {{"
- ),
+ &format!("{rustdoc_function_name}() -> Result<(), impl core::fmt::Debug> {{"),
+ // This intentionally does not use absolute paths to match `rustdoc` 1.87 behaviour.
+ &format!("{rustdoc_function_name}() -> core::result::Result<(), impl core::fmt::Debug> {{"),
);
// For tests that get generated with `Result`, like above, `rustdoc` generates an `unwrap()` on