mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 10:47:16 +00:00

Fix cycle error only occurring with -Zdump-mir fixes #134205 During mir dumping, we evaluate static items to render their allocations. If a static item refers to itself, its own MIR will have a reference to itself, so during mir dumping we end up evaluating the static again, causing us to try to build MIR again (mir dumping happens during MIR building). Thus I disabled evaluation of statics during MIR dumps in case the MIR body isn't far enough along yet to be able to be guaranteed cycle free.
For more information about how rustc works, see the rustc dev guide.