

The C and C++ compilers use the same backends (and rust to, llvm), just try to build a module with clang for a kernel build with GCC, or it fails in compile phase or when you try to load the module. You can write a module in the lenguaje that you want if you use the same backend, but if we are talking about avoiding to use a kernel with rust, man is the default in the kernel, just read the config, rust is disabled
Maybe depends for the configs, in my case I need to build the external modules with the same compiler, and in lkml you can see a few warnings about do not mix the compiles: https://lkml.iu.edu/hypermail/linux/kernel/2107.3/08102.html
For rust modules you need to use LVM=1 because you need to use all the LVM stack instead of the GCC stack, if I define in the Makefike the LVM=1 then the build fails with a lot of clang: error: unknown argument: …
So for me is impossible to build my rust modules for a kernel build with a GCC kernel