diff options
| author | Noratrieb <48135649+Noratrieb@users.noreply.github.com> | 2024-10-17 19:02:32 +0200 |
|---|---|---|
| committer | Noratrieb <48135649+Noratrieb@users.noreply.github.com> | 2024-11-02 21:29:59 +0100 |
| commit | a26450cf81d67d68d3c6157579f8d968349129e7 (patch) | |
| tree | 56d4a11c0cd7c096d42039953ec69d282cf4fc53 /compiler/rustc_metadata | |
| parent | 77d0b4ddfb92108a4c7d97c8f5052aa6abc787fa (diff) | |
| download | rust-a26450cf81d67d68d3c6157579f8d968349129e7.tar.gz rust-a26450cf81d67d68d3c6157579f8d968349129e7.zip | |
Rename target triple to target tuple in many places in the compiler
This changes the naming to the new naming, used by `--print target-tuple`. It does not change all locations, but many.
Diffstat (limited to 'compiler/rustc_metadata')
| -rw-r--r-- | compiler/rustc_metadata/src/creader.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/errors.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/locator.rs | 16 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/decoder.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/mod.rs | 4 |
5 files changed, 17 insertions, 17 deletions
diff --git a/compiler/rustc_metadata/src/creader.rs b/compiler/rustc_metadata/src/creader.rs index d2be6ae8d69..e525d94a0c1 100644 --- a/compiler/rustc_metadata/src/creader.rs +++ b/compiler/rustc_metadata/src/creader.rs @@ -30,7 +30,7 @@ use rustc_session::search_paths::PathKind; use rustc_span::edition::Edition; use rustc_span::symbol::{Ident, Symbol, sym}; use rustc_span::{DUMMY_SP, Span}; -use rustc_target::spec::{PanicStrategy, Target, TargetTriple}; +use rustc_target::spec::{PanicStrategy, Target, TargetTuple}; use tracing::{debug, info, trace}; use crate::errors; @@ -506,7 +506,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> { locator.reset(); locator.is_proc_macro = true; locator.target = &self.sess.host; - locator.triple = TargetTriple::from_triple(config::host_triple()); + locator.tuple = TargetTuple::from_tuple(config::host_tuple()); locator.filesearch = self.sess.host_filesearch(path_kind); let Some(host_result) = self.load(locator)? else { @@ -635,7 +635,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> { // FIXME: why is this condition necessary? It was adding in #33625 but I // don't know why and the original author doesn't remember ... let can_reuse_cratenum = - locator.triple == self.sess.opts.target_triple || locator.is_proc_macro; + locator.tuple == self.sess.opts.target_triple || locator.is_proc_macro; Ok(Some(if can_reuse_cratenum { let mut result = LoadResult::Loaded(library); for (cnum, data) in self.cstore.iter_crate_data() { diff --git a/compiler/rustc_metadata/src/errors.rs b/compiler/rustc_metadata/src/errors.rs index 6587125ec67..16684ae6f26 100644 --- a/compiler/rustc_metadata/src/errors.rs +++ b/compiler/rustc_metadata/src/errors.rs @@ -5,7 +5,7 @@ use rustc_errors::codes::*; use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level}; use rustc_macros::{Diagnostic, Subdiagnostic}; use rustc_span::{Span, Symbol, sym}; -use rustc_target::spec::{PanicStrategy, TargetTriple}; +use rustc_target::spec::{PanicStrategy, TargetTuple}; use crate::fluent_generated as fluent; use crate::locator::CrateFlavor; @@ -630,7 +630,7 @@ pub struct CannotFindCrate { pub current_crate: String, pub is_nightly_build: bool, pub profiler_runtime: Symbol, - pub locator_triple: TargetTriple, + pub locator_triple: TargetTuple, pub is_ui_testing: bool, } @@ -641,7 +641,7 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for CannotFindCrate { diag.arg("crate_name", self.crate_name); diag.arg("current_crate", self.current_crate); diag.arg("add_info", self.add_info); - diag.arg("locator_triple", self.locator_triple.triple()); + diag.arg("locator_triple", self.locator_triple.tuple()); diag.code(E0463); diag.span(self.span); if self.crate_name == sym::std || self.crate_name == sym::core { diff --git a/compiler/rustc_metadata/src/locator.rs b/compiler/rustc_metadata/src/locator.rs index f924ed48b6f..ddd97fc66f6 100644 --- a/compiler/rustc_metadata/src/locator.rs +++ b/compiler/rustc_metadata/src/locator.rs @@ -231,7 +231,7 @@ use rustc_session::search_paths::PathKind; use rustc_session::utils::CanonicalizedPath; use rustc_span::Span; use rustc_span::symbol::Symbol; -use rustc_target::spec::{Target, TargetTriple}; +use rustc_target::spec::{Target, TargetTuple}; use tracing::{debug, info}; use crate::creader::{Library, MetadataLoader}; @@ -252,7 +252,7 @@ pub(crate) struct CrateLocator<'a> { pub hash: Option<Svh>, extra_filename: Option<&'a str>, pub target: &'a Target, - pub triple: TargetTriple, + pub tuple: TargetTuple, pub filesearch: FileSearch<'a>, pub is_proc_macro: bool, @@ -338,7 +338,7 @@ impl<'a> CrateLocator<'a> { hash, extra_filename, target: &sess.target, - triple: sess.opts.target_triple.clone(), + tuple: sess.opts.target_triple.clone(), filesearch: sess.target_filesearch(path_kind), is_proc_macro: false, crate_rejections: CrateRejections::default(), @@ -677,8 +677,8 @@ impl<'a> CrateLocator<'a> { return None; } - if header.triple != self.triple { - info!("Rejecting via crate triple: expected {} got {}", self.triple, header.triple); + if header.triple != self.tuple { + info!("Rejecting via crate triple: expected {} got {}", self.tuple, header.triple); self.crate_rejections.via_triple.push(CrateMismatch { path: libpath.to_path_buf(), got: header.triple.to_string(), @@ -766,7 +766,7 @@ impl<'a> CrateLocator<'a> { CrateError::LocatorCombined(Box::new(CombinedLocatorError { crate_name: self.crate_name, root, - triple: self.triple, + triple: self.tuple, dll_prefix: self.target.dll_prefix.to_string(), dll_suffix: self.target.dll_suffix.to_string(), crate_rejections: self.crate_rejections, @@ -909,7 +909,7 @@ struct CrateRejections { pub(crate) struct CombinedLocatorError { crate_name: Symbol, root: Option<CratePaths>, - triple: TargetTriple, + triple: TargetTuple, dll_prefix: String, dll_suffix: String, crate_rejections: CrateRejections, @@ -1034,7 +1034,7 @@ impl CrateError { dcx.emit_err(errors::NoCrateWithTriple { span, crate_name, - locator_triple: locator.triple.triple(), + locator_triple: locator.triple.tuple(), add_info, found_crates, }); diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs index ebfd3c09fc1..87357b74c41 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder.rs @@ -770,7 +770,7 @@ impl MetadataBlob { root.stable_crate_id )?; writeln!(out, "proc_macro {:?}", root.proc_macro_data.is_some())?; - writeln!(out, "triple {}", root.header.triple.triple())?; + writeln!(out, "triple {}", root.header.triple.tuple())?; writeln!(out, "edition {}", root.edition)?; writeln!(out, "symbol_mangling_version {:?}", root.symbol_mangling_version)?; writeln!( diff --git a/compiler/rustc_metadata/src/rmeta/mod.rs b/compiler/rustc_metadata/src/rmeta/mod.rs index ab878760c00..949e26f5f60 100644 --- a/compiler/rustc_metadata/src/rmeta/mod.rs +++ b/compiler/rustc_metadata/src/rmeta/mod.rs @@ -38,7 +38,7 @@ use rustc_span::edition::Edition; use rustc_span::hygiene::{ExpnIndex, MacroKind, SyntaxContextData}; use rustc_span::symbol::{Ident, Symbol}; use rustc_span::{self, ExpnData, ExpnHash, ExpnId, Span}; -use rustc_target::spec::{PanicStrategy, TargetTriple}; +use rustc_target::spec::{PanicStrategy, TargetTuple}; use table::TableBuilder; use {rustc_ast as ast, rustc_attr as attr, rustc_hir as hir}; @@ -213,7 +213,7 @@ pub(crate) struct ProcMacroData { /// If you do modify this struct, also bump the [`METADATA_VERSION`] constant. #[derive(MetadataEncodable, MetadataDecodable)] pub(crate) struct CrateHeader { - pub(crate) triple: TargetTriple, + pub(crate) triple: TargetTuple, pub(crate) hash: Svh, pub(crate) name: Symbol, /// Whether this is the header for a proc-macro crate. |
