Unnamed repository; edit this file 'description' to name the repository.
target-triple -> target-tuple
Lukas Wirth 2025-01-07
parent f1c0d17 · commit 2ac803e
-rw-r--r--crates/project-model/src/lib.rs2
-rw-r--r--crates/project-model/src/toolchain_info/target_tuple.rs (renamed from crates/project-model/src/toolchain_info/target_triple.rs)10
-rw-r--r--crates/project-model/src/workspace.rs6
-rw-r--r--crates/rust-analyzer/src/config.rs6
-rw-r--r--crates/rust-analyzer/src/flycheck.rs4
-rw-r--r--docs/user/generated_config.adoc2
-rw-r--r--docs/user/manual.adoc2
-rw-r--r--editors/code/package.json2
8 files changed, 17 insertions, 17 deletions
diff --git a/crates/project-model/src/lib.rs b/crates/project-model/src/lib.rs
index f540543825..dec4f1456b 100644
--- a/crates/project-model/src/lib.rs
+++ b/crates/project-model/src/lib.rs
@@ -19,7 +19,7 @@ pub mod project_json;
pub mod toolchain_info {
pub mod rustc_cfg;
pub mod target_data_layout;
- pub mod target_triple;
+ pub mod target_tuple;
use std::path::Path;
diff --git a/crates/project-model/src/toolchain_info/target_triple.rs b/crates/project-model/src/toolchain_info/target_tuple.rs
index 163884e5e8..55e033caec 100644
--- a/crates/project-model/src/toolchain_info/target_triple.rs
+++ b/crates/project-model/src/toolchain_info/target_tuple.rs
@@ -14,7 +14,7 @@ pub fn get(
target: Option<&str>,
extra_env: &FxHashMap<String, String>,
) -> anyhow::Result<Vec<String>> {
- let _p = tracing::info_span!("target_triple::get").entered();
+ let _p = tracing::info_span!("target_tuple::get").entered();
if let Some(target) = target {
return Ok(vec![target.to_owned()]);
}
@@ -28,10 +28,10 @@ pub fn get(
}
QueryConfig::Rustc(sysroot, current_dir) => (sysroot, current_dir),
};
- rustc_discover_host_triple(extra_env, sysroot, current_dir).map(|it| vec![it])
+ rustc_discover_host_tuple(extra_env, sysroot, current_dir).map(|it| vec![it])
}
-fn rustc_discover_host_triple(
+fn rustc_discover_host_tuple(
extra_env: &FxHashMap<String, String>,
sysroot: &Sysroot,
current_dir: &Path,
@@ -60,14 +60,14 @@ fn cargo_config_build_target(
cmd.envs(extra_env);
cmd.current_dir(cargo_toml.parent()).env("RUSTC_BOOTSTRAP", "1");
cmd.args(["-Z", "unstable-options", "config", "get", "build.target"]);
- // if successful we receive `build.target = "target-triple"`
+ // if successful we receive `build.target = "target-tuple"`
// or `build.target = ["<target 1>", ..]`
// this might be `error: config value `build.target` is not set` in which case we
// don't wanna log the error
utf8_stdout(&mut cmd).and_then(parse_output_cargo_config_build_target).ok()
}
-// Parses `"build.target = [target-triple, target-triple, ...]"` or `"build.target = "target-triple"`
+// Parses `"build.target = [target-tuple, target-tuple, ...]"` or `"build.target = "target-tuple"`
fn parse_output_cargo_config_build_target(stdout: String) -> anyhow::Result<Vec<String>> {
let trimmed = stdout.trim_start_matches("build.target = ").trim_matches('"');
diff --git a/crates/project-model/src/workspace.rs b/crates/project-model/src/workspace.rs
index 6dc8e2fa5d..905e83b27d 100644
--- a/crates/project-model/src/workspace.rs
+++ b/crates/project-model/src/workspace.rs
@@ -26,7 +26,7 @@ use crate::{
env::{cargo_config_env, inject_cargo_env, inject_cargo_package_env, inject_rustc_tool_env},
project_json::{Crate, CrateArrayIdx},
sysroot::{SysrootCrate, SysrootWorkspace},
- toolchain_info::{rustc_cfg, target_data_layout, target_triple, QueryConfig},
+ toolchain_info::{rustc_cfg, target_data_layout, target_tuple, QueryConfig},
utf8_stdout, CargoConfig, CargoWorkspace, CfgOverrides, InvocationStrategy, ManifestPath,
Package, ProjectJson, ProjectManifest, Sysroot, SysrootSourceWorkspaceConfig, TargetData,
TargetKind, WorkspaceBuildScripts,
@@ -242,7 +242,7 @@ impl ProjectWorkspace {
.ok_or_else(|| Some("Failed to discover rustc source for sysroot.".to_owned())),
None => Err(None),
};
- let targets = target_triple::get(
+ let targets = target_tuple::get(
QueryConfig::Cargo(&sysroot, cargo_toml),
config.target.as_deref(),
&config.extra_env,
@@ -397,7 +397,7 @@ impl ProjectWorkspace {
}
};
- let targets = target_triple::get(
+ let targets = target_tuple::get(
QueryConfig::Cargo(&sysroot, detached_file),
config.target.as_deref(),
&config.extra_env,
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index 67e0a208e8..30f0031905 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/crates/rust-analyzer/src/config.rs
@@ -600,7 +600,7 @@ config_data! {
///
/// This option does not take effect until rust-analyzer is restarted.
cargo_sysrootSrc: Option<String> = None,
- /// Compilation target override (target triple).
+ /// Compilation target override (target tuple).
// FIXME(@poliorcetics): move to multiple targets here too, but this will need more work
// than `checkOnSave_target`
cargo_target: Option<String> = None,
@@ -2041,7 +2041,7 @@ impl Config {
pub(crate) fn cargo_test_options(&self, source_root: Option<SourceRootId>) -> CargoOptions {
CargoOptions {
- target_triples: self.cargo_target(source_root).clone().into_iter().collect(),
+ target_tuples: self.cargo_target(source_root).clone().into_iter().collect(),
all_targets: false,
no_default_features: *self.cargo_noDefaultFeatures(source_root),
all_features: matches!(self.cargo_features(source_root), CargoFeaturesDef::All),
@@ -2076,7 +2076,7 @@ impl Config {
Some(_) | None => FlycheckConfig::CargoCommand {
command: self.check_command(source_root).clone(),
options: CargoOptions {
- target_triples: self
+ target_tuples: self
.check_targets(source_root)
.clone()
.and_then(|targets| match &targets.0[..] {
diff --git a/crates/rust-analyzer/src/flycheck.rs b/crates/rust-analyzer/src/flycheck.rs
index a306302cc0..98042a2bce 100644
--- a/crates/rust-analyzer/src/flycheck.rs
+++ b/crates/rust-analyzer/src/flycheck.rs
@@ -28,7 +28,7 @@ pub(crate) enum InvocationStrategy {
#[derive(Clone, Debug, PartialEq, Eq)]
pub(crate) struct CargoOptions {
- pub(crate) target_triples: Vec<String>,
+ pub(crate) target_tuples: Vec<String>,
pub(crate) all_targets: bool,
pub(crate) no_default_features: bool,
pub(crate) all_features: bool,
@@ -49,7 +49,7 @@ pub(crate) enum Target {
impl CargoOptions {
pub(crate) fn apply_on_command(&self, cmd: &mut Command) {
- for target in &self.target_triples {
+ for target in &self.target_tuples {
cmd.args(["--target", target.as_str()]);
}
if self.all_targets {
diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc
index 2c6ff4fb01..5b86766aa8 100644
--- a/docs/user/generated_config.adoc
+++ b/docs/user/generated_config.adoc
@@ -146,7 +146,7 @@ This option does not take effect until rust-analyzer is restarted.
[[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`)::
+
--
-Compilation target override (target triple).
+Compilation target override (target tuple).
--
[[rust-analyzer.cargo.targetDir]]rust-analyzer.cargo.targetDir (default: `null`)::
+
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index da2aa4eae4..ffc820e9b7 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -769,7 +769,7 @@ interface Crate {
/// The set of cfgs activated for a given crate, like
/// `["unix", "feature=\"foo\"", "feature=\"bar\""]`.
cfg: string[];
- /// Target triple for this Crate.
+ /// Target tuple for this Crate.
///
/// Used when running `rustc --print cfg`
/// to get target-specific cfgs.
diff --git a/editors/code/package.json b/editors/code/package.json
index 6ec7032c0b..80246bf3fe 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -888,7 +888,7 @@
"title": "cargo",
"properties": {
"rust-analyzer.cargo.target": {
- "markdownDescription": "Compilation target override (target triple).",
+ "markdownDescription": "Compilation target override (target tuple).",
"default": null,
"type": [
"null",