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.
This commit is contained in:
parent
77d0b4ddfb
commit
a26450cf81
32 changed files with 167 additions and 168 deletions
|
@ -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() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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!(
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue