diff --git a/src/ast.rs b/src/ast.rs index f4bc7310..5e99c454 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -505,9 +505,7 @@ impl Book { } let mut book = hvm::Book { defs: Vec::new() }; for (fid, name) in &fid_to_name { - let Some(ast_def) = self.defs.get(name) else { - panic!("missing `@main` definition"); - }; + let ast_def = self.defs.get(name).expect("missing `@main` definition"); let mut def = hvm::Def { name: name.clone(), safe: true, diff --git a/tests/snapshots/run__file@empty.hvm.snap b/tests/snapshots/run__file@empty.hvm.snap index c2ad3ff0..b5b4735e 100644 --- a/tests/snapshots/run__file@empty.hvm.snap +++ b/tests/snapshots/run__file@empty.hvm.snap @@ -4,6 +4,6 @@ expression: rust_output input_file: tests/programs/empty.hvm --- exit status: 101 -thread 'main' panicked at src/ast.rs:509:9: +thread 'main' panicked at src/ast.rs:508:41: missing `@main` definition note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace