use slightly more idiomatic api for cfg

This commit is contained in:
Aleksey Kladov 2019-10-08 14:22:49 +03:00
parent 93199002af
commit 355419d404
7 changed files with 59 additions and 40 deletions

View file

@ -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| {