Skip to content

Commit 9732dda

Browse files
committed
Fix warnings
1 parent 0469376 commit 9732dda

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/build.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ pub fn compile_file(
10141014
// ^^ this one fails for bisect-ppx
10151015
// this is the default
10161016
// we should probably parse the right ones from the package config
1017-
vec!["-w".to_string(), "a".to_string()],
1017+
// vec!["-w".to_string(), "a".to_string()],
10181018
implementation_args,
10191019
// vec![
10201020
// "-I".to_string(),
@@ -1047,6 +1047,10 @@ pub fn compile_file(
10471047
}
10481048
Err(e) => Err(format!("ERROR, {}, {:?}", e, ast_path)),
10491049
Ok(x) => {
1050+
let err = std::str::from_utf8(&x.stderr)
1051+
.expect("stdout should be non-null")
1052+
.to_string();
1053+
10501054
let dir = std::path::Path::new(implementation_file_path)
10511055
.strip_prefix(get_package_path(root_path, &module.package.name))
10521056
.unwrap()
@@ -1082,9 +1086,8 @@ pub fn compile_file(
10821086
);
10831087
}
10841088

1085-
let stderr = std::str::from_utf8(&x.stderr).expect("stderr should be non-null");
1086-
if helpers::contains_ascii_characters(stderr) {
1087-
Ok(Some(stderr.to_string()))
1089+
if helpers::contains_ascii_characters(&err) {
1090+
Ok(Some(err))
10881091
} else {
10891092
Ok(None)
10901093
}
@@ -1466,9 +1469,6 @@ pub fn build(path: &str) -> Result<AHashMap<std::string::String, Module>, ()> {
14661469

14671470
pb.finish();
14681471
cleanup_after_build(&modules, &compiled_modules, &all_modules, &project_root);
1469-
if helpers::contains_ascii_characters(&compile_warnings) {
1470-
println!("{}", &compile_warnings);
1471-
}
14721472
if compile_errors.len() > 0 {
14731473
println!(
14741474
"{}\r{} {}Compiled in {:.2}s",
@@ -1477,6 +1477,9 @@ pub fn build(path: &str) -> Result<AHashMap<std::string::String, Module>, ()> {
14771477
CROSS,
14781478
compile_duration.as_secs_f64()
14791479
);
1480+
if helpers::contains_ascii_characters(&compile_warnings) {
1481+
println!("{}", &compile_warnings);
1482+
}
14801483
println!("{}", &compile_errors);
14811484
return Err(());
14821485
} else {
@@ -1487,6 +1490,9 @@ pub fn build(path: &str) -> Result<AHashMap<std::string::String, Module>, ()> {
14871490
CHECKMARK,
14881491
compile_duration.as_secs_f64()
14891492
);
1493+
if helpers::contains_ascii_characters(&compile_warnings) {
1494+
println!("{}", &compile_warnings);
1495+
}
14901496
}
14911497

14921498
let timing_total_elapsed = timing_total.elapsed();

0 commit comments

Comments
 (0)