From 35d34231f2bfe5788e6785fec5ca59344262758c Mon Sep 17 00:00:00 2001 From: Skgland Date: Sat, 9 Aug 2025 01:59:18 +0200 Subject: [PATCH] don't fail the build script if we couldn't parse a file this way we get to the actual compilation in which rustc shouldl fail with a more helpfull error message --- build/static_string_indexing.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/static_string_indexing.rs b/build/static_string_indexing.rs index 7309f1cf..1a00e17b 100644 --- a/build/static_string_indexing.rs +++ b/build/static_string_indexing.rs @@ -133,7 +133,12 @@ pub fn index_static_strings(instruction_rs_path: &std::path::Path) -> TokenStrea let syntax = match syn::parse_file(&src) { Ok(s) => s, Err(e) => { - panic!("parse error: {e} in file {path:?}"); + println!("cargo::warning=parse error: {e} in file {path:?}"); + syn::File{ + shebang: None, + attrs: vec![], + items: vec![], + } } }; Ok(syntax) -- 2.54.0