This vibecoded patch reproduces the functionality of rust-lang/rust#98551 which was built on top of rustc 1.62.0 and very regrettably was not accepted upstream.
This patch is based on the latest version of rustc as of now (Jul 30 2026), 1.97.1:
$ which ninja cmake || echo "install ninja and cmake first"
$ git clone https://github.com/rust-lang/rust.git -b 1.97.1