support non-extern-prelude dependencies

This commit is contained in:
Jonas Schievink 2021-09-28 21:23:46 +02:00
parent cd9f27d424
commit 0b76b29512
9 changed files with 205 additions and 55 deletions

View file

@ -5,7 +5,9 @@
use std::{collections::VecDeque, convert::TryFrom, fmt, fs, process::Command};
use anyhow::{format_err, Context, Result};
use base_db::{CrateDisplayName, CrateGraph, CrateId, CrateName, Edition, Env, FileId, ProcMacro};
use base_db::{
CrateDisplayName, CrateGraph, CrateId, CrateName, Dependency, Edition, Env, FileId, ProcMacro,
};
use cfg::{CfgDiff, CfgOptions};
use paths::{AbsPath, AbsPathBuf};
use rustc_hash::{FxHashMap, FxHashSet};
@ -875,7 +877,7 @@ fn sysroot_to_crate_graph(
}
fn add_dep(graph: &mut CrateGraph, from: CrateId, name: CrateName, to: CrateId) {
if let Err(err) = graph.add_dep(from, name, to) {
if let Err(err) = graph.add_dep(from, Dependency::new(name, to)) {
tracing::error!("{}", err)
}
}