linux-sg2042/rust
Miguel Ojeda 2eed4381ee kbuild: rust: remove unneeded `@rustc_cfg` to avoid ICE
commit 50cfe93b01 upstream.

When KUnit tests are enabled, under very big kernel configurations
(e.g. `allyesconfig`), we can trigger a `rustdoc` ICE [1]:

      RUSTDOC TK rust/kernel/lib.rs
    error: the compiler unexpectedly panicked. this is a bug.

The reason is that this build step has a duplicated `@rustc_cfg` argument,
which contains the kernel configuration, and thus a lot of arguments. The
factor 2 happens to be enough to reach the ICE.

Thus remove the unneeded `@rustc_cfg`. By doing so, we clean up the
command and workaround the ICE.

The ICE has been fixed in the upcoming Rust 1.79 [2].

Cc: stable@vger.kernel.org
Fixes: a66d733da8 ("rust: support running Rust documentation tests as KUnit ones")
Link: https://github.com/rust-lang/rust/issues/122722 [1]
Link: https://github.com/rust-lang/rust/pull/122840 [2]
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20240422091215.526688-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-02 16:32:42 +02:00
..
alloc rust: upgrade to Rust 1.73.0 2024-02-16 19:10:43 +01:00
bindings linux-kselftest-kunit-6.6-rc1 2023-08-28 18:56:38 -07:00
kernel rust: init: remove impl Zeroable for Infallible 2024-05-02 16:32:42 +02:00
macros Rust changes for v6.6 2023-08-29 08:19:46 -07:00
uapi rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
.gitignore rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
Makefile kbuild: rust: remove unneeded `@rustc_cfg` to avoid ICE 2024-05-02 16:32:42 +02:00
bindgen_parameters rust: Ignore preserve-most functions 2024-01-25 15:35:41 -08:00
build_error.rs rust: add `build_error` crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs rust: upgrade to Rust 1.73.0 2024-02-16 19:10:43 +01:00
exports.c rust: add `build_error` crate 2022-12-04 01:59:16 +01:00
helpers.c Rust changes for v6.6 2023-08-29 08:19:46 -07:00