Closed
Description
This is a known problem from #43370, but I feel it deserves its own issue. When using rustc compiled with LLVM 5.0.1, compiling with debuginfo often prints "invalid expression" messages to stderr, and AFAICT affected functions don't get any debuginfo written at all. For example:
$ cat foo.rs
fn main() {
(0..10).for_each(|i| println!("{}", i));
}
$ rustc -g foo.rs
invalid expression
!40 = !DIExpression(6, 34, 0)
Previous analysis in #43370 tied it to this declare_local
call, and @eddyb offered a possible solution in #43370 (comment).