summaryrefslogtreecommitdiffstats
path: root/src/tools/rust-analyzer/crates/project-model
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /src/tools/rust-analyzer/crates/project-model
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/rust-analyzer/crates/project-model')
-rw-r--r--src/tools/rust-analyzer/crates/project-model/Cargo.toml8
-rw-r--r--src/tools/rust-analyzer/crates/project-model/src/build_scripts.rs4
-rw-r--r--src/tools/rust-analyzer/crates/project-model/src/cargo_workspace.rs2
-rw-r--r--src/tools/rust-analyzer/crates/project-model/src/lib.rs2
-rw-r--r--src/tools/rust-analyzer/crates/project-model/src/project_json.rs3
-rw-r--r--src/tools/rust-analyzer/crates/project-model/src/tests.rs56
-rw-r--r--src/tools/rust-analyzer/crates/project-model/src/workspace.rs67
-rw-r--r--src/tools/rust-analyzer/crates/project-model/test_data/deduplication_crate_graph_A.json140
-rw-r--r--src/tools/rust-analyzer/crates/project-model/test_data/deduplication_crate_graph_B.json66
-rw-r--r--src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model.txt7
-rw-r--r--src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model_with_selective_overrides.txt7
-rw-r--r--src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model_with_wildcard_overrides.txt7
-rw-r--r--src/tools/rust-analyzer/crates/project-model/test_data/output/rust_project_hello_world_project_model.txt16
13 files changed, 364 insertions, 21 deletions
diff --git a/src/tools/rust-analyzer/crates/project-model/Cargo.toml b/src/tools/rust-analyzer/crates/project-model/Cargo.toml
index 75977fc5b..3e48de645 100644
--- a/src/tools/rust-analyzer/crates/project-model/Cargo.toml
+++ b/src/tools/rust-analyzer/crates/project-model/Cargo.toml
@@ -12,16 +12,16 @@ rust-version.workspace = true
doctest = false
[dependencies]
-tracing = "0.1.35"
+anyhow.workspace = true
+cargo_metadata.workspace = true
rustc-hash = "1.1.0"
-cargo_metadata = "0.15.0"
semver = "1.0.14"
serde_json.workspace = true
serde.workspace = true
+tracing.workspace = true
triomphe.workspace = true
-anyhow = "1.0.62"
la-arena.workspace = true
-itertools = "0.10.5"
+itertools.workspace = true
# local deps
base-db.workspace = true
diff --git a/src/tools/rust-analyzer/crates/project-model/src/build_scripts.rs b/src/tools/rust-analyzer/crates/project-model/src/build_scripts.rs
index fb0f3ab7d..68cd40c04 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/build_scripts.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/build_scripts.rs
@@ -73,6 +73,10 @@ impl WorkspaceBuildScripts {
cmd.args(["check", "--quiet", "--workspace", "--message-format=json"]);
cmd.args(&config.extra_args);
+ if let Some(target_dir) = &config.target_dir {
+ cmd.arg("--target-dir").arg(target_dir);
+ }
+
// --all-targets includes tests, benches and examples in addition to the
// default lib and bins. This is an independent concept from the --target
// flag below.
diff --git a/src/tools/rust-analyzer/crates/project-model/src/cargo_workspace.rs b/src/tools/rust-analyzer/crates/project-model/src/cargo_workspace.rs
index e47808a2c..ca3d6e059 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/cargo_workspace.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/cargo_workspace.rs
@@ -96,6 +96,8 @@ pub struct CargoConfig {
pub extra_env: FxHashMap<String, String>,
pub invocation_strategy: InvocationStrategy,
pub invocation_location: InvocationLocation,
+ /// Optional path to use instead of `target` when building
+ pub target_dir: Option<PathBuf>,
}
pub type Package = Idx<PackageData>;
diff --git a/src/tools/rust-analyzer/crates/project-model/src/lib.rs b/src/tools/rust-analyzer/crates/project-model/src/lib.rs
index 901dcfd2b..5f9b70828 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/lib.rs
@@ -15,7 +15,7 @@
//! procedural macros).
//! * Lowering of concrete model to a [`base_db::CrateGraph`]
-#![warn(rust_2018_idioms, unused_lifetimes, semicolon_in_expressions_from_macros)]
+#![warn(rust_2018_idioms, unused_lifetimes)]
mod manifest_path;
mod cargo_workspace;
diff --git a/src/tools/rust-analyzer/crates/project-model/src/project_json.rs b/src/tools/rust-analyzer/crates/project-model/src/project_json.rs
index 80897f747..931eba115 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/project_json.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/project_json.rs
@@ -49,7 +49,7 @@
//! user explores them belongs to that extension (it's totally valid to change
//! rust-project.json over time via configuration request!)
-use base_db::{CrateDisplayName, CrateId, CrateName, Dependency, Edition};
+use base_db::{CrateDisplayName, CrateId, CrateName, Dependency, DependencyKind, Edition};
use la_arena::RawIdx;
use paths::{AbsPath, AbsPathBuf};
use rustc_hash::FxHashMap;
@@ -135,6 +135,7 @@ impl ProjectJson {
Dependency::new(
dep_data.name,
CrateId::from_raw(RawIdx::from(dep_data.krate as u32)),
+ DependencyKind::Normal,
)
})
.collect::<Vec<_>>(),
diff --git a/src/tools/rust-analyzer/crates/project-model/src/tests.rs b/src/tools/rust-analyzer/crates/project-model/src/tests.rs
index 7815b9dda..4887b2981 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/tests.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/tests.rs
@@ -58,7 +58,7 @@ fn load_cargo_with_sysroot(
&mut {
|path| {
let len = file_map.len();
- Some(*file_map.entry(path.to_path_buf()).or_insert(FileId(len as u32)))
+ Some(*file_map.entry(path.to_path_buf()).or_insert(FileId::from_raw(len as u32)))
}
},
&Default::default(),
@@ -142,7 +142,7 @@ fn to_crate_graph(project_workspace: ProjectWorkspace) -> (CrateGraph, ProcMacro
let mut counter = 0;
move |_path| {
counter += 1;
- Some(FileId(counter))
+ Some(FileId::from_raw(counter))
}
},
&Default::default(),
@@ -249,3 +249,55 @@ fn crate_graph_dedup() {
crate_graph.extend(regex_crate_graph, &mut regex_proc_macros);
assert_eq!(crate_graph.iter().count(), 118);
}
+
+#[test]
+fn test_deduplicate_origin_dev() {
+ let path_map = &mut Default::default();
+ let (mut crate_graph, _proc_macros) =
+ load_cargo_with_sysroot(path_map, "deduplication_crate_graph_A.json");
+ crate_graph.sort_deps();
+ let (crate_graph_1, mut _proc_macros_2) =
+ load_cargo_with_sysroot(path_map, "deduplication_crate_graph_B.json");
+
+ crate_graph.extend(crate_graph_1, &mut _proc_macros_2);
+
+ let mut crates_named_p2 = vec![];
+ for id in crate_graph.iter() {
+ let krate = &crate_graph[id];
+ if let Some(name) = krate.display_name.as_ref() {
+ if name.to_string() == "p2" {
+ crates_named_p2.push(krate);
+ }
+ }
+ }
+
+ assert!(crates_named_p2.len() == 1);
+ let p2 = crates_named_p2[0];
+ assert!(p2.origin.is_local());
+}
+
+#[test]
+fn test_deduplicate_origin_dev_rev() {
+ let path_map = &mut Default::default();
+ let (mut crate_graph, _proc_macros) =
+ load_cargo_with_sysroot(path_map, "deduplication_crate_graph_B.json");
+ crate_graph.sort_deps();
+ let (crate_graph_1, mut _proc_macros_2) =
+ load_cargo_with_sysroot(path_map, "deduplication_crate_graph_A.json");
+
+ crate_graph.extend(crate_graph_1, &mut _proc_macros_2);
+
+ let mut crates_named_p2 = vec![];
+ for id in crate_graph.iter() {
+ let krate = &crate_graph[id];
+ if let Some(name) = krate.display_name.as_ref() {
+ if name.to_string() == "p2" {
+ crates_named_p2.push(krate);
+ }
+ }
+ }
+
+ assert!(crates_named_p2.len() == 1);
+ let p2 = crates_named_p2[0];
+ assert!(p2.origin.is_local());
+}
diff --git a/src/tools/rust-analyzer/crates/project-model/src/workspace.rs b/src/tools/rust-analyzer/crates/project-model/src/workspace.rs
index e0209ca15..933357035 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/workspace.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/workspace.rs
@@ -6,8 +6,8 @@ use std::{collections::VecDeque, fmt, fs, iter, process::Command, str::FromStr,
use anyhow::{format_err, Context};
use base_db::{
- CrateDisplayName, CrateGraph, CrateId, CrateName, CrateOrigin, Dependency, Edition, Env,
- FileId, LangCrateOrigin, ProcMacroPaths, ReleaseChannel, TargetLayoutLoadResult,
+ CrateDisplayName, CrateGraph, CrateId, CrateName, CrateOrigin, Dependency, DependencyKind,
+ Edition, Env, FileId, LangCrateOrigin, ProcMacroPaths, ReleaseChannel, TargetLayoutLoadResult,
};
use cfg::{CfgDiff, CfgOptions};
use paths::{AbsPath, AbsPathBuf};
@@ -834,7 +834,7 @@ fn project_json_to_crate_graph(
for dep in &krate.deps {
if let Some(&to) = crates.get(&dep.crate_id) {
- add_dep(crate_graph, from, dep.name.clone(), to)
+ add_dep(crate_graph, from, dep.name.clone(), to, dep.kind().to_owned())
}
}
}
@@ -979,7 +979,7 @@ fn cargo_to_crate_graph(
// cargo metadata does not do any normalization,
// so we do it ourselves currently
let name = CrateName::normalize_dashes(&name);
- add_dep(crate_graph, from, name, to);
+ add_dep(crate_graph, from, name, to, DependencyKind::Normal);
}
}
}
@@ -999,7 +999,17 @@ fn cargo_to_crate_graph(
continue;
}
- add_dep(crate_graph, from, name.clone(), to)
+ add_dep(
+ crate_graph,
+ from,
+ name.clone(),
+ to,
+ match dep.kind {
+ DepKind::Normal => DependencyKind::Normal,
+ DepKind::Dev => DependencyKind::Dev,
+ DepKind::Build => DependencyKind::Build,
+ },
+ )
}
}
}
@@ -1187,7 +1197,17 @@ fn handle_rustc_crates(
let name = CrateName::new(&dep.name).unwrap();
if let Some(&to) = pkg_to_lib_crate.get(&dep.pkg) {
for &from in rustc_pkg_crates.get(&pkg).into_iter().flatten() {
- add_dep(crate_graph, from, name.clone(), to);
+ add_dep(
+ crate_graph,
+ from,
+ name.clone(),
+ to,
+ match dep.kind {
+ DepKind::Normal => DependencyKind::Normal,
+ DepKind::Dev => DependencyKind::Dev,
+ DepKind::Build => DependencyKind::Build,
+ },
+ );
}
}
}
@@ -1209,7 +1229,7 @@ fn handle_rustc_crates(
// `rust_analyzer` thinks that it should use the one from the `rustc_source`
// instead of the one from `crates.io`
if !crate_graph[*from].dependencies.iter().any(|d| d.name == name) {
- add_dep(crate_graph, *from, name.clone(), to);
+ add_dep(crate_graph, *from, name.clone(), to, DependencyKind::Normal);
}
}
}
@@ -1308,7 +1328,14 @@ impl SysrootPublicDeps {
/// Makes `from` depend on the public sysroot crates.
fn add_to_crate_graph(&self, crate_graph: &mut CrateGraph, from: CrateId) {
for (name, krate, prelude) in &self.deps {
- add_dep_with_prelude(crate_graph, from, name.clone(), *krate, *prelude);
+ add_dep_with_prelude(
+ crate_graph,
+ from,
+ name.clone(),
+ *krate,
+ *prelude,
+ DependencyKind::Normal,
+ );
}
}
}
@@ -1363,7 +1390,7 @@ fn sysroot_to_crate_graph(
for &to in sysroot[from].deps.iter() {
let name = CrateName::new(&sysroot[to].name).unwrap();
if let (Some(&from), Some(&to)) = (sysroot_crates.get(&from), sysroot_crates.get(&to)) {
- add_dep(crate_graph, from, name, to);
+ add_dep(crate_graph, from, name, to, DependencyKind::Normal);
}
}
}
@@ -1442,8 +1469,14 @@ fn handle_hack_cargo_workspace(
.collect()
}
-fn add_dep(graph: &mut CrateGraph, from: CrateId, name: CrateName, to: CrateId) {
- add_dep_inner(graph, from, Dependency::new(name, to))
+fn add_dep(
+ graph: &mut CrateGraph,
+ from: CrateId,
+ name: CrateName,
+ to: CrateId,
+ kind: DependencyKind,
+) {
+ add_dep_inner(graph, from, Dependency::new(name, to, kind))
}
fn add_dep_with_prelude(
@@ -1452,12 +1485,20 @@ fn add_dep_with_prelude(
name: CrateName,
to: CrateId,
prelude: bool,
+ kind: DependencyKind,
) {
- add_dep_inner(graph, from, Dependency::with_prelude(name, to, prelude))
+ add_dep_inner(graph, from, Dependency::with_prelude(name, to, prelude, kind))
}
fn add_proc_macro_dep(crate_graph: &mut CrateGraph, from: CrateId, to: CrateId, prelude: bool) {
- add_dep_with_prelude(crate_graph, from, CrateName::new("proc_macro").unwrap(), to, prelude);
+ add_dep_with_prelude(
+ crate_graph,
+ from,
+ CrateName::new("proc_macro").unwrap(),
+ to,
+ prelude,
+ DependencyKind::Normal,
+ );
}
fn add_dep_inner(graph: &mut CrateGraph, from: CrateId, dep: Dependency) {
diff --git a/src/tools/rust-analyzer/crates/project-model/test_data/deduplication_crate_graph_A.json b/src/tools/rust-analyzer/crates/project-model/test_data/deduplication_crate_graph_A.json
new file mode 100644
index 000000000..b0fb5845c
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/project-model/test_data/deduplication_crate_graph_A.json
@@ -0,0 +1,140 @@
+{
+ "packages": [
+ {
+ "name": "p1",
+ "version": "0.1.0",
+ "id": "p1 0.1.0 (path+file:///example_project/p1)",
+ "license": null,
+ "license_file": null,
+ "description": null,
+ "source": null,
+ "dependencies": [
+ {
+ "name": "p2",
+ "source": null,
+ "req": "*",
+ "kind": null,
+ "rename": null,
+ "optional": false,
+ "uses_default_features": true,
+ "features": [],
+ "target": null,
+ "registry": null,
+ "path": "$ROOT$example_project/p2"
+ }
+ ],
+ "targets": [
+ {
+ "kind": [
+ "lib"
+ ],
+ "crate_types": [
+ "lib"
+ ],
+ "name": "p1",
+ "src_path": "$ROOT$example_project/p1/src/lib.rs",
+ "edition": "2021",
+ "doc": true,
+ "doctest": true,
+ "test": true
+ }
+ ],
+ "features": {},
+ "manifest_path": "$ROOT$example_project/p1/Cargo.toml",
+ "metadata": null,
+ "publish": null,
+ "authors": [],
+ "categories": [],
+ "keywords": [],
+ "readme": null,
+ "repository": null,
+ "homepage": null,
+ "documentation": null,
+ "edition": "2021",
+ "links": null,
+ "default_run": null,
+ "rust_version": null
+ },
+ {
+ "name": "p2",
+ "version": "0.1.0",
+ "id": "p2 0.1.0 (path+file:///example_project/p2)",
+ "license": null,
+ "license_file": null,
+ "description": null,
+ "source": null,
+ "dependencies": [],
+ "targets": [
+ {
+ "kind": [
+ "lib"
+ ],
+ "crate_types": [
+ "lib"
+ ],
+ "name": "p2",
+ "src_path": "$ROOT$example_project/p2/src/lib.rs",
+ "edition": "2021",
+ "doc": true,
+ "doctest": true,
+ "test": true
+ }
+ ],
+ "features": {},
+ "manifest_path": "$ROOT$example_project/p2/Cargo.toml",
+ "metadata": null,
+ "publish": null,
+ "authors": [],
+ "categories": [],
+ "keywords": [],
+ "readme": null,
+ "repository": null,
+ "homepage": null,
+ "documentation": null,
+ "edition": "2021",
+ "links": null,
+ "default_run": null,
+ "rust_version": null
+ }
+ ],
+ "workspace_members": [
+ "p1 0.1.0 (path+file:///example_project/p1)"
+ ],
+ "workspace_default_members": [
+ "p1 0.1.0 (path+file:///example_project/p1)"
+ ],
+ "resolve": {
+ "nodes": [
+ {
+ "id": "p1 0.1.0 (path+file:///example_project/p1)",
+ "dependencies": [
+ "p2 0.1.0 (path+file:///example_project/p2)"
+ ],
+ "deps": [
+ {
+ "name": "p2",
+ "pkg": "p2 0.1.0 (path+file:///example_project/p2)",
+ "dep_kinds": [
+ {
+ "kind": null,
+ "target": null
+ }
+ ]
+ }
+ ],
+ "features": []
+ },
+ {
+ "id": "p2 0.1.0 (path+file:///example_project/p2)",
+ "dependencies": [],
+ "deps": [],
+ "features": []
+ }
+ ],
+ "root": "p1 0.1.0 (path+file:///example_project/p1)"
+ },
+ "target_directory": "$ROOT$example_project/p1/target",
+ "version": 1,
+ "workspace_root": "$ROOT$example_project/p1",
+ "metadata": null
+} \ No newline at end of file
diff --git a/src/tools/rust-analyzer/crates/project-model/test_data/deduplication_crate_graph_B.json b/src/tools/rust-analyzer/crates/project-model/test_data/deduplication_crate_graph_B.json
new file mode 100644
index 000000000..b5d1e16e6
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/project-model/test_data/deduplication_crate_graph_B.json
@@ -0,0 +1,66 @@
+{
+ "packages": [
+ {
+ "name": "p2",
+ "version": "0.1.0",
+ "id": "p2 0.1.0 (path+file:///example_project/p2)",
+ "license": null,
+ "license_file": null,
+ "description": null,
+ "source": null,
+ "dependencies": [],
+ "targets": [
+ {
+ "kind": [
+ "lib"
+ ],
+ "crate_types": [
+ "lib"
+ ],
+ "name": "p2",
+ "src_path": "$ROOT$example_project/p2/src/lib.rs",
+ "edition": "2021",
+ "doc": true,
+ "doctest": true,
+ "test": true
+ }
+ ],
+ "features": {},
+ "manifest_path": "$ROOT$example_project/p2/Cargo.toml",
+ "metadata": null,
+ "publish": null,
+ "authors": [],
+ "categories": [],
+ "keywords": [],
+ "readme": null,
+ "repository": null,
+ "homepage": null,
+ "documentation": null,
+ "edition": "2021",
+ "links": null,
+ "default_run": null,
+ "rust_version": null
+ }
+ ],
+ "workspace_members": [
+ "p2 0.1.0 (path+file:///example_project/p2)"
+ ],
+ "workspace_default_members": [
+ "p2 0.1.0 (path+file:///example_project/p2)"
+ ],
+ "resolve": {
+ "nodes": [
+ {
+ "id": "p2 0.1.0 (path+file:///example_project/p2)",
+ "dependencies": [],
+ "deps": [],
+ "features": []
+ }
+ ],
+ "root": "p2 0.1.0 (path+file:///example_project/p2)"
+ },
+ "target_directory": "$ROOT$example_project/p2/target",
+ "version": 1,
+ "workspace_root": "$ROOT$example_project/p2",
+ "metadata": null
+} \ No newline at end of file
diff --git a/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model.txt b/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model.txt
index 727d39a30..e98f016ca 100644
--- a/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model.txt
+++ b/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model.txt
@@ -48,6 +48,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
@@ -112,6 +113,7 @@
name: CrateName(
"hello_world",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -119,6 +121,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
@@ -183,6 +186,7 @@
name: CrateName(
"hello_world",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -190,6 +194,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
@@ -254,6 +259,7 @@
name: CrateName(
"hello_world",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -261,6 +267,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
diff --git a/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model_with_selective_overrides.txt b/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model_with_selective_overrides.txt
index 727d39a30..e98f016ca 100644
--- a/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model_with_selective_overrides.txt
+++ b/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model_with_selective_overrides.txt
@@ -48,6 +48,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
@@ -112,6 +113,7 @@
name: CrateName(
"hello_world",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -119,6 +121,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
@@ -183,6 +186,7 @@
name: CrateName(
"hello_world",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -190,6 +194,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
@@ -254,6 +259,7 @@
name: CrateName(
"hello_world",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -261,6 +267,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
diff --git a/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model_with_wildcard_overrides.txt b/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model_with_wildcard_overrides.txt
index 89728babd..7ecd53572 100644
--- a/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model_with_wildcard_overrides.txt
+++ b/src/tools/rust-analyzer/crates/project-model/test_data/output/cargo_hello_world_project_model_with_wildcard_overrides.txt
@@ -47,6 +47,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
@@ -110,6 +111,7 @@
name: CrateName(
"hello_world",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -117,6 +119,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
@@ -180,6 +183,7 @@
name: CrateName(
"hello_world",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -187,6 +191,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
@@ -250,6 +255,7 @@
name: CrateName(
"hello_world",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -257,6 +263,7 @@
name: CrateName(
"libc",
),
+ kind: Normal,
prelude: true,
},
],
diff --git a/src/tools/rust-analyzer/crates/project-model/test_data/output/rust_project_hello_world_project_model.txt b/src/tools/rust-analyzer/crates/project-model/test_data/output/rust_project_hello_world_project_model.txt
index b7bf6cb27..581a6afc1 100644
--- a/src/tools/rust-analyzer/crates/project-model/test_data/output/rust_project_hello_world_project_model.txt
+++ b/src/tools/rust-analyzer/crates/project-model/test_data/output/rust_project_hello_world_project_model.txt
@@ -28,6 +28,7 @@
name: CrateName(
"core",
),
+ kind: Normal,
prelude: true,
},
],
@@ -168,6 +169,7 @@
name: CrateName(
"std",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -175,6 +177,7 @@
name: CrateName(
"core",
),
+ kind: Normal,
prelude: true,
},
],
@@ -249,6 +252,7 @@
name: CrateName(
"alloc",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -256,6 +260,7 @@
name: CrateName(
"panic_unwind",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -263,6 +268,7 @@
name: CrateName(
"panic_abort",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -270,6 +276,7 @@
name: CrateName(
"core",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -277,6 +284,7 @@
name: CrateName(
"profiler_builtins",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -284,6 +292,7 @@
name: CrateName(
"unwind",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -291,6 +300,7 @@
name: CrateName(
"std_detect",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -298,6 +308,7 @@
name: CrateName(
"test",
),
+ kind: Normal,
prelude: true,
},
],
@@ -438,6 +449,7 @@
name: CrateName(
"core",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -445,6 +457,7 @@
name: CrateName(
"alloc",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -452,6 +465,7 @@
name: CrateName(
"std",
),
+ kind: Normal,
prelude: true,
},
Dependency {
@@ -459,6 +473,7 @@
name: CrateName(
"test",
),
+ kind: Normal,
prelude: false,
},
Dependency {
@@ -466,6 +481,7 @@
name: CrateName(
"proc_macro",
),
+ kind: Normal,
prelude: false,
},
],