Repository: rust
Issue: SIGSEGV on generating debug info for `rhai`
Labels: I-crash,A-debuginfo,T-compiler,C-bug,S-needs-repro

I tried to build a project which depends on crate `rhai`. Building the dependency crashed rustc with SIGSEGV, with the following backtrace:
```
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(+0x2b51e36)[0x7fae28351e36]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7fae254f8520]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.75.0-stable.so(_ZN4llvm7MDTuple7getImplERNS_11LLVMContextENS_8ArrayRefIPNS_8MetadataEEENS4_11StorageTypeEb+0x130c)[0x7fae2384355a]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(_RNvXs2_NtCseOY8Nz2WDDU_18rustc_codegen_llvm9debuginfoNtNtB7_7context9CodegenCxNtNtNtCshXex1mlJAZ7_17rustc_codegen_ssa6traits9debuginfo16DebugInfoMethods23create_vtable_debuginfo+0x761)[0x7fae2a0d71a1]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(+0x460ea46)[0x7fae29e0ea46]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(+0x460e224)[0x7fae29e0e224]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(+0x42db1f4)[0x7fae29adb1f4]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(+0x46d0868)[0x7fae29ed0868]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(+0x4abe320)[0x7fae2a2be320]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(+0x4aac5d5)[0x7fae2a2ac5d5]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(_RNvXs0_CseOY8Nz2WDDU_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCshXex1mlJAZ7_17rustc_codegen_ssa6traits7backend19ExtraBackendMethods20compile_codegen_unit+0x12e)[0x7fae2a2aa5cc]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(_RNvXs5_CseOY8Nz2WDDU_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCshXex1mlJAZ7_17rustc_codegen_ssa6traits7backend14CodegenBackend13codegen_crate+0x7d1)[0x7fae2a3fbb51]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(_RNvNtCslBK4JWoPbFM_15rustc_interface6passes13start_codegen+0x105)[0x7fae2a3f9b45]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(_RNvMs3_NtCslBK4JWoPbFM_15rustc_interface7queriesNtB5_7Queries15ongoing_codegen+0x196)[0x7fae2a3f95e6]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(+0x4c07071)[0x7fae2a407071]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(+0x4c0215b)[0x7fae2a40215b]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-5aef5f09b8575cae.so(+0x4c01fb3)[0x7fae2a401fb3]
/home/cerber-ursi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libstd-90f6ddbf82de36ec.so(rust_metadata_std_409886f6357001f0+0xb96a5)[0x7fae257986a5]
/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3)[0x7fae2554aac3]
/lib/x86_64-linux-gnu/libc.so.6(+0x126850)[0x7fae255dc850]
```
This behavior is consistent from build to build, and `cargo clean` doesn't help either. I can't reproduce this on another machine though, so it's _possible_ that something is corrupted at my side, but I don't know what could it ever be.

`rustc --version --verbose`:
```
rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-unknown-linux-gnu
release: 1.75.0
LLVM version: 17.0.6
```

Using release build or setting `debug = false` for dev one helps (since the whole problematic part of code seems to be skipped), but I'd like to report this anyway.