]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
kbuild: rust: remove unneeded `@rustc_cfg` to avoid ICE
authorMiguel Ojeda <ojeda@kernel.org>
Mon, 22 Apr 2024 09:12:15 +0000 (11:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 May 2024 14:32:42 +0000 (16:32 +0200)
commit2eed4381ee41759f29adc7e235b91e8978f8e948
treeeb5d6686f09b4829139653d37370bbe63a7009ad
parent3a9337459645c189a692be0c78bc8a6e5649b7d2
kbuild: rust: remove unneeded `@rustc_cfg` to avoid ICE

commit 50cfe93b01475ba36878b65d35d812e1bb48ac71 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: a66d733da801 ("rust: support running Rust documentation tests as KUnit ones")
Link: https://github.com/rust-lang/rust/issues/122722
Link: https://github.com/rust-lang/rust/pull/122840
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>
rust/Makefile