some local variables are
<optimized out> when debuging rustc with gdb, how can I prevent this?
configure --disable-optimize help?
Did you build rustc by yourself, following instruction in https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html
Especially you need, cp config.toml.example config.toml and set debug=true
FWIW, I've never seen anything in rustc that wouldn't be
<optimized out> on windows-msvc or windows-gnu, even when built with
debuginfo-level = 2.
I didn't investigate why it happens, debugging seems to work on hello-world like examples.
Perhaps build system is doing something wrong.