From 123b63eaf638d5eeee62ac47365b0b187176eebf Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Tue, 23 Dec 2025 22:43:44 +0200 Subject: [PATCH 1/3] change 'target triple' to 'target tuple' --- build.rs | 4 ++-- doc/user-guide/src/concepts/toolchains.md | 4 ++-- doc/user-guide/src/installation/windows.md | 4 ++-- src/cli/common.rs | 2 +- src/cli/help.rs | 4 ++-- src/config.rs | 2 +- src/dist/manifest.rs | 2 +- src/dist/manifestation.rs | 4 ++-- src/dist/mod.rs | 10 +++++----- src/dist/triple.rs | 2 +- src/test/dist.rs | 2 +- tests/suite/cli_rustup.rs | 2 +- .../rustup_toolchain_cmd_help_flag.stdout.term.svg | 4 ++-- tests/suite/known_triples.rs | 4 ++-- 14 files changed, 25 insertions(+), 25 deletions(-) diff --git a/build.rs b/build.rs index 3294ea5836..c56f9df520 100644 --- a/build.rs +++ b/build.rs @@ -16,9 +16,9 @@ fn main() { println!("cargo::rerun-if-env-changed=RUSTUP_OVERRIDE_BUILD_TRIPLE"); println!("cargo::rerun-if-env-changed=TARGET"); match from_build() { - Ok(triple) => eprintln!("Computed build based on target triple: {triple:#?}"), + Ok(triple) => eprintln!("Computed build based on target tuple: {triple:#?}"), Err(s) => { - eprintln!("Unable to parse target '{s}' as a known target triple"); + eprintln!("Unable to parse target '{s}' as a known target tuple"); eprintln!( "If you are attempting to bootstrap a new target, you might need to update `platforms` to a newer version" ); diff --git a/doc/user-guide/src/concepts/toolchains.md b/doc/user-guide/src/concepts/toolchains.md index 6e6e4c8351..2d4d0a3bfc 100644 --- a/doc/user-guide/src/concepts/toolchains.md +++ b/doc/user-guide/src/concepts/toolchains.md @@ -27,7 +27,7 @@ Standard release channel toolchain names have the following form: can be optionally appended with an archive date, as in `nightly-2014-12-18`, in which case the toolchain is downloaded from the archive for that date. -Finally, the host may be specified as a target triple. This is most useful for +Finally, the host may be specified as a target tuple. This is most useful for installing a 32-bit compiler on a 64-bit platform, or for installing the [MSVC-based toolchain][msvc-toolchain] on Windows. For example: @@ -35,7 +35,7 @@ installing a 32-bit compiler on a 64-bit platform, or for installing the $ rustup toolchain install stable-x86_64-pc-windows-msvc ``` -For convenience, elements of the target triple that are omitted will be +For convenience, elements of the target tuple that are omitted will be inferred, so the above could be written: ```console diff --git a/doc/user-guide/src/installation/windows.md b/doc/user-guide/src/installation/windows.md index 8b2d65c396..97499c049d 100644 --- a/doc/user-guide/src/installation/windows.md +++ b/doc/user-guide/src/installation/windows.md @@ -16,10 +16,10 @@ When targeting the GNU ABI, no additional software is strictly required for basi However, many library crates will not be able to compile until the full [MSYS2] with MinGW has been installed. By default `rustup` on Windows configures Rust to target the MSVC ABI, that is -a target triple of either `i686-pc-windows-msvc`, `x86_64-pc-windows-msvc`, or `aarch64-pc-windows-msvc` +a target tuple of either `i686-pc-windows-msvc`, `x86_64-pc-windows-msvc`, or `aarch64-pc-windows-msvc` depending on the CPU architecture of the host Windows OS. The toolchains that `rustup` chooses to install, unless told otherwise through the [toolchain -specification], will be compiled to run on that target triple host and will +specification], will be compiled to run on that target tuple host and will target that triple by default. You can change this behavior with `rustup set default-host` or during diff --git a/src/cli/common.rs b/src/cli/common.rs index 28d5bd857f..f36cf3287a 100644 --- a/src/cli/common.rs +++ b/src/cli/common.rs @@ -492,7 +492,7 @@ pub(crate) fn ignorable_error( } /// Returns an error for a toolchain if both conditions are met: -/// - The toolchain has an incompatible target triple, +/// - The toolchain has an incompatible target tuple, /// i.e. it might not be able to run on the host system. /// - The `force_non_host` flag is set to `false`. pub(crate) fn check_non_host_toolchain( diff --git a/src/cli/help.rs b/src/cli/help.rs index dd0d05bc16..8e55180f66 100644 --- a/src/cli/help.rs +++ b/src/cli/help.rs @@ -96,13 +96,13 @@ pub(crate) fn toolchain_help() -> String { archive date, as in `nightly-2014-12-18`, in which case the toolchain is downloaded from the archive for that date. - The host may be specified as a target triple. This is most useful + The host may be specified as a target tuple. This is most useful for installing a 32-bit compiler on a 64-bit platform, or for installing the [MSVC-based toolchain] on Windows. For example: {LITERAL}$ rustup toolchain install stable-x86_64-pc-windows-msvc{LITERAL:#} - For convenience, omitted elements of the target triple will be + For convenience, omitted elements of the target tuple will be inferred, so the above could be written: {LITERAL}$ rustup toolchain install stable-msvc{LITERAL:#} diff --git a/src/config.rs b/src/config.rs index 72e9006b66..c7256339fb 100644 --- a/src/config.rs +++ b/src/config.rs @@ -643,7 +643,7 @@ impl<'a> Cfg<'a> { // the base name in the error to help users) let resolved_name = &ToolchainName::try_from(toolchain_name_str)?; if !self.list_toolchains()?.iter().any(|s| s == resolved_name) { - return Err(anyhow!(format!("target triple in channel name '{name}'"))); + return Err(anyhow!(format!("target tuple in channel name '{name}'"))); } } diff --git a/src/dist/manifest.rs b/src/dist/manifest.rs index a31e05b31c..903a4c4235 100644 --- a/src/dist/manifest.rs +++ b/src/dist/manifest.rs @@ -436,7 +436,7 @@ impl Manifest { config: &Config, ) -> Result> { // Return all optional components of the "rust" package for the - // toolchain's target triple. + // toolchain's target tuple. let mut res = Vec::new(); let rust_pkg = self diff --git a/src/dist/manifestation.rs b/src/dist/manifestation.rs index 39d1afa9f7..4d71b583ca 100644 --- a/src/dist/manifestation.rs +++ b/src/dist/manifestation.rs @@ -313,7 +313,7 @@ impl Manifestation { // For historical reasons, the rust-installer component // names are not the same as the dist manifest component // names. Some are just the component name some are the - // component name plus the target triple. + // component name plus the target tuple. let name = component.name_in_manifest(); let short_name = component.short_name_in_manifest(); if let Some(c) = self.installation.find(&name)? { @@ -800,7 +800,7 @@ impl ComponentInstall { // For historical reasons, the rust-installer component // names are not the same as the dist manifest component // names. Some are just the component name some are the - // component name plus the target triple. + // component name plus the target tuple. let pkg_name = self.component.name_in_manifest(); let short_pkg_name = self.component.short_name_in_manifest(); let reader = self.status.unpack(utils::buffered(&self.installer)?); diff --git a/src/dist/mod.rs b/src/dist/mod.rs index 714ad43a1a..bfb6603bcd 100644 --- a/src/dist/mod.rs +++ b/src/dist/mod.rs @@ -145,9 +145,9 @@ struct ParsedToolchainDesc { } /// A toolchain descriptor from rustup's perspective. These contain -/// 'partial target triples', which allow toolchain names like -/// 'stable-msvc' to work. Partial target triples though are parsed -/// from a hardcoded set of known triples, whereas target triples +/// 'partial target tuples', which allow toolchain names like +/// 'stable-msvc' to work. Partial target tuples though are parsed +/// from a hardcoded set of known triples, whereas target tuples /// are nearly-arbitrary strings. #[derive(Debug, Clone, Eq, PartialEq, PartialOrd, Ord)] pub struct PartialToolchainDesc { @@ -569,9 +569,9 @@ impl TargetTriple { } // Otherwise we need to parse things let partial_self = PartialTargetTriple::new(&self.0) - .ok_or_else(|| anyhow!(format!("Unable to parse target triple: {}", self.0)))?; + .ok_or_else(|| anyhow!(format!("Unable to parse target tuple: {}", self.0)))?; let partial_other = PartialTargetTriple::new(&other.0) - .ok_or_else(|| anyhow!(format!("Unable to parse target triple: {}", other.0)))?; + .ok_or_else(|| anyhow!(format!("Unable to parse target tuple: {}", other.0)))?; // First obvious check is OS, if that doesn't match there's no chance let ret = if partial_self.os != partial_other.os { false diff --git a/src/dist/triple.rs b/src/dist/triple.rs index c1ee20c948..34aff1475c 100644 --- a/src/dist/triple.rs +++ b/src/dist/triple.rs @@ -77,7 +77,7 @@ mod test { let partial_target_triple = PartialTargetTriple::new(input); assert!( partial_target_triple.is_some(), - "expected `{input}` to create some partial target triple; got None" + "expected `{input}` to create some partial target tuple; got None" ); let expected = PartialTargetTriple { diff --git a/src/test/dist.rs b/src/test/dist.rs index d24462918a..65a94a6862 100644 --- a/src/test/dist.rs +++ b/src/test/dist.rs @@ -557,7 +557,7 @@ pub(crate) struct MockPackage { #[derive(Debug, Hash, Eq, PartialEq, Clone)] pub(crate) struct MockTargetedPackage { - // Target triple + // Target tuple pub target: String, // Whether the file actually exists (could be due to build failure) pub available: bool, diff --git a/tests/suite/cli_rustup.rs b/tests/suite/cli_rustup.rs index 184e8b2aba..21d3b86f5f 100644 --- a/tests/suite/cli_rustup.rs +++ b/tests/suite/cli_rustup.rs @@ -3419,7 +3419,7 @@ async fn file_override_with_target_info() { .remove_redactions(["[HOST_TRIPLE]"]) .with_stderr(snapbox::str![[r#" ... -error: target triple in channel name 'nightly-x86_64-unknown-linux-gnu' +error: target tuple in channel name 'nightly-x86_64-unknown-linux-gnu' ... "#]]) .is_err(); diff --git a/tests/suite/cli_rustup_ui/rustup_toolchain_cmd_help_flag.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_toolchain_cmd_help_flag.stdout.term.svg index 8cac8389ba..a3c2b5bc14 100644 --- a/tests/suite/cli_rustup_ui/rustup_toolchain_cmd_help_flag.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_toolchain_cmd_help_flag.stdout.term.svg @@ -96,7 +96,7 @@ - The host may be specified as a target triple. This is most useful + The host may be specified as a target tuple. This is most useful for installing a 32-bit compiler on a 64-bit platform, or for @@ -108,7 +108,7 @@ - For convenience, omitted elements of the target triple will be + For convenience, omitted elements of the target tuple will be inferred, so the above could be written: diff --git a/tests/suite/known_triples.rs b/tests/suite/known_triples.rs index 1e1aa6d2e0..c562b1a649 100644 --- a/tests/suite/known_triples.rs +++ b/tests/suite/known_triples.rs @@ -54,7 +54,7 @@ fn gen_known_triples() { /// /// # Discussion /// -/// The current model of target triples in Rustup requires some non-code knowledge to correctly generate the list. +/// The current model of target tuples in Rustup requires some non-code knowledge to correctly generate the list. /// For example, the parsing results of two 2-dash triples can be different: /// /// ```jsonc @@ -90,7 +90,7 @@ fn parse_triple(triple: &str) -> (&str, &str, &str) { env, ), _ => panic!( - "Internal error while parsing target triple `{triple}`, please file an issue at https://github.com/rust-lang/rustup/issues" + "Internal error while parsing target tuple `{triple}`, please file an issue at https://github.com/rust-lang/rustup/issues" ), } } From 131b3a40d807020062076ea8418c275c9d358962 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Tue, 23 Dec 2025 22:46:03 +0200 Subject: [PATCH 2/3] rename file to match new terminology --- tests/suite/{known_triples.rs => known_tuples.rs} | 0 tests/suite/mod.rs | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/suite/{known_triples.rs => known_tuples.rs} (100%) diff --git a/tests/suite/known_triples.rs b/tests/suite/known_tuples.rs similarity index 100% rename from tests/suite/known_triples.rs rename to tests/suite/known_tuples.rs diff --git a/tests/suite/mod.rs b/tests/suite/mod.rs index d36dba144b..296102d67a 100644 --- a/tests/suite/mod.rs +++ b/tests/suite/mod.rs @@ -9,5 +9,5 @@ mod cli_self_upd; mod cli_v1; mod cli_v2; mod dist_install; -mod known_triples; +mod known_tuples; mod static_roots; From 059655f8fd64859182b82c742912a9053e9bb2c4 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Tue, 23 Dec 2025 22:50:12 +0200 Subject: [PATCH 3/3] change test name to match new terminology --- tests/suite/known_tuples.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/suite/known_tuples.rs b/tests/suite/known_tuples.rs index c562b1a649..fd0b7385cc 100644 --- a/tests/suite/known_tuples.rs +++ b/tests/suite/known_tuples.rs @@ -3,7 +3,7 @@ use std::{collections::BTreeSet, io::Write}; use platforms::Platform; #[test] -fn gen_known_triples() { +fn gen_known_tuples() { let out_path = "src/dist/triple/known.rs"; let existing = std::fs::read_to_string(out_path).unwrap();