-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-mir-opt-GVNArea: MIR opt Global Value Numbering (GVN)Area: MIR opt Global Value Numbering (GVN)C-bugCategory: This is a bug.Category: This is a bug.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.
Description
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 MIR in Item(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:22
0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
3: <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::Lint as rustc_middle::mir::visit::Visitor>::visit_local
6: <rustc_mir_transform::lint::Lint as rustc_middle::mir::visit::Visitor>::visit_place
7: <rustc_mir_transform::lint::Lint as rustc_middle::mir::visit::Visitor>::visit_terminator
8: rustc_mir_transform::lint::lint_body
9: rustc_mir_transform::mir_built
<snip>
Metadata
Metadata
Assignees
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-mir-opt-GVNArea: MIR opt Global Value Numbering (GVN)Area: MIR opt Global Value Numbering (GVN)C-bugCategory: This is a bug.Category: This is a bug.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.