Skip to content

Commit

Permalink
Print crate target+features when compilation fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirbaio committed Apr 7, 2022
1 parent c67234e commit 6a285e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ fn rustc(cx: &mut Context<'_, '_>, unit: &Unit, exec: &Arc<dyn Executor>) -> Car
let mut output_options = OutputOptions::new(cx, unit);
let package_id = unit.pkg.package_id();
let target = Target::clone(&unit.target);
let features = unit.features.clone();
let kind = unit.kind;
let mode = unit.mode;

exec.init(cx, unit);
Expand Down Expand Up @@ -355,7 +357,7 @@ fn rustc(cx: &mut Context<'_, '_>, unit: &Unit, exec: &Arc<dyn Executor>) -> Car
1 => " due to previous error".to_string(),
count => format!(" due to {} previous errors", count),
};
format!("could not compile `{}`{}{}", name, errors, warnings)
format!("could not compile `{}`{}{}\n target: {:?}\n features: {:?}", name, errors, warnings, kind, features)
})?;
// Exec should never return with success *and* generate an error.
debug_assert_eq!(output_options.errors_seen, 0);
Expand Down

0 comments on commit 6a285e5

Please sign in to comment.