Inline toolchain_info module

This commit is contained in:
Lukas Wirth 2024-12-29 13:31:39 +01:00
parent f5fb2b9e9f
commit 98fde69dcf
3 changed files with 19 additions and 17 deletions

View file

@ -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;

View file

@ -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),
}

View file

@ -1,3 +1,4 @@
//! Functionality to discover the current build target(s).
use std::path::Path;
use anyhow::Context;