about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2024-12-29 13:31:39 +0100
committerLukas Wirth <lukastw97@gmail.com>2024-12-29 13:43:12 +0100
commitf36a93ec52ef6aecfa3eab3f574677f985a94b14 (patch)
tree3e7dde58b65361892e456d9dcb60d4c9ebf1224d
parentd10525319410496dbe6cbbd70b5ea08f9029e2a7 (diff)
downloadrust-f36a93ec52ef6aecfa3eab3f574677f985a94b14.tar.gz
rust-f36a93ec52ef6aecfa3eab3f574677f985a94b14.zip
Inline toolchain_info module
-rw-r--r--src/tools/rust-analyzer/crates/project-model/src/lib.rs19
-rw-r--r--src/tools/rust-analyzer/crates/project-model/src/toolchain_info.rs16
-rw-r--r--src/tools/rust-analyzer/crates/project-model/src/toolchain_info/target_triple.rs1
3 files changed, 19 insertions, 17 deletions
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 2dd9c54e0c7..1913db11fa9 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/lib.rs
@@ -16,7 +16,24 @@
 //! * Lowering of concrete model to a [`base_db::CrateGraph`]
 
 pub mod project_json;
-pub mod toolchain_info;
+pub mod toolchain_info {
+    pub mod rustc_cfg;
+    pub mod target_data_layout;
+    pub mod target_triple;
+
+    use std::path::Path;
+
+    use crate::{ManifestPath, Sysroot};
+
+    #[derive(Copy, Clone)]
+    pub enum QueryConfig<'a> {
+        /// Directly invoke `rustc` to query the desired information.
+        Rustc(&'a Sysroot, &'a Path),
+        /// Attempt to use cargo to query the desired information, honoring cargo configurations.
+        /// If this fails, falls back to invoking `rustc` directly.
+        Cargo(&'a Sysroot, &'a ManifestPath),
+    }
+}
 
 mod build_dependencies;
 mod cargo_workspace;
diff --git a/src/tools/rust-analyzer/crates/project-model/src/toolchain_info.rs b/src/tools/rust-analyzer/crates/project-model/src/toolchain_info.rs
deleted file mode 100644
index 6c8152262c3..00000000000
--- a/src/tools/rust-analyzer/crates/project-model/src/toolchain_info.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-pub mod rustc_cfg;
-pub mod target_data_layout;
-pub mod target_triple;
-
-use std::path::Path;
-
-use crate::{ManifestPath, Sysroot};
-
-#[derive(Copy, Clone)]
-pub enum QueryConfig<'a> {
-    /// Directly invoke `rustc` to query the desired information.
-    Rustc(&'a Sysroot, &'a Path),
-    /// Attempt to use cargo to query the desired information, honoring cargo configurations.
-    /// If this fails, falls back to invoking `rustc` directly.
-    Cargo(&'a Sysroot, &'a ManifestPath),
-}
diff --git a/src/tools/rust-analyzer/crates/project-model/src/toolchain_info/target_triple.rs b/src/tools/rust-analyzer/crates/project-model/src/toolchain_info/target_triple.rs
index 2d0d4a7c50c..163884e5e8b 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/toolchain_info/target_triple.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/toolchain_info/target_triple.rs
@@ -1,3 +1,4 @@
+//! Functionality to discover the current build target(s).
 use std::path::Path;
 
 use anyhow::Context;