mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 11:20:54 +00:00
Merge pull request #19096 from darichey/rust-project-sysroot
Allow rust-project.json to specify sysroot workspace
This commit is contained in:
commit
e50bc18182
@ -262,7 +262,7 @@ fn parse_cfg(s: &str) -> Result<cfg::CfgAtom, String> {
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum RustSourceWorkspaceConfig {
|
||||
CargoMetadata(CargoMetadataConfig),
|
||||
Stitched,
|
||||
Json(ProjectJson),
|
||||
}
|
||||
|
||||
impl Default for RustSourceWorkspaceConfig {
|
||||
|
@ -65,6 +65,8 @@ pub struct ProjectJson {
|
||||
pub(crate) sysroot: Option<AbsPathBuf>,
|
||||
/// e.g. `path/to/sysroot/lib/rustlib/src/rust/library`
|
||||
pub(crate) sysroot_src: Option<AbsPathBuf>,
|
||||
/// A nested project describing the layout of the sysroot
|
||||
pub(crate) sysroot_project: Option<Box<ProjectJson>>,
|
||||
project_root: AbsPathBuf,
|
||||
/// The path to the rust-project.json file. May be None if this
|
||||
/// data was generated by the discoverConfig command.
|
||||
@ -91,9 +93,16 @@ impl ProjectJson {
|
||||
data: ProjectJsonData,
|
||||
) -> ProjectJson {
|
||||
let absolutize_on_base = |p| base.absolutize(p);
|
||||
let sysroot_src = data.sysroot_src.map(absolutize_on_base);
|
||||
let sysroot_project =
|
||||
data.sysroot_project.zip(sysroot_src.clone()).map(|(sysroot_data, sysroot_src)| {
|
||||
Box::new(ProjectJson::new(None, &sysroot_src, *sysroot_data))
|
||||
});
|
||||
|
||||
ProjectJson {
|
||||
sysroot: data.sysroot.map(absolutize_on_base),
|
||||
sysroot_src: data.sysroot_src.map(absolutize_on_base),
|
||||
sysroot_src,
|
||||
sysroot_project,
|
||||
project_root: base.to_path_buf(),
|
||||
manifest,
|
||||
runnables: data.runnables.into_iter().map(Runnable::from).collect(),
|
||||
@ -330,6 +339,7 @@ pub enum RunnableKind {
|
||||
pub struct ProjectJsonData {
|
||||
sysroot: Option<Utf8PathBuf>,
|
||||
sysroot_src: Option<Utf8PathBuf>,
|
||||
sysroot_project: Option<Box<ProjectJsonData>>,
|
||||
#[serde(default)]
|
||||
cfg_groups: FxHashMap<String, CfgList>,
|
||||
crates: Vec<CrateData>,
|
||||
|
@ -4,24 +4,17 @@
|
||||
//! but we can't process `.rlib` and need source code instead. The source code
|
||||
//! is typically installed with `rustup component add rust-src` command.
|
||||
|
||||
use std::{
|
||||
env, fs,
|
||||
ops::{self, Not},
|
||||
path::Path,
|
||||
process::Command,
|
||||
};
|
||||
use std::{env, fs, ops::Not, path::Path, process::Command};
|
||||
|
||||
use anyhow::{format_err, Result};
|
||||
use base_db::CrateName;
|
||||
use itertools::Itertools;
|
||||
use la_arena::{Arena, Idx};
|
||||
use paths::{AbsPath, AbsPathBuf, Utf8PathBuf};
|
||||
use rustc_hash::FxHashMap;
|
||||
use stdx::format_to;
|
||||
use toolchain::{probe_for_binary, Tool};
|
||||
|
||||
use crate::{
|
||||
cargo_workspace::CargoMetadataConfig, utf8_stdout, CargoWorkspace, ManifestPath,
|
||||
cargo_workspace::CargoMetadataConfig, utf8_stdout, CargoWorkspace, ManifestPath, ProjectJson,
|
||||
RustSourceWorkspaceConfig,
|
||||
};
|
||||
|
||||
@ -36,58 +29,10 @@ pub struct Sysroot {
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub enum RustLibSrcWorkspace {
|
||||
Workspace(CargoWorkspace),
|
||||
Stitched(Stitched),
|
||||
Json(ProjectJson),
|
||||
Empty,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct Stitched {
|
||||
crates: Arena<RustLibSrcCrateData>,
|
||||
}
|
||||
|
||||
impl ops::Index<RustLibSrcCrate> for Stitched {
|
||||
type Output = RustLibSrcCrateData;
|
||||
fn index(&self, index: RustLibSrcCrate) -> &RustLibSrcCrateData {
|
||||
&self.crates[index]
|
||||
}
|
||||
}
|
||||
|
||||
impl Stitched {
|
||||
pub(crate) fn public_deps(
|
||||
&self,
|
||||
) -> impl Iterator<Item = (CrateName, RustLibSrcCrate, bool)> + '_ {
|
||||
// core is added as a dependency before std in order to
|
||||
// mimic rustcs dependency order
|
||||
[("core", true), ("alloc", false), ("std", true), ("test", false)].into_iter().filter_map(
|
||||
move |(name, prelude)| {
|
||||
Some((CrateName::new(name).unwrap(), self.by_name(name)?, prelude))
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn proc_macro(&self) -> Option<RustLibSrcCrate> {
|
||||
self.by_name("proc_macro")
|
||||
}
|
||||
|
||||
pub(crate) fn crates(&self) -> impl ExactSizeIterator<Item = RustLibSrcCrate> + '_ {
|
||||
self.crates.iter().map(|(id, _data)| id)
|
||||
}
|
||||
|
||||
fn by_name(&self, name: &str) -> Option<RustLibSrcCrate> {
|
||||
let (id, _data) = self.crates.iter().find(|(_id, data)| data.name == name)?;
|
||||
Some(id)
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) type RustLibSrcCrate = Idx<RustLibSrcCrateData>;
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub(crate) struct RustLibSrcCrateData {
|
||||
pub(crate) name: String,
|
||||
pub(crate) root: ManifestPath,
|
||||
pub(crate) deps: Vec<RustLibSrcCrate>,
|
||||
}
|
||||
|
||||
impl Sysroot {
|
||||
pub const fn empty() -> Sysroot {
|
||||
Sysroot {
|
||||
@ -114,7 +59,7 @@ impl Sysroot {
|
||||
pub fn is_rust_lib_src_empty(&self) -> bool {
|
||||
match &self.workspace {
|
||||
RustLibSrcWorkspace::Workspace(ws) => ws.packages().next().is_none(),
|
||||
RustLibSrcWorkspace::Stitched(stitched) => stitched.crates.is_empty(),
|
||||
RustLibSrcWorkspace::Json(project_json) => project_json.n_crates() == 0,
|
||||
RustLibSrcWorkspace::Empty => true,
|
||||
}
|
||||
}
|
||||
@ -126,7 +71,7 @@ impl Sysroot {
|
||||
pub fn num_packages(&self) -> usize {
|
||||
match &self.workspace {
|
||||
RustLibSrcWorkspace::Workspace(ws) => ws.packages().count(),
|
||||
RustLibSrcWorkspace::Stitched(c) => c.crates().count(),
|
||||
RustLibSrcWorkspace::Json(project_json) => project_json.n_crates(),
|
||||
RustLibSrcWorkspace::Empty => 0,
|
||||
}
|
||||
}
|
||||
@ -252,52 +197,11 @@ impl Sysroot {
|
||||
return Some(loaded);
|
||||
}
|
||||
}
|
||||
}
|
||||
tracing::debug!("Stitching sysroot library: {src_root}");
|
||||
|
||||
let mut stitched = Stitched { crates: Arena::default() };
|
||||
|
||||
for path in SYSROOT_CRATES.trim().lines() {
|
||||
let name = path.split('/').last().unwrap();
|
||||
let root = [format!("{path}/src/lib.rs"), format!("lib{path}/lib.rs")]
|
||||
.into_iter()
|
||||
.map(|it| src_root.join(it))
|
||||
.filter_map(|it| ManifestPath::try_from(it).ok())
|
||||
.find(|it| fs::metadata(it).is_ok());
|
||||
|
||||
if let Some(root) = root {
|
||||
stitched.crates.alloc(RustLibSrcCrateData {
|
||||
name: name.into(),
|
||||
root,
|
||||
deps: Vec::new(),
|
||||
});
|
||||
}
|
||||
} else if let RustSourceWorkspaceConfig::Json(project_json) = sysroot_source_config {
|
||||
return Some(RustLibSrcWorkspace::Json(project_json.clone()));
|
||||
}
|
||||
|
||||
if let Some(std) = stitched.by_name("std") {
|
||||
for dep in STD_DEPS.trim().lines() {
|
||||
if let Some(dep) = stitched.by_name(dep) {
|
||||
stitched.crates[std].deps.push(dep)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(alloc) = stitched.by_name("alloc") {
|
||||
for dep in ALLOC_DEPS.trim().lines() {
|
||||
if let Some(dep) = stitched.by_name(dep) {
|
||||
stitched.crates[alloc].deps.push(dep)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(proc_macro) = stitched.by_name("proc_macro") {
|
||||
for dep in PROC_MACRO_DEPS.trim().lines() {
|
||||
if let Some(dep) = stitched.by_name(dep) {
|
||||
stitched.crates[proc_macro].deps.push(dep)
|
||||
}
|
||||
}
|
||||
}
|
||||
Some(RustLibSrcWorkspace::Stitched(stitched))
|
||||
None
|
||||
}
|
||||
|
||||
pub fn set_workspace(&mut self, workspace: RustLibSrcWorkspace) {
|
||||
@ -308,7 +212,10 @@ impl Sysroot {
|
||||
RustLibSrcWorkspace::Workspace(ws) => {
|
||||
ws.packages().any(|p| ws[p].name == "core")
|
||||
}
|
||||
RustLibSrcWorkspace::Stitched(stitched) => stitched.by_name("core").is_some(),
|
||||
RustLibSrcWorkspace::Json(project_json) => project_json
|
||||
.crates()
|
||||
.filter_map(|(_, krate)| krate.display_name.clone())
|
||||
.any(|name| name.canonical_name().as_str() == "core"),
|
||||
RustLibSrcWorkspace::Empty => true,
|
||||
};
|
||||
if !has_core {
|
||||
@ -484,33 +391,3 @@ fn get_rust_lib_src(sysroot_path: &AbsPath) -> Option<AbsPathBuf> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
const SYSROOT_CRATES: &str = "
|
||||
alloc
|
||||
backtrace
|
||||
core
|
||||
panic_abort
|
||||
panic_unwind
|
||||
proc_macro
|
||||
profiler_builtins
|
||||
std
|
||||
stdarch/crates/std_detect
|
||||
test
|
||||
unwind";
|
||||
|
||||
const ALLOC_DEPS: &str = "core";
|
||||
|
||||
const STD_DEPS: &str = "
|
||||
alloc
|
||||
panic_unwind
|
||||
panic_abort
|
||||
core
|
||||
profiler_builtins
|
||||
unwind
|
||||
std_detect
|
||||
test";
|
||||
|
||||
// core is required for our builtin derives to work in the proc_macro lib currently
|
||||
const PROC_MACRO_DEPS: &str = "
|
||||
std
|
||||
core";
|
||||
|
@ -1,5 +1,3 @@
|
||||
use std::ops::Deref;
|
||||
|
||||
use base_db::{CrateGraph, ProcMacroPaths};
|
||||
use cargo_metadata::Metadata;
|
||||
use cfg::{CfgAtom, CfgDiff};
|
||||
@ -225,18 +223,6 @@ fn rust_project_cfg_groups() {
|
||||
check_crate_graph(crate_graph, expect_file!["../test_data/output/rust_project_cfg_groups.txt"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rust_project_is_proc_macro_has_proc_macro_dep() {
|
||||
let (crate_graph, _proc_macros) = load_rust_project("is-proc-macro-project.json");
|
||||
// Since the project only defines one crate (outside the sysroot crates),
|
||||
// it should be the one with the biggest Id.
|
||||
let crate_id = crate_graph.iter().max().unwrap();
|
||||
let crate_data = &crate_graph[crate_id];
|
||||
// Assert that the project crate with `is_proc_macro` has a dependency
|
||||
// on the proc_macro sysroot crate.
|
||||
crate_data.dependencies.iter().find(|&dep| *dep.name.deref() == sym::proc_macro).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn crate_graph_dedup_identical() {
|
||||
let (mut crate_graph, proc_macros) = load_cargo("regex-metadata.json");
|
||||
|
@ -23,7 +23,7 @@ use crate::{
|
||||
cargo_workspace::{CargoMetadataConfig, DepKind, PackageData, RustLibSource},
|
||||
env::{cargo_config_env, inject_cargo_env, inject_cargo_package_env, inject_rustc_tool_env},
|
||||
project_json::{Crate, CrateArrayIdx},
|
||||
sysroot::{RustLibSrcCrate, RustLibSrcWorkspace},
|
||||
sysroot::RustLibSrcWorkspace,
|
||||
toolchain_info::{rustc_cfg, target_data_layout, target_tuple, version, QueryConfig},
|
||||
CargoConfig, CargoWorkspace, CfgOverrides, InvocationStrategy, ManifestPath, Package,
|
||||
ProjectJson, ProjectManifest, RustSourceWorkspaceConfig, Sysroot, TargetData, TargetKind,
|
||||
@ -69,6 +69,7 @@ pub struct ProjectWorkspace {
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub enum ProjectWorkspaceKind {
|
||||
/// Project workspace was discovered by running `cargo metadata` and `rustc --print sysroot`.
|
||||
Cargo {
|
||||
@ -400,20 +401,17 @@ impl ProjectWorkspace {
|
||||
}
|
||||
|
||||
pub fn load_inline(
|
||||
project_json: ProjectJson,
|
||||
mut project_json: ProjectJson,
|
||||
config: &CargoConfig,
|
||||
progress: &dyn Fn(String),
|
||||
) -> ProjectWorkspace {
|
||||
progress("Discovering sysroot".to_owned());
|
||||
let mut sysroot =
|
||||
Sysroot::new(project_json.sysroot.clone(), project_json.sysroot_src.clone());
|
||||
let loaded_sysroot = sysroot.load_workspace(&RustSourceWorkspaceConfig::Stitched);
|
||||
if let Some(loaded_sysroot) = loaded_sysroot {
|
||||
sysroot.set_workspace(loaded_sysroot);
|
||||
}
|
||||
|
||||
tracing::info!(workspace = %project_json.manifest_or_root(), src_root = ?sysroot.rust_lib_src_root(), root = ?sysroot.root(), "Using sysroot");
|
||||
progress("Querying project metadata".to_owned());
|
||||
let sysroot_project = project_json.sysroot_project.take();
|
||||
let query_config = QueryConfig::Rustc(&sysroot, project_json.path().as_ref());
|
||||
let targets = target_tuple::get(query_config, config.target.as_deref(), &config.extra_env)
|
||||
.unwrap_or_default();
|
||||
@ -435,14 +433,33 @@ impl ProjectWorkspace {
|
||||
&config.extra_env,
|
||||
)
|
||||
});
|
||||
thread::Result::Ok((toolchain.join()?, rustc_cfg.join()?, data_layout.join()?))
|
||||
let loaded_sysroot = s.spawn(|| {
|
||||
if let Some(sysroot_project) = sysroot_project {
|
||||
sysroot.load_workspace(&RustSourceWorkspaceConfig::Json(*sysroot_project))
|
||||
} else {
|
||||
sysroot.load_workspace(&RustSourceWorkspaceConfig::CargoMetadata(
|
||||
sysroot_metadata_config(&config.extra_env, &targets),
|
||||
))
|
||||
}
|
||||
});
|
||||
|
||||
thread::Result::Ok((
|
||||
toolchain.join()?,
|
||||
rustc_cfg.join()?,
|
||||
data_layout.join()?,
|
||||
loaded_sysroot.join()?,
|
||||
))
|
||||
});
|
||||
|
||||
let (toolchain, rustc_cfg, target_layout) = match join {
|
||||
let (toolchain, rustc_cfg, target_layout, loaded_sysroot) = match join {
|
||||
Ok(it) => it,
|
||||
Err(e) => std::panic::resume_unwind(e),
|
||||
};
|
||||
|
||||
if let Some(loaded_sysroot) = loaded_sysroot {
|
||||
sysroot.set_workspace(loaded_sysroot);
|
||||
}
|
||||
|
||||
ProjectWorkspace {
|
||||
kind: ProjectWorkspaceKind::Json(project_json),
|
||||
sysroot,
|
||||
@ -667,7 +684,15 @@ impl ProjectWorkspace {
|
||||
Some(PackageRoot { is_local: false, include, exclude })
|
||||
})
|
||||
.collect(),
|
||||
RustLibSrcWorkspace::Stitched(_) | RustLibSrcWorkspace::Empty => vec![],
|
||||
RustLibSrcWorkspace::Json(project_json) => project_json
|
||||
.crates()
|
||||
.map(|(_, krate)| PackageRoot {
|
||||
is_local: false,
|
||||
include: krate.include.clone(),
|
||||
exclude: krate.exclude.clone(),
|
||||
})
|
||||
.collect(),
|
||||
RustLibSrcWorkspace::Empty => vec![],
|
||||
};
|
||||
|
||||
r.push(PackageRoot {
|
||||
@ -1490,6 +1515,65 @@ impl SysrootPublicDeps {
|
||||
}
|
||||
}
|
||||
|
||||
fn extend_crate_graph_with_sysroot(
|
||||
crate_graph: &mut CrateGraph,
|
||||
mut sysroot_crate_graph: CrateGraph,
|
||||
mut sysroot_proc_macros: ProcMacroPaths,
|
||||
) -> (SysrootPublicDeps, Option<CrateId>) {
|
||||
let mut pub_deps = vec![];
|
||||
let mut libproc_macro = None;
|
||||
let diff = CfgDiff::new(vec![], vec![CfgAtom::Flag(sym::test.clone())]).unwrap();
|
||||
for (cid, c) in sysroot_crate_graph.iter_mut() {
|
||||
// uninject `test` flag so `core` keeps working.
|
||||
Arc::make_mut(&mut c.cfg_options).apply_diff(diff.clone());
|
||||
// patch the origin
|
||||
if c.origin.is_local() {
|
||||
let lang_crate = LangCrateOrigin::from(
|
||||
c.display_name.as_ref().map_or("", |it| it.canonical_name().as_str()),
|
||||
);
|
||||
c.origin = CrateOrigin::Lang(lang_crate);
|
||||
match lang_crate {
|
||||
LangCrateOrigin::Test
|
||||
| LangCrateOrigin::Alloc
|
||||
| LangCrateOrigin::Core
|
||||
| LangCrateOrigin::Std => pub_deps.push((
|
||||
CrateName::normalize_dashes(&lang_crate.to_string()),
|
||||
cid,
|
||||
!matches!(lang_crate, LangCrateOrigin::Test | LangCrateOrigin::Alloc),
|
||||
)),
|
||||
LangCrateOrigin::ProcMacro => libproc_macro = Some(cid),
|
||||
LangCrateOrigin::Other => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut marker_set = vec![];
|
||||
for &(_, cid, _) in pub_deps.iter() {
|
||||
marker_set.extend(sysroot_crate_graph.transitive_deps(cid));
|
||||
}
|
||||
if let Some(cid) = libproc_macro {
|
||||
marker_set.extend(sysroot_crate_graph.transitive_deps(cid));
|
||||
}
|
||||
|
||||
marker_set.sort();
|
||||
marker_set.dedup();
|
||||
|
||||
// Remove all crates except the ones we are interested in to keep the sysroot graph small.
|
||||
let removed_mapping = sysroot_crate_graph.remove_crates_except(&marker_set);
|
||||
let mapping = crate_graph.extend(sysroot_crate_graph, &mut sysroot_proc_macros);
|
||||
|
||||
// Map the id through the removal mapping first, then through the crate graph extension mapping.
|
||||
pub_deps.iter_mut().for_each(|(_, cid, _)| {
|
||||
*cid = mapping[&removed_mapping[cid.into_raw().into_u32() as usize].unwrap()]
|
||||
});
|
||||
if let Some(libproc_macro) = &mut libproc_macro {
|
||||
*libproc_macro =
|
||||
mapping[&removed_mapping[libproc_macro.into_raw().into_u32() as usize].unwrap()];
|
||||
}
|
||||
|
||||
(SysrootPublicDeps { deps: pub_deps }, libproc_macro)
|
||||
}
|
||||
|
||||
fn sysroot_to_crate_graph(
|
||||
crate_graph: &mut CrateGraph,
|
||||
sysroot: &Sysroot,
|
||||
@ -1499,7 +1583,7 @@ fn sysroot_to_crate_graph(
|
||||
let _p = tracing::info_span!("sysroot_to_crate_graph").entered();
|
||||
match sysroot.workspace() {
|
||||
RustLibSrcWorkspace::Workspace(cargo) => {
|
||||
let (mut cg, mut pm) = cargo_to_crate_graph(
|
||||
let (cg, pm) = cargo_to_crate_graph(
|
||||
load,
|
||||
None,
|
||||
cargo,
|
||||
@ -1520,113 +1604,32 @@ fn sysroot_to_crate_graph(
|
||||
false,
|
||||
);
|
||||
|
||||
let mut pub_deps = vec![];
|
||||
let mut libproc_macro = None;
|
||||
let diff = CfgDiff::new(vec![], vec![CfgAtom::Flag(sym::test.clone())]).unwrap();
|
||||
for (cid, c) in cg.iter_mut() {
|
||||
// uninject `test` flag so `core` keeps working.
|
||||
Arc::make_mut(&mut c.cfg_options).apply_diff(diff.clone());
|
||||
// patch the origin
|
||||
if c.origin.is_local() {
|
||||
let lang_crate = LangCrateOrigin::from(
|
||||
c.display_name.as_ref().map_or("", |it| it.canonical_name().as_str()),
|
||||
);
|
||||
c.origin = CrateOrigin::Lang(lang_crate);
|
||||
match lang_crate {
|
||||
LangCrateOrigin::Test
|
||||
| LangCrateOrigin::Alloc
|
||||
| LangCrateOrigin::Core
|
||||
| LangCrateOrigin::Std => pub_deps.push((
|
||||
CrateName::normalize_dashes(&lang_crate.to_string()),
|
||||
cid,
|
||||
!matches!(lang_crate, LangCrateOrigin::Test | LangCrateOrigin::Alloc),
|
||||
)),
|
||||
LangCrateOrigin::ProcMacro => libproc_macro = Some(cid),
|
||||
LangCrateOrigin::Other => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut marker_set = vec![];
|
||||
for &(_, cid, _) in pub_deps.iter() {
|
||||
marker_set.extend(cg.transitive_deps(cid));
|
||||
}
|
||||
if let Some(cid) = libproc_macro {
|
||||
marker_set.extend(cg.transitive_deps(cid));
|
||||
}
|
||||
|
||||
marker_set.sort();
|
||||
marker_set.dedup();
|
||||
|
||||
// Remove all crates except the ones we are interested in to keep the sysroot graph small.
|
||||
let removed_mapping = cg.remove_crates_except(&marker_set);
|
||||
let mapping = crate_graph.extend(cg, &mut pm);
|
||||
|
||||
// Map the id through the removal mapping first, then through the crate graph extension mapping.
|
||||
pub_deps.iter_mut().for_each(|(_, cid, _)| {
|
||||
*cid = mapping[&removed_mapping[cid.into_raw().into_u32() as usize].unwrap()]
|
||||
});
|
||||
if let Some(libproc_macro) = &mut libproc_macro {
|
||||
*libproc_macro = mapping
|
||||
[&removed_mapping[libproc_macro.into_raw().into_u32() as usize].unwrap()];
|
||||
}
|
||||
|
||||
(SysrootPublicDeps { deps: pub_deps }, libproc_macro)
|
||||
extend_crate_graph_with_sysroot(crate_graph, cg, pm)
|
||||
}
|
||||
RustLibSrcWorkspace::Stitched(stitched) => {
|
||||
let cfg_options = Arc::new({
|
||||
let mut cfg_options = CfgOptions::default();
|
||||
cfg_options.extend(rustc_cfg);
|
||||
cfg_options.insert_atom(sym::debug_assertions.clone());
|
||||
cfg_options.insert_atom(sym::miri.clone());
|
||||
cfg_options
|
||||
});
|
||||
let sysroot_crates: FxHashMap<RustLibSrcCrate, CrateId> = stitched
|
||||
.crates()
|
||||
.filter_map(|krate| {
|
||||
let file_id = load(&stitched[krate].root)?;
|
||||
RustLibSrcWorkspace::Json(project_json) => {
|
||||
let (cg, pm) = project_json_to_crate_graph(
|
||||
rustc_cfg,
|
||||
load,
|
||||
project_json,
|
||||
&Sysroot::empty(),
|
||||
&FxHashMap::default(),
|
||||
&CfgOverrides {
|
||||
global: CfgDiff::new(
|
||||
vec![
|
||||
CfgAtom::Flag(sym::debug_assertions.clone()),
|
||||
CfgAtom::Flag(sym::miri.clone()),
|
||||
],
|
||||
vec![],
|
||||
)
|
||||
.unwrap(),
|
||||
..Default::default()
|
||||
},
|
||||
false,
|
||||
);
|
||||
|
||||
let display_name = CrateDisplayName::from_canonical_name(&stitched[krate].name);
|
||||
let crate_id = crate_graph.add_crate_root(
|
||||
file_id,
|
||||
Edition::CURRENT_FIXME,
|
||||
Some(display_name),
|
||||
None,
|
||||
cfg_options.clone(),
|
||||
None,
|
||||
Env::default(),
|
||||
CrateOrigin::Lang(LangCrateOrigin::from(&*stitched[krate].name)),
|
||||
false,
|
||||
None,
|
||||
);
|
||||
Some((krate, crate_id))
|
||||
})
|
||||
.collect();
|
||||
|
||||
for from in stitched.crates() {
|
||||
for &to in stitched[from].deps.iter() {
|
||||
let name = CrateName::new(&stitched[to].name).unwrap();
|
||||
if let (Some(&from), Some(&to)) =
|
||||
(sysroot_crates.get(&from), sysroot_crates.get(&to))
|
||||
{
|
||||
add_dep(crate_graph, from, name, to);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let public_deps = SysrootPublicDeps {
|
||||
deps: stitched
|
||||
.public_deps()
|
||||
.filter_map(|(name, idx, prelude)| {
|
||||
Some((name, *sysroot_crates.get(&idx)?, prelude))
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
};
|
||||
|
||||
let libproc_macro =
|
||||
stitched.proc_macro().and_then(|it| sysroot_crates.get(&it).copied());
|
||||
(public_deps, libproc_macro)
|
||||
extend_crate_graph_with_sysroot(crate_graph, cg, pm)
|
||||
}
|
||||
|
||||
RustLibSrcWorkspace::Empty => (SysrootPublicDeps { deps: vec![] }, None),
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +0,0 @@
|
||||
{
|
||||
"sysroot_src": null,
|
||||
"crates": [
|
||||
{
|
||||
"display_name": "is_proc_macro",
|
||||
"root_module": "$ROOT$src/lib.rs",
|
||||
"edition": "2018",
|
||||
"deps": [],
|
||||
"is_workspace_member": true,
|
||||
"is_proc_macro": true
|
||||
}
|
||||
]
|
||||
}
|
@ -3,417 +3,6 @@
|
||||
root_file_id: FileId(
|
||||
1,
|
||||
),
|
||||
edition: Edition2021,
|
||||
version: None,
|
||||
display_name: Some(
|
||||
CrateDisplayName {
|
||||
crate_name: CrateName(
|
||||
"alloc",
|
||||
),
|
||||
canonical_name: "alloc",
|
||||
},
|
||||
),
|
||||
cfg_options: CfgOptions(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(1),
|
||||
name: CrateName(
|
||||
"core",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
],
|
||||
origin: Lang(
|
||||
Alloc,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Core,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Other,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Other,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(6),
|
||||
name: CrateName(
|
||||
"std",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(1),
|
||||
name: CrateName(
|
||||
"core",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
],
|
||||
origin: Lang(
|
||||
ProcMacro,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Other,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(0),
|
||||
name: CrateName(
|
||||
"alloc",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(3),
|
||||
name: CrateName(
|
||||
"panic_unwind",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(2),
|
||||
name: CrateName(
|
||||
"panic_abort",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(1),
|
||||
name: CrateName(
|
||||
"core",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(5),
|
||||
name: CrateName(
|
||||
"profiler_builtins",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(9),
|
||||
name: CrateName(
|
||||
"unwind",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(7),
|
||||
name: CrateName(
|
||||
"std_detect",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(8),
|
||||
name: CrateName(
|
||||
"test",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
],
|
||||
origin: Lang(
|
||||
Std,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Other,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Test,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Other,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: None,
|
||||
},
|
||||
10: CrateData {
|
||||
root_file_id: FileId(
|
||||
11,
|
||||
),
|
||||
edition: Edition2018,
|
||||
version: None,
|
||||
display_name: Some(
|
||||
@ -438,48 +27,7 @@
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(1),
|
||||
name: CrateName(
|
||||
"core",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(0),
|
||||
name: CrateName(
|
||||
"alloc",
|
||||
),
|
||||
prelude: false,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(6),
|
||||
name: CrateName(
|
||||
"std",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(8),
|
||||
name: CrateName(
|
||||
"test",
|
||||
),
|
||||
prelude: false,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(4),
|
||||
name: CrateName(
|
||||
"proc_macro",
|
||||
),
|
||||
prelude: false,
|
||||
sysroot: true,
|
||||
},
|
||||
],
|
||||
dependencies: [],
|
||||
origin: Local {
|
||||
repo: None,
|
||||
name: Some(
|
||||
@ -489,9 +37,9 @@
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: None,
|
||||
},
|
||||
11: CrateData {
|
||||
1: CrateData {
|
||||
root_file_id: FileId(
|
||||
11,
|
||||
1,
|
||||
),
|
||||
edition: Edition2018,
|
||||
version: None,
|
||||
@ -517,48 +65,7 @@
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(1),
|
||||
name: CrateName(
|
||||
"core",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(0),
|
||||
name: CrateName(
|
||||
"alloc",
|
||||
),
|
||||
prelude: false,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(6),
|
||||
name: CrateName(
|
||||
"std",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(8),
|
||||
name: CrateName(
|
||||
"test",
|
||||
),
|
||||
prelude: false,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(4),
|
||||
name: CrateName(
|
||||
"proc_macro",
|
||||
),
|
||||
prelude: false,
|
||||
sysroot: true,
|
||||
},
|
||||
],
|
||||
dependencies: [],
|
||||
origin: Local {
|
||||
repo: None,
|
||||
name: Some(
|
||||
|
@ -3,417 +3,6 @@
|
||||
root_file_id: FileId(
|
||||
1,
|
||||
),
|
||||
edition: Edition2021,
|
||||
version: None,
|
||||
display_name: Some(
|
||||
CrateDisplayName {
|
||||
crate_name: CrateName(
|
||||
"alloc",
|
||||
),
|
||||
canonical_name: "alloc",
|
||||
},
|
||||
),
|
||||
cfg_options: CfgOptions(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(1),
|
||||
name: CrateName(
|
||||
"core",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
],
|
||||
origin: Lang(
|
||||
Alloc,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Core,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Other,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Other,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(6),
|
||||
name: CrateName(
|
||||
"std",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(1),
|
||||
name: CrateName(
|
||||
"core",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
],
|
||||
origin: Lang(
|
||||
ProcMacro,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Other,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(0),
|
||||
name: CrateName(
|
||||
"alloc",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(3),
|
||||
name: CrateName(
|
||||
"panic_unwind",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(2),
|
||||
name: CrateName(
|
||||
"panic_abort",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(1),
|
||||
name: CrateName(
|
||||
"core",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(5),
|
||||
name: CrateName(
|
||||
"profiler_builtins",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(9),
|
||||
name: CrateName(
|
||||
"unwind",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(7),
|
||||
name: CrateName(
|
||||
"std_detect",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(8),
|
||||
name: CrateName(
|
||||
"test",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: false,
|
||||
},
|
||||
],
|
||||
origin: Lang(
|
||||
Std,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Other,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Test,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: 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(
|
||||
[
|
||||
"debug_assertions",
|
||||
"miri",
|
||||
"true",
|
||||
],
|
||||
),
|
||||
potential_cfg_options: None,
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [],
|
||||
origin: Lang(
|
||||
Other,
|
||||
),
|
||||
is_proc_macro: false,
|
||||
proc_macro_cwd: None,
|
||||
},
|
||||
10: CrateData {
|
||||
root_file_id: FileId(
|
||||
11,
|
||||
),
|
||||
edition: Edition2018,
|
||||
version: None,
|
||||
display_name: Some(
|
||||
@ -435,48 +24,7 @@
|
||||
env: Env {
|
||||
entries: {},
|
||||
},
|
||||
dependencies: [
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(1),
|
||||
name: CrateName(
|
||||
"core",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(0),
|
||||
name: CrateName(
|
||||
"alloc",
|
||||
),
|
||||
prelude: false,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(6),
|
||||
name: CrateName(
|
||||
"std",
|
||||
),
|
||||
prelude: true,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(8),
|
||||
name: CrateName(
|
||||
"test",
|
||||
),
|
||||
prelude: false,
|
||||
sysroot: true,
|
||||
},
|
||||
Dependency {
|
||||
crate_id: Idx::<CrateData>(4),
|
||||
name: CrateName(
|
||||
"proc_macro",
|
||||
),
|
||||
prelude: false,
|
||||
sysroot: true,
|
||||
},
|
||||
],
|
||||
dependencies: [],
|
||||
origin: Local {
|
||||
repo: None,
|
||||
name: Some(
|
||||
|
Loading…
x
Reference in New Issue
Block a user