From aae9925014a8618adf9315aba448b62ae41d6ef5 Mon Sep 17 00:00:00 2001 From: ychenfo Date: Thu, 11 Nov 2021 23:44:57 +0800 Subject: [PATCH] nac3standalone: report when entry point run function cannot be found --- nac3standalone/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nac3standalone/src/main.rs b/nac3standalone/src/main.rs index 5b4e31dd..1b09e9b0 100644 --- a/nac3standalone/src/main.rs +++ b/nac3standalone/src/main.rs @@ -100,7 +100,11 @@ fn main() { let instance = { let defs = top_level.definitions.read(); - let mut instance = defs[resolver.get_identifier_def("run".into()).unwrap().0].write(); + let mut instance = + defs[resolver + .get_identifier_def("run".into()) + .unwrap_or_else(|| panic!("cannot find `run() -> int32 entry point`")).0 + ].write(); if let TopLevelDef::Function { instance_to_stmt, instance_to_symbol,