Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/cargo/core/compiler/build_context/target_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ impl TargetInfo {

fn not_user_specific_cfg(cfg: &CargoResult<Cfg>) -> bool {
if let Ok(Cfg::Name(cfg_name)) = cfg {
if cfg_name == "debug_assertions" || cfg_name == "proc_macro" {
// This should also include "debug_assertions", but it causes
// regressions. Maybe some day in the distant future it can be
// added (and possibly change the warning to an error).
if cfg_name == "proc_macro" {
return false;
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/cargo/core/compiler/custom_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ fn build_work<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoRes
}
}
for (k, v) in cfg_map {
if k == "debug_assertions" {
// This cfg is always true and misleading, so avoid setting it.
// That is because Cargo queries rustc without any profile settings.
continue;
}
let k = format!("CARGO_CFG_{}", super::envify(&k));
match v {
Some(list) => {
Expand Down