mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
use slightly more idiomatic api for cfg
This commit is contained in:
parent
93199002af
commit
355419d404
7 changed files with 59 additions and 40 deletions
|
@ -43,8 +43,12 @@ pub fn load_cargo(root: &Path) -> Result<(AnalysisHost, FxHashMap<SourceRootId,
|
|||
);
|
||||
|
||||
// FIXME: cfg options?
|
||||
let default_cfg_options =
|
||||
get_rustc_cfg_options().atom("test".into()).atom("debug_assertion".into());
|
||||
let default_cfg_options = {
|
||||
let mut opts = get_rustc_cfg_options();
|
||||
opts.insert_atom("test".into());
|
||||
opts.insert_atom("debug_assertion".into());
|
||||
opts
|
||||
};
|
||||
|
||||
let (crate_graph, _crate_names) =
|
||||
ws.to_crate_graph(&default_cfg_options, &mut |path: &Path| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue