From 7039b7818114e0bf692d55885980eb55358b838c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 4 Jan 2025 11:30:31 +0100 Subject: [PATCH 1/2] turn hir::ItemKind::Fn into a named-field variant --- src/bin/miri.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/miri.rs b/src/bin/miri.rs index 8832016d0f..962e313ce3 100644 --- a/src/bin/miri.rs +++ b/src/bin/miri.rs @@ -242,7 +242,7 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls { let is_reachable_non_generic = matches!( tcx.hir_node_by_def_id(local_def_id), Node::Item(&hir::Item { - kind: hir::ItemKind::Static(..) | hir::ItemKind::Fn(..), + kind: hir::ItemKind::Static(..) | hir::ItemKind::Fn { .. }, .. }) | Node::ImplItem(&hir::ImplItem { kind: hir::ImplItemKind::Fn(..), From 13b91dd479917698fe9641673181d1c747e97fe2 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 4 Jan 2025 11:41:51 +0100 Subject: [PATCH 2/2] rustc_intrinsic: support functions without body; they are implicitly marked as must-be-overridden --- src/bin/miri.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/miri.rs b/src/bin/miri.rs index 962e313ce3..9055aa3027 100644 --- a/src/bin/miri.rs +++ b/src/bin/miri.rs @@ -242,7 +242,7 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls { let is_reachable_non_generic = matches!( tcx.hir_node_by_def_id(local_def_id), Node::Item(&hir::Item { - kind: hir::ItemKind::Static(..) | hir::ItemKind::Fn { .. }, + kind: hir::ItemKind::Static(..) | hir::ItemKind::Fn{ .. }, .. }) | Node::ImplItem(&hir::ImplItem { kind: hir::ImplItemKind::Fn(..),