Fixes #72386
This type also needs to get allocated on the `librustc_middle` arena
when we deserialize MIR.
[few] hir_definitions: rustc_hir::definitions::Definitions,
[] hir_owner: rustc_middle::hir::Owner<$tcx>,
[] hir_owner_nodes: rustc_middle::hir::OwnerNodes<$tcx>,
+
+ // Note that this deliberately duplicates items in the `rustc_hir::arena`,
+ // since we need to allocate this type on both the `rustc_hir` arena
+ // (during lowering) and the `librustc_middle` arena (for decoding MIR)
+ [decode] asm_template: rustc_ast::ast::InlineAsmTemplatePiece,
+
], $tcx);
)
}
--- /dev/null
+// revisions: rpass1 cfail1 rpass3
+// only-x86_64
+// Regression test for issue #72386
+// Checks that we don't ICE when switching to an invalid register
+// and back again
+
+#![feature(asm)]
+
+#[cfg(any(rpass1, rpass3))]
+fn main() {
+ unsafe {
+ asm!("nop")
+ }
+}
+
+#[cfg(cfail1)]
+fn main() {
+ unsafe {
+ asm!("nop",out("invalid_reg")_)
+ //[cfail1]~^ ERROR invalid register
+ }
+}