mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 02:29:44 +00:00
Allow unsetting default cfgs
This commit is contained in:
parent
505b52da5f
commit
5e18ad0770
10 changed files with 96 additions and 64 deletions
|
|
@ -166,7 +166,7 @@ fn check_crate_graph(crate_graph: CrateGraph, expect: ExpectFile) {
|
|||
#[test]
|
||||
fn cargo_hello_world_project_model_with_wildcard_overrides() {
|
||||
let cfg_overrides = CfgOverrides {
|
||||
global: CfgDiff::new(Vec::new(), vec![CfgAtom::Flag(sym::test.clone())]).unwrap(),
|
||||
global: CfgDiff::new(Vec::new(), vec![CfgAtom::Flag(sym::test.clone())]),
|
||||
selective: Default::default(),
|
||||
};
|
||||
let (crate_graph, _proc_macros) =
|
||||
|
|
@ -185,7 +185,7 @@ fn cargo_hello_world_project_model_with_selective_overrides() {
|
|||
global: Default::default(),
|
||||
selective: std::iter::once((
|
||||
"libc".to_owned(),
|
||||
CfgDiff::new(Vec::new(), vec![CfgAtom::Flag(sym::test.clone())]).unwrap(),
|
||||
CfgDiff::new(Vec::new(), vec![CfgAtom::Flag(sym::test.clone())]),
|
||||
))
|
||||
.collect(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1522,7 +1522,7 @@ fn extend_crate_graph_with_sysroot(
|
|||
) -> (SysrootPublicDeps, Option<CrateId>) {
|
||||
let mut pub_deps = vec![];
|
||||
let mut libproc_macro = None;
|
||||
let diff = CfgDiff::new(vec![], vec![CfgAtom::Flag(sym::test.clone())]).unwrap();
|
||||
let diff = CfgDiff::new(vec![], vec![CfgAtom::Flag(sym::test.clone())]);
|
||||
for (cid, c) in sysroot_crate_graph.iter_mut() {
|
||||
// uninject `test` flag so `core` keeps working.
|
||||
Arc::make_mut(&mut c.cfg_options).apply_diff(diff.clone());
|
||||
|
|
@ -1596,8 +1596,7 @@ fn sysroot_to_crate_graph(
|
|||
CfgAtom::Flag(sym::miri.clone()),
|
||||
],
|
||||
vec![],
|
||||
)
|
||||
.unwrap(),
|
||||
),
|
||||
..Default::default()
|
||||
},
|
||||
&WorkspaceBuildScripts::default(),
|
||||
|
|
@ -1620,8 +1619,7 @@ fn sysroot_to_crate_graph(
|
|||
CfgAtom::Flag(sym::miri.clone()),
|
||||
],
|
||||
vec![],
|
||||
)
|
||||
.unwrap(),
|
||||
),
|
||||
..Default::default()
|
||||
},
|
||||
false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue