Deduplicate crates when extending crate graphs

This commit is contained in:
Lukas Wirth 2023-04-26 10:20:59 +02:00
parent 943d2a8a1c
commit 968850d7bf
8 changed files with 20835 additions and 1519 deletions

View File

@ -9,7 +9,7 @@
use std::{fmt, mem, ops, panic::RefUnwindSafe, str::FromStr, sync::Arc};
use cfg::CfgOptions;
use la_arena::{Arena, Idx, RawIdx};
use la_arena::{Arena, Idx};
use rustc_hash::{FxHashMap, FxHashSet};
use syntax::SmolStr;
use tt::token_id::Subtree;
@ -534,28 +534,46 @@ pub fn crate_id_for_crate_root(&self, file_id: FileId) -> Option<CrateId> {
Some(crate_id)
}
pub fn sort_deps(&mut self) {
self.arena
.iter_mut()
.for_each(|(_, data)| data.dependencies.sort_by_key(|dep| dep.crate_id));
}
/// Extends this crate graph by adding a complete disjoint second crate
/// graph and adjust the ids in the [`ProcMacroPaths`] accordingly.
///
/// The ids of the crates in the `other` graph are shifted by the return
/// amount.
pub fn extend(&mut self, other: CrateGraph, proc_macros: &mut ProcMacroPaths) -> u32 {
let start = self.arena.len() as u32;
self.arena.extend(other.arena.into_iter().map(|(_, mut data)| {
for dep in &mut data.dependencies {
dep.crate_id =
CrateId::from_raw(RawIdx::from(u32::from(dep.crate_id.into_raw()) + start));
}
data
}));
/// This will deduplicate the crates of the graph where possible.
/// Note that for deduplication to fully work, `self`'s crate dependencies must be sorted by crate id.
/// If the crate dependencies were sorted, the resulting graph from this `extend` call will also have the crate dependencies sorted.
pub fn extend(&mut self, mut other: CrateGraph, proc_macros: &mut ProcMacroPaths) {
let topo = other.crates_in_topological_order();
let mut id_map: FxHashMap<CrateId, CrateId> = FxHashMap::default();
*proc_macros = mem::take(proc_macros)
.into_iter()
.map(|(id, macros)| {
(CrateId::from_raw(RawIdx::from(u32::from(id.into_raw()) + start)), macros)
})
.collect();
start
for topo in topo {
let crate_data = &mut other.arena[topo];
crate_data.dependencies.iter_mut().for_each(|dep| dep.crate_id = id_map[&dep.crate_id]);
crate_data.dependencies.sort_by_key(|dep| dep.crate_id);
let res = self.arena.iter().find_map(
|(id, data)| {
if data == crate_data {
Some(id)
} else {
None
}
},
);
if let Some(res) = res {
id_map.insert(topo, res);
} else {
let id = self.arena.alloc(crate_data.clone());
id_map.insert(topo, id);
}
}
*proc_macros =
mem::take(proc_macros).into_iter().map(|(id, macros)| (id_map[&id], macros)).collect();
}
fn find_path(
@ -586,8 +604,10 @@ fn find_path(
// Work around for https://github.com/rust-lang/rust-analyzer/issues/6038.
// As hacky as it gets.
pub fn patch_cfg_if(&mut self) -> bool {
let cfg_if = self.hacky_find_crate("cfg_if");
let std = self.hacky_find_crate("std");
// we stupidly max by version in an attempt to have all duplicated std's depend on the same cfg_if so that deduplication still works
let cfg_if =
self.hacky_find_crate("cfg_if").max_by_key(|&it| self.arena[it].version.clone());
let std = self.hacky_find_crate("std").next();
match (cfg_if, std) {
(Some(cfg_if), Some(std)) => {
self.arena[cfg_if].dependencies.clear();
@ -600,8 +620,8 @@ pub fn patch_cfg_if(&mut self) -> bool {
}
}
fn hacky_find_crate(&self, display_name: &str) -> Option<CrateId> {
self.iter().find(|it| self[*it].display_name.as_deref() == Some(display_name))
fn hacky_find_crate<'a>(&'a self, display_name: &'a str) -> impl Iterator<Item = CrateId> + 'a {
self.iter().filter(move |it| self[*it].display_name.as_deref() == Some(display_name))
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,344 @@
{
0: CrateData {
root_file_id: FileId(
1,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"hello_world",
),
canonical_name: "hello-world",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
"test",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
1: CrateData {
root_file_id: FileId(
2,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"hello_world",
),
canonical_name: "hello-world",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
"test",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(0),
name: CrateName(
"hello_world",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
2: CrateData {
root_file_id: FileId(
3,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"an_example",
),
canonical_name: "an-example",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
"test",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(0),
name: CrateName(
"hello_world",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
3: CrateData {
root_file_id: FileId(
4,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"it",
),
canonical_name: "it",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
"test",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(0),
name: CrateName(
"hello_world",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
4: CrateData {
root_file_id: FileId(
5,
),
edition: Edition2015,
version: Some(
"0.2.98",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"libc",
),
canonical_name: "libc",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
"feature=default",
"feature=std",
],
),
potential_cfg_options: Some(
CfgOptions(
[
"debug_assertions",
"feature=align",
"feature=const-extern-fn",
"feature=default",
"feature=extra_traits",
"feature=rustc-dep-of-std",
"feature=std",
"feature=use_std",
],
),
),
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.98",
"CARGO_PKG_VERSION": "0.2.98",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "libc",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "libc",
"CARGO_PKG_VERSION_PATCH": "98",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "2",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [],
origin: Library {
repo: Some(
"https://github.com/rust-lang/libc",
),
name: "libc",
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
}

View File

@ -0,0 +1,344 @@
{
0: CrateData {
root_file_id: FileId(
1,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"hello_world",
),
canonical_name: "hello-world",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
"test",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
1: CrateData {
root_file_id: FileId(
2,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"hello_world",
),
canonical_name: "hello-world",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
"test",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(0),
name: CrateName(
"hello_world",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
2: CrateData {
root_file_id: FileId(
3,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"an_example",
),
canonical_name: "an-example",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
"test",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(0),
name: CrateName(
"hello_world",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
3: CrateData {
root_file_id: FileId(
4,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"it",
),
canonical_name: "it",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
"test",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(0),
name: CrateName(
"hello_world",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
4: CrateData {
root_file_id: FileId(
5,
),
edition: Edition2015,
version: Some(
"0.2.98",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"libc",
),
canonical_name: "libc",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
"feature=default",
"feature=std",
],
),
potential_cfg_options: Some(
CfgOptions(
[
"debug_assertions",
"feature=align",
"feature=const-extern-fn",
"feature=default",
"feature=extra_traits",
"feature=rustc-dep-of-std",
"feature=std",
"feature=use_std",
],
),
),
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.98",
"CARGO_PKG_VERSION": "0.2.98",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "libc",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "libc",
"CARGO_PKG_VERSION_PATCH": "98",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "2",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [],
origin: Library {
repo: Some(
"https://github.com/rust-lang/libc",
),
name: "libc",
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
}

View File

@ -0,0 +1,340 @@
{
0: CrateData {
root_file_id: FileId(
1,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"hello_world",
),
canonical_name: "hello-world",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
1: CrateData {
root_file_id: FileId(
2,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"hello_world",
),
canonical_name: "hello-world",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(0),
name: CrateName(
"hello_world",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
2: CrateData {
root_file_id: FileId(
3,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"an_example",
),
canonical_name: "an-example",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(0),
name: CrateName(
"hello_world",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
3: CrateData {
root_file_id: FileId(
4,
),
edition: Edition2018,
version: Some(
"0.1.0",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"it",
),
canonical_name: "it",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
],
),
potential_cfg_options: None,
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$hello-world",
"CARGO_PKG_VERSION": "0.1.0",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "hello_world",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "hello-world",
"CARGO_PKG_VERSION_PATCH": "0",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "1",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(0),
name: CrateName(
"hello_world",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"libc",
),
prelude: true,
},
],
origin: Local {
repo: None,
name: Some(
"hello-world",
),
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
4: CrateData {
root_file_id: FileId(
5,
),
edition: Edition2015,
version: Some(
"0.2.98",
),
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"libc",
),
canonical_name: "libc",
},
),
cfg_options: CfgOptions(
[
"debug_assertions",
"feature=default",
"feature=std",
],
),
potential_cfg_options: Some(
CfgOptions(
[
"debug_assertions",
"feature=align",
"feature=const-extern-fn",
"feature=default",
"feature=extra_traits",
"feature=rustc-dep-of-std",
"feature=std",
"feature=use_std",
],
),
),
env: Env {
entries: {
"CARGO_PKG_LICENSE": "",
"CARGO_PKG_VERSION_MAJOR": "0",
"CARGO_MANIFEST_DIR": "$ROOT$.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.98",
"CARGO_PKG_VERSION": "0.2.98",
"CARGO_PKG_AUTHORS": "",
"CARGO_CRATE_NAME": "libc",
"CARGO_PKG_LICENSE_FILE": "",
"CARGO_PKG_HOMEPAGE": "",
"CARGO_PKG_DESCRIPTION": "",
"CARGO_PKG_NAME": "libc",
"CARGO_PKG_VERSION_PATCH": "98",
"CARGO": "cargo",
"CARGO_PKG_REPOSITORY": "",
"CARGO_PKG_VERSION_MINOR": "2",
"CARGO_PKG_VERSION_PRE": "",
},
},
dependencies: [],
origin: Library {
repo: Some(
"https://github.com/rust-lang/libc",
),
name: "libc",
},
is_proc_macro: false,
target_layout: Err(
"target_data_layout not loaded",
),
channel: None,
},
}

View File

@ -0,0 +1,462 @@
{
0: CrateData {
root_file_id: FileId(
1,
),
edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"alloc",
),
canonical_name: "alloc",
},
),
cfg_options: CfgOptions(
[],
),
potential_cfg_options: None,
env: Env {
entries: {},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(1),
name: CrateName(
"core",
),
prelude: true,
},
],
origin: Lang(
Alloc,
),
is_proc_macro: false,
target_layout: Err(
"rust-project.json projects have no target layout set",
),
channel: None,
},
1: CrateData {
root_file_id: FileId(
2,
),
edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"core",
),
canonical_name: "core",
},
),
cfg_options: CfgOptions(
[],
),
potential_cfg_options: None,
env: Env {
entries: {},
},
dependencies: [],
origin: Lang(
Core,
),
is_proc_macro: false,
target_layout: Err(
"rust-project.json projects have no target layout set",
),
channel: None,
},
2: CrateData {
root_file_id: FileId(
3,
),
edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"panic_abort",
),
canonical_name: "panic_abort",
},
),
cfg_options: CfgOptions(
[],
),
potential_cfg_options: None,
env: Env {
entries: {},
},
dependencies: [],
origin: Lang(
Other,
),
is_proc_macro: false,
target_layout: Err(
"rust-project.json projects have no target layout set",
),
channel: None,
},
3: CrateData {
root_file_id: FileId(
4,
),
edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"panic_unwind",
),
canonical_name: "panic_unwind",
},
),
cfg_options: CfgOptions(
[],
),
potential_cfg_options: None,
env: Env {
entries: {},
},
dependencies: [],
origin: Lang(
Other,
),
is_proc_macro: false,
target_layout: Err(
"rust-project.json projects have no target layout set",
),
channel: None,
},
4: CrateData {
root_file_id: FileId(
5,
),
edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"proc_macro",
),
canonical_name: "proc_macro",
},
),
cfg_options: CfgOptions(
[],
),
potential_cfg_options: None,
env: Env {
entries: {},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(6),
name: CrateName(
"std",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(1),
name: CrateName(
"core",
),
prelude: true,
},
],
origin: Lang(
Other,
),
is_proc_macro: false,
target_layout: Err(
"rust-project.json projects have no target layout set",
),
channel: None,
},
5: CrateData {
root_file_id: FileId(
6,
),
edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"profiler_builtins",
),
canonical_name: "profiler_builtins",
},
),
cfg_options: CfgOptions(
[],
),
potential_cfg_options: None,
env: Env {
entries: {},
},
dependencies: [],
origin: Lang(
Other,
),
is_proc_macro: false,
target_layout: Err(
"rust-project.json projects have no target layout set",
),
channel: None,
},
6: CrateData {
root_file_id: FileId(
7,
),
edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"std",
),
canonical_name: "std",
},
),
cfg_options: CfgOptions(
[],
),
potential_cfg_options: None,
env: Env {
entries: {},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(0),
name: CrateName(
"alloc",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(3),
name: CrateName(
"panic_unwind",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(2),
name: CrateName(
"panic_abort",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(1),
name: CrateName(
"core",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(5),
name: CrateName(
"profiler_builtins",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(9),
name: CrateName(
"unwind",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(7),
name: CrateName(
"std_detect",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(8),
name: CrateName(
"test",
),
prelude: true,
},
],
origin: Lang(
Std,
),
is_proc_macro: false,
target_layout: Err(
"rust-project.json projects have no target layout set",
),
channel: None,
},
7: CrateData {
root_file_id: FileId(
8,
),
edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"std_detect",
),
canonical_name: "std_detect",
},
),
cfg_options: CfgOptions(
[],
),
potential_cfg_options: None,
env: Env {
entries: {},
},
dependencies: [],
origin: Lang(
Other,
),
is_proc_macro: false,
target_layout: Err(
"rust-project.json projects have no target layout set",
),
channel: None,
},
8: CrateData {
root_file_id: FileId(
9,
),
edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"test",
),
canonical_name: "test",
},
),
cfg_options: CfgOptions(
[],
),
potential_cfg_options: None,
env: Env {
entries: {},
},
dependencies: [],
origin: Lang(
Test,
),
is_proc_macro: false,
target_layout: Err(
"rust-project.json projects have no target layout set",
),
channel: None,
},
9: CrateData {
root_file_id: FileId(
10,
),
edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"unwind",
),
canonical_name: "unwind",
},
),
cfg_options: CfgOptions(
[],
),
potential_cfg_options: None,
env: Env {
entries: {},
},
dependencies: [],
origin: Lang(
Other,
),
is_proc_macro: false,
target_layout: Err(
"rust-project.json projects have no target layout set",
),
channel: None,
},
10: CrateData {
root_file_id: FileId(
11,
),
edition: Edition2018,
version: None,
display_name: Some(
CrateDisplayName {
crate_name: CrateName(
"hello_world",
),
canonical_name: "hello_world",
},
),
cfg_options: CfgOptions(
[],
),
potential_cfg_options: None,
env: Env {
entries: {},
},
dependencies: [
Dependency {
crate_id: Idx::<CrateData>(1),
name: CrateName(
"core",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(0),
name: CrateName(
"alloc",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(6),
name: CrateName(
"std",
),
prelude: true,
},
Dependency {
crate_id: Idx::<CrateData>(8),
name: CrateName(
"test",
),
prelude: false,
},
Dependency {
crate_id: Idx::<CrateData>(4),
name: CrateName(
"proc_macro",
),
prelude: false,
},
],
origin: Local {
repo: None,
name: Some(
"hello_world",
),
},
is_proc_macro: false,
target_layout: Err(
"rust-project.json projects have no target layout set",
),
channel: None,
},
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff