Open
Description
Here is a minimal test case to reproduce: https://github.com/xclaesse/rustc-bug.
I believe this is the same issue than #55931 initially discovered this issue while working on this Meson PR: mesonbuild/meson#11714.
I suspect the problem is when compiling both cdylib and staticlib for the same stuff.rs with the same crate name, they use some common intermediary files.