mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 05:25:37 +03:00
Avoid cloning deps
This commit is contained in:
@@ -195,7 +195,10 @@ pub fn parse_with_proc_macros(
|
||||
let prev = crates.insert(crate_name.clone(), crate_id);
|
||||
assert!(prev.is_none(), "multiple crates with same name: {}", crate_name);
|
||||
for dep in meta.deps {
|
||||
let prelude = meta.extern_prelude.contains(&dep);
|
||||
let prelude = match &meta.extern_prelude {
|
||||
Some(v) => v.contains(&dep),
|
||||
None => true,
|
||||
};
|
||||
let dep = CrateName::normalize_dashes(&dep);
|
||||
crate_deps.push((crate_name.clone(), dep, prelude))
|
||||
}
|
||||
@@ -443,7 +446,7 @@ struct FileMeta {
|
||||
path: String,
|
||||
krate: Option<(String, CrateOrigin, Option<String>)>,
|
||||
deps: Vec<String>,
|
||||
extern_prelude: Vec<String>,
|
||||
extern_prelude: Option<Vec<String>>,
|
||||
cfg: CfgOptions,
|
||||
edition: Edition,
|
||||
env: Env,
|
||||
@@ -473,7 +476,7 @@ fn from_fixture(f: Fixture, current_source_root_kind: SourceRootKind) -> Self {
|
||||
Self {
|
||||
path: f.path,
|
||||
krate: f.krate.map(|it| parse_crate(it, current_source_root_kind, f.library)),
|
||||
extern_prelude: f.extern_prelude.unwrap_or_else(|| deps.clone()),
|
||||
extern_prelude: f.extern_prelude,
|
||||
deps,
|
||||
cfg,
|
||||
edition: f.edition.map_or(Edition::CURRENT, |v| Edition::from_str(&v).unwrap()),
|
||||
|
||||
Reference in New Issue
Block a user