mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Use symbol in cfg
This commit is contained in:
parent
93024ad411
commit
c30bdfcc84
22 changed files with 147 additions and 92 deletions
|
@ -4,6 +4,7 @@ use base_db::{CrateGraph, FileId, ProcMacroPaths};
|
|||
use cargo_metadata::Metadata;
|
||||
use cfg::{CfgAtom, CfgDiff};
|
||||
use expect_test::{expect_file, ExpectFile};
|
||||
use intern::sym;
|
||||
use paths::{AbsPath, AbsPathBuf, Utf8Path, Utf8PathBuf};
|
||||
use rustc_hash::FxHashMap;
|
||||
use serde::de::DeserializeOwned;
|
||||
|
@ -180,7 +181,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("test".into())]).unwrap(),
|
||||
global: CfgDiff::new(Vec::new(), vec![CfgAtom::Flag(sym::test.clone())]).unwrap(),
|
||||
selective: Default::default(),
|
||||
};
|
||||
let (crate_graph, _proc_macros) =
|
||||
|
@ -199,7 +200,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("test".into())]).unwrap(),
|
||||
CfgDiff::new(Vec::new(), vec![CfgAtom::Flag(sym::test.clone())]).unwrap(),
|
||||
))
|
||||
.collect(),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue