Implement a config override for the default #[cfg(test)] in cargo crates

Fixes crates which vanish when the 'test' cfg atom is set.

Fix #7243.
Fix #9203.
Fix #7225.
This commit is contained in:
Jade 2021-06-13 21:41:46 -07:00
parent 1f6abb7fba
commit 8b77e2692c
7 changed files with 108 additions and 55 deletions

View file

@ -52,6 +52,7 @@ impl CfgOptions {
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CfgDiff {
// Invariants: No duplicates, no atom that's both in `enable` and `disable`.
enable: Vec<CfgAtom>,