Skip to content

Commit cfdcd20

Browse files
committed
target-triple -> target-tuple
1 parent 4a03036 commit cfdcd20

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

crates/project-model/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub mod project_json;
1919
pub mod toolchain_info {
2020
pub mod rustc_cfg;
2121
pub mod target_data_layout;
22-
pub mod target_triple;
22+
pub mod target_tuple;
2323

2424
use std::path::Path;
2525

crates/project-model/src/toolchain_info/target_triple.rs renamed to crates/project-model/src/toolchain_info/target_tuple.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn get(
1414
target: Option<&str>,
1515
extra_env: &FxHashMap<String, String>,
1616
) -> anyhow::Result<Vec<String>> {
17-
let _p = tracing::info_span!("target_triple::get").entered();
17+
let _p = tracing::info_span!("target_tuple::get").entered();
1818
if let Some(target) = target {
1919
return Ok(vec![target.to_owned()]);
2020
}
@@ -28,10 +28,10 @@ pub fn get(
2828
}
2929
QueryConfig::Rustc(sysroot, current_dir) => (sysroot, current_dir),
3030
};
31-
rustc_discover_host_triple(extra_env, sysroot, current_dir).map(|it| vec![it])
31+
rustc_discover_host_tuple(extra_env, sysroot, current_dir).map(|it| vec![it])
3232
}
3333

34-
fn rustc_discover_host_triple(
34+
fn rustc_discover_host_tuple(
3535
extra_env: &FxHashMap<String, String>,
3636
sysroot: &Sysroot,
3737
current_dir: &Path,
@@ -60,14 +60,14 @@ fn cargo_config_build_target(
6060
cmd.envs(extra_env);
6161
cmd.current_dir(cargo_toml.parent()).env("RUSTC_BOOTSTRAP", "1");
6262
cmd.args(["-Z", "unstable-options", "config", "get", "build.target"]);
63-
// if successful we receive `build.target = "target-triple"`
63+
// if successful we receive `build.target = "target-tuple"`
6464
// or `build.target = ["<target 1>", ..]`
6565
// this might be `error: config value `build.target` is not set` in which case we
6666
// don't wanna log the error
6767
utf8_stdout(&mut cmd).and_then(parse_output_cargo_config_build_target).ok()
6868
}
6969

70-
// Parses `"build.target = [target-triple, target-triple, ...]"` or `"build.target = "target-triple"`
70+
// Parses `"build.target = [target-tuple, target-tuple, ...]"` or `"build.target = "target-tuple"`
7171
fn parse_output_cargo_config_build_target(stdout: String) -> anyhow::Result<Vec<String>> {
7272
let trimmed = stdout.trim_start_matches("build.target = ").trim_matches('"');
7373

crates/project-model/src/workspace.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::{
2626
env::{cargo_config_env, inject_cargo_env, inject_cargo_package_env, inject_rustc_tool_env},
2727
project_json::{Crate, CrateArrayIdx},
2828
sysroot::{SysrootCrate, SysrootMode},
29-
toolchain_info::{rustc_cfg, target_data_layout, target_triple, QueryConfig},
29+
toolchain_info::{rustc_cfg, target_data_layout, target_tuple, QueryConfig},
3030
utf8_stdout, CargoConfig, CargoWorkspace, CfgOverrides, InvocationStrategy, ManifestPath,
3131
Package, ProjectJson, ProjectManifest, Sysroot, TargetData, TargetKind, WorkspaceBuildScripts,
3232
};
@@ -249,7 +249,7 @@ impl ProjectWorkspace {
249249
.ok_or_else(|| Some("Failed to discover rustc source for sysroot.".to_owned())),
250250
None => Err(None),
251251
};
252-
let targets = target_triple::get(
252+
let targets = target_tuple::get(
253253
QueryConfig::Cargo(&sysroot, cargo_toml),
254254
config.target.as_deref(),
255255
&config.extra_env,
@@ -406,7 +406,7 @@ impl ProjectWorkspace {
406406
}
407407
};
408408

409-
let targets = target_triple::get(
409+
let targets = target_tuple::get(
410410
QueryConfig::Cargo(&sysroot, detached_file),
411411
config.target.as_deref(),
412412
&config.extra_env,

crates/rust-analyzer/src/config.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ config_data! {
603603
///
604604
/// This option does not take effect until rust-analyzer is restarted.
605605
cargo_sysrootSrc: Option<String> = None,
606-
/// Compilation target override (target triple).
606+
/// Compilation target override (target tuple).
607607
// FIXME(@poliorcetics): move to multiple targets here too, but this will need more work
608608
// than `checkOnSave_target`
609609
cargo_target: Option<String> = None,
@@ -2055,7 +2055,7 @@ impl Config {
20552055

20562056
pub(crate) fn cargo_test_options(&self, source_root: Option<SourceRootId>) -> CargoOptions {
20572057
CargoOptions {
2058-
target_triples: self.cargo_target(source_root).clone().into_iter().collect(),
2058+
target_tuples: self.cargo_target(source_root).clone().into_iter().collect(),
20592059
all_targets: false,
20602060
no_default_features: *self.cargo_noDefaultFeatures(source_root),
20612061
all_features: matches!(self.cargo_features(source_root), CargoFeaturesDef::All),
@@ -2090,7 +2090,7 @@ impl Config {
20902090
Some(_) | None => FlycheckConfig::CargoCommand {
20912091
command: self.check_command(source_root).clone(),
20922092
options: CargoOptions {
2093-
target_triples: self
2093+
target_tuples: self
20942094
.check_targets(source_root)
20952095
.clone()
20962096
.and_then(|targets| match &targets.0[..] {

crates/rust-analyzer/src/flycheck.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub(crate) enum InvocationStrategy {
2828

2929
#[derive(Clone, Debug, PartialEq, Eq)]
3030
pub(crate) struct CargoOptions {
31-
pub(crate) target_triples: Vec<String>,
31+
pub(crate) target_tuples: Vec<String>,
3232
pub(crate) all_targets: bool,
3333
pub(crate) no_default_features: bool,
3434
pub(crate) all_features: bool,
@@ -49,7 +49,7 @@ pub(crate) enum Target {
4949

5050
impl CargoOptions {
5151
pub(crate) fn apply_on_command(&self, cmd: &mut Command) {
52-
for target in &self.target_triples {
52+
for target in &self.target_tuples {
5353
cmd.args(["--target", target.as_str()]);
5454
}
5555
if self.all_targets {

docs/user/generated_config.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ This option does not take effect until rust-analyzer is restarted.
152152
[[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`)::
153153
+
154154
--
155-
Compilation target override (target triple).
155+
Compilation target override (target tuple).
156156
--
157157
[[rust-analyzer.cargo.targetDir]]rust-analyzer.cargo.targetDir (default: `null`)::
158158
+

docs/user/manual.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ interface Crate {
769769
/// The set of cfgs activated for a given crate, like
770770
/// `["unix", "feature=\"foo\"", "feature=\"bar\""]`.
771771
cfg: string[];
772-
/// Target triple for this Crate.
772+
/// Target tuple for this Crate.
773773
///
774774
/// Used when running `rustc --print cfg`
775775
/// to get target-specific cfgs.

editors/code/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@
906906
"title": "cargo",
907907
"properties": {
908908
"rust-analyzer.cargo.target": {
909-
"markdownDescription": "Compilation target override (target triple).",
909+
"markdownDescription": "Compilation target override (target tuple).",
910910
"default": null,
911911
"type": [
912912
"null",

0 commit comments

Comments
 (0)