Skip to content

Commit 05770f2

Browse files
committed
target-triple -> target-tuple
1 parent 764ce49 commit 05770f2

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

src/tools/rust-analyzer/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

src/tools/rust-analyzer/crates/project-model/src/toolchain_info/target_triple.rs renamed to src/tools/rust-analyzer/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

src/tools/rust-analyzer/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, SysrootWorkspace},
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, SysrootSourceWorkspaceConfig, TargetData,
3232
TargetKind, WorkspaceBuildScripts,
@@ -242,7 +242,7 @@ impl ProjectWorkspace {
242242
.ok_or_else(|| Some("Failed to discover rustc source for sysroot.".to_owned())),
243243
None => Err(None),
244244
};
245-
let targets = target_triple::get(
245+
let targets = target_tuple::get(
246246
QueryConfig::Cargo(&sysroot, cargo_toml),
247247
config.target.as_deref(),
248248
&config.extra_env,
@@ -397,7 +397,7 @@ impl ProjectWorkspace {
397397
}
398398
};
399399

400-
let targets = target_triple::get(
400+
let targets = target_tuple::get(
401401
QueryConfig::Cargo(&sysroot, detached_file),
402402
config.target.as_deref(),
403403
&config.extra_env,

src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs

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

20422042
pub(crate) fn cargo_test_options(&self, source_root: Option<SourceRootId>) -> CargoOptions {
20432043
CargoOptions {
2044-
target_triples: self.cargo_target(source_root).clone().into_iter().collect(),
2044+
target_tuples: self.cargo_target(source_root).clone().into_iter().collect(),
20452045
all_targets: false,
20462046
no_default_features: *self.cargo_noDefaultFeatures(source_root),
20472047
all_features: matches!(self.cargo_features(source_root), CargoFeaturesDef::All),
@@ -2076,7 +2076,7 @@ impl Config {
20762076
Some(_) | None => FlycheckConfig::CargoCommand {
20772077
command: self.check_command(source_root).clone(),
20782078
options: CargoOptions {
2079-
target_triples: self
2079+
target_tuples: self
20802080
.check_targets(source_root)
20812081
.clone()
20822082
.and_then(|targets| match &targets.0[..] {

src/tools/rust-analyzer/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 {

src/tools/rust-analyzer/docs/user/generated_config.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ This option does not take effect until rust-analyzer is restarted.
146146
[[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`)::
147147
+
148148
--
149-
Compilation target override (target triple).
149+
Compilation target override (target tuple).
150150
--
151151
[[rust-analyzer.cargo.targetDir]]rust-analyzer.cargo.targetDir (default: `null`)::
152152
+

src/tools/rust-analyzer/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.

src/tools/rust-analyzer/editors/code/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@
888888
"title": "cargo",
889889
"properties": {
890890
"rust-analyzer.cargo.target": {
891-
"markdownDescription": "Compilation target override (target triple).",
891+
"markdownDescription": "Compilation target override (target tuple).",
892892
"default": null,
893893
"type": [
894894
"null",

0 commit comments

Comments
 (0)