From 54331fc359fe3149979eb751e28c645c7aadefdc Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Mon, 22 Aug 2022 03:20:32 +0900 Subject: [PATCH] panic when parser build failed --- parser/build.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/parser/build.rs b/parser/build.rs index 2d1c5d18b..57793dfe6 100644 --- a/parser/build.rs +++ b/parser/build.rs @@ -71,12 +71,13 @@ fn try_lalrpop(source: &str, target: &str) -> anyhow::Result<()> { } #[cfg(feature = "lalrpop")] - lalrpop::process_root().expect("running lalrpop failed"); + { + lalrpop::process_root().expect("running lalrpop failed"); + Ok(()) + } #[cfg(not(feature = "lalrpop"))] - eprintln!("try: cargo build --manifest-path=parser/Cargo.toml --features=lalrpop"); - - Ok(()) + panic!("try: cargo build --manifest-path=parser/Cargo.toml --features=lalrpop"); } fn sha_equal(expected_sha3_str: &str, actual_sha3: &[u8; 32]) -> bool {