Steps to reproduce: 1. Build `rustc` with `RUSTFLAGS_STAGE2=-g make rustc-stage2` 2. Try to compile a simple hello-world program with `rustc ./ltocrash.rs -g -C lto` ``` fn main() { println!("Hello World!"); } ``` 1. Observe that `rustc` crashes with the following error: ``` rustc: /home/mw/rust/src/llvm/lib/CodeGen/LexicalScopes.cpp:179: llvm::LexicalScope* llvm::LexicalScopes::getOrCreateRegularScope(llvm::MDNode*): Assertion `DISubprogram(Scope).describes(MF->getFunction())' failed. ``` A very similar issue (https://github.com/rust-lang/rust/issues/17201) occurred in non-LTO cases.