Skip to content

Commit 7b92948

Browse files
authored
Merge pull request #99 from joseluis/no_std
Detect extern main function
2 parents 490294c + c03647b commit 7b92948

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/manifest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ pub fn split_input(
2727
toolchain: Option<String>,
2828
) -> MainResult<(String, String)> {
2929
fn contains_main_method(source: &str) -> bool {
30-
let re_shebang: Regex = Regex::new(r"(?m)^ *(pub )?(async )?fn main *\(").unwrap();
30+
let re_shebang: Regex =
31+
Regex::new(r#"(?m)^ *(pub )?(async )?(extern "C" )?fn main *\("#).unwrap();
3132
re_shebang.is_match(source)
3233
}
3334

0 commit comments

Comments
 (0)