You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"use of local which has no storage here" at -Zmir-opt-level=0 #144932
I ran into this in my PR #131650 (comment) when trying to use GVN more, because MIR "lints" are enabled in the mir-opt suite.
This lint fires a fair bit in the ecosystem, for example in zvariant-5.6.0, compiling with RUSTFLAGS="-Zlint-mir -Zmir-opt-level=0 -Zmir-enable-passes=+GVN" cargo +nightly build
error: internal compiler error: broken MIRinItem(DefId(0:1107 ~ zvariant[4905]::dbus::ser::{impl#4}::serialize_struct_element))(after pass SanityCheck) at bb46[0]:use of local _10, which has no storage here
--> src/dbus/ser.rs:540:5
|
540 | }
| ^
|
note: delayed at compiler/rustc_mir_transform/src/lint.rs:74:220: <rustc_errors::DiagCtxtInner>::emit_diagnostic1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic2: <rustc_span::ErrorGuaranteedas rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee3: <rustc_errors::DiagCtxtHandle>::span_delayed_bug::<rustc_span::span_encoding::Span, alloc::string::String>4:<rustc_mir_transform::lint::Lint>::fail::<alloc::string::String>
5: <rustc_mir_transform::lint::Lintas rustc_middle::mir::visit::Visitor>::visit_local6: <rustc_mir_transform::lint::Lintas rustc_middle::mir::visit::Visitor>::visit_place7: <rustc_mir_transform::lint::Lintas rustc_middle::mir::visit::Visitor>::visit_terminator8: rustc_mir_transform::lint::lint_body9: rustc_mir_transform::mir_built<snip>
changed the title [-]"use of local which has no storage here" caused by GVN[/-][+]"use of local which has no storage here" at -Zmir-opt-level=0[/+]on Aug 6, 2025
Activity
cjgillot commentedon Aug 5, 2025
I'm puzzled by this issue.
SanityCheckruns just after MIR building. The only thing that happens earlier is aSimplifyCfg.saethlin commentedon Aug 5, 2025
Oh, hm. It's quite possible that in my hunt for this same error outside my PR I ran into a different problem.
[-]"use of local which has no storage here" caused by GVN[/-][+]"use of local which has no storage here" at -Zmir-opt-level=0[/+]saethlin commentedon Aug 6, 2025
Yeah this is definitely not the GVN issue I was hunting. It's a problem before opts.