Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #132485

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Alexis Beingessner <[email protected]>
Alfie John <[email protected]> Alfie John <[email protected]>
Alona Enraght-Moony <[email protected]> <[email protected]>
Alona Enraght-Moony <[email protected]> <[email protected]>
Alona Enraght-Moony <[email protected]> <[email protected]>
Amanda Stjerna <[email protected]> <[email protected]>
Amanda Stjerna <[email protected]> <[email protected]>
Amos Onn <[email protected]>
Expand Down Expand Up @@ -75,6 +76,7 @@ Benjamin Jackman <[email protected]>
Benoît Cortier <[email protected]>
Bheesham Persaud <[email protected]> Bheesham Persaud <[email protected]>
bjorn3 <[email protected]> <[email protected]>
bjorn3 <[email protected]> <[email protected]>
Björn Steinbrink <[email protected]> <[email protected]>
blake2-ppc <[email protected]> <blake2-ppc>
blyxyas <[email protected]> Alejandra González <[email protected]>
Expand Down Expand Up @@ -172,6 +174,7 @@ Dzmitry Malyshau <[email protected]>
E. Dunham <[email protected]> edunham <[email protected]>
Ed Barnard <[email protected]>
Eduard-Mihai Burtescu <[email protected]>
Eduard-Mihai Burtescu <[email protected]> <[email protected]>
Eduardo Bautista <[email protected]> <=>
Eduardo Bautista <[email protected]> <[email protected]>
Eduardo Broto <[email protected]>
Expand All @@ -186,6 +189,7 @@ Erick Tryzelaar <[email protected]> <[email protected]>
Erik Desjardins <[email protected]>
Erik Jensen <[email protected]>
Erin Power <[email protected]>
Erin Power <[email protected]> <[email protected]>
Erin Power <[email protected]> <[email protected]>
Erin Power <[email protected]> <[email protected]>
Esteban Küber <[email protected]>
Expand All @@ -198,6 +202,7 @@ F001 <[email protected]>
Fabian Kössel <[email protected]>
Falco Hirschenberger <[email protected]> <[email protected]>
Felix S. Klock II <[email protected]> Felix S Klock II <[email protected]>
Felix S. Klock II <[email protected]> <[email protected]>
Félix Saparelli <[email protected]>
Flaper Fesp <[email protected]>
Florian Berger <[email protected]>
Expand Down Expand Up @@ -245,7 +250,7 @@ Irina Popa <[email protected]>
Ivan Ivaschenko <[email protected]>
ivan tkachenko <[email protected]>
J. J. Weber <[email protected]>
Jack Huey <[email protected]>
Jack Huey <[email protected]> <[email protected]>
Jacob <[email protected]>
Jacob Greenfield <[email protected]>
Jacob Pratt <[email protected]> <[email protected]>
Expand Down Expand Up @@ -292,6 +297,7 @@ John Clements <[email protected]> <[email protected]>
John Hodge <[email protected]> John Hodge <[email protected]>
John Hörnvall <[email protected]>
John Kåre Alsaker <[email protected]>
John Kåre Alsaker <[email protected]> <[email protected]>
John Talling <[email protected]>
John Van Enk <[email protected]>
Jonas Tepe <[email protected]>
Expand Down Expand Up @@ -368,6 +374,7 @@ Lukas Lueg <[email protected]>
Luke Metz <[email protected]>
Luqman Aden <[email protected]> <[email protected]>
Luqman Aden <[email protected]> <[email protected]>
Luqman Aden <[email protected]> <[email protected]>
Lzu Tao <[email protected]>
Maik Klein <[email protected]>
Malo Jaffré <[email protected]>
Expand Down Expand Up @@ -409,6 +416,7 @@ mental <[email protected]>
mibac138 <[email protected]>
Michael Williams <[email protected]>
Michael Woerister <michaelwoerister@posteo> <michaelwoerister@gmail>
Michael Woerister <michaelwoerister@posteo> <[email protected]>
Michael Woerister <michaelwoerister@posteo> <[email protected]>
Michael Woerister <michaelwoerister@posteo> <[email protected]>
Michael Zhang <[email protected]>
Expand All @@ -422,6 +430,7 @@ Ms2ger <[email protected]> <[email protected]>
msizanoen1 <[email protected]>
Mukilan Thiagarajan <[email protected]>
Nadrieril Feneanar <[email protected]>
Nadrieril Feneanar <[email protected]> <[email protected]>
NAKASHIMA, Makoto <[email protected]> <[email protected]>
NAKASHIMA, Makoto <[email protected]> <[email protected]>
Nathan Ringo <[email protected]>
Expand All @@ -442,6 +451,8 @@ Niclas Schwarzlose <[email protected]>
Nicolas Abram <[email protected]>
Nicole Mazzuca <[email protected]>
Noratrieb <[email protected]> <[email protected]>
Noratrieb <[email protected]> <[email protected]>
Noratrieb <[email protected]> <[email protected]>
Nif Ward <[email protected]>
Nika Layzell <[email protected]> <[email protected]>
NODA Kai <[email protected]>
Expand All @@ -460,6 +471,7 @@ Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]>
Onur Özkan <[email protected]> <[email protected]>
Onur Özkan <[email protected]>
Expand Down Expand Up @@ -496,6 +508,7 @@ Raphaël Huchet <[email protected]>
rChaser53 <[email protected]>
Rémy Rakic <[email protected]>
Rémy Rakic <[email protected]> <[email protected]>
Rémy Rakic <[email protected]> <[email protected]>
Renato Riccieri Santos Zannon <[email protected]>
Richard Diamond <[email protected]> <[email protected]>
Ricky Hosfelt <[email protected]>
Expand Down Expand Up @@ -525,6 +538,7 @@ Samuel Tardieu <[email protected]>
Santiago Pastorino <[email protected]>
Santiago Pastorino <[email protected]> <[email protected]>
Scott McMurray <[email protected]>
Scott McMurray <[email protected]> <[email protected]>
Scott Olson <[email protected]> Scott Olson <[email protected]>
Sean Gillespie <[email protected]> swgillespie <[email protected]>
Seiichi Uchida <[email protected]>
Expand All @@ -536,6 +550,7 @@ Shyam Sundar B <[email protected]>
Simon Barber-Dueck <[email protected]> Simon BD <simon@server>
Simon Sapin <[email protected]> <[email protected]>
Simonas Kazlauskas <[email protected]> Simonas Kazlauskas <[email protected]>
Simonas Kazlauskas <[email protected]> <[email protected]>
Siva Prasad <[email protected]>
Smittyvb <[email protected]>
Srinivas Reddy Thatiparthy <[email protected]>
Expand All @@ -556,6 +571,8 @@ Tatsuyuki Ishi <[email protected]>
Tau Gärtli <[email protected]> <[email protected]>
Tero Hänninen <[email protected]> Tero Hänninen <[email protected]>
The8472 <[email protected]>
The8472 <[email protected]> <[email protected]>
The8472 <[email protected]> <[email protected]>
Theo Belaire <[email protected]> Theo Belaire <[email protected]>
Theodore Luo Wang <[email protected]>
Thiago Pontes <[email protected]> thiagopnts <[email protected]>
Expand Down Expand Up @@ -593,7 +610,8 @@ Waffle Lapkin <[email protected]>
Wesley Wiser <[email protected]> <[email protected]>
whitequark <[email protected]>
William Ting <[email protected]> <[email protected]>
Wim Looman <[email protected]>
Wim Looman <[email protected]> <[email protected]>
Wim Looman <[email protected]> <[email protected]>
Without Boats <[email protected]>
Without Boats <[email protected]> <[email protected]>
Xinye Tao <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/src/global_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ impl GlobalAsmConfig {
GlobalAsmConfig {
assembler: crate::toolchain::get_toolchain_binary(tcx.sess, "as"),
target: match &tcx.sess.opts.target_triple {
rustc_target::spec::TargetTriple::TargetTriple(triple) => triple.clone(),
rustc_target::spec::TargetTriple::TargetJson { path_for_rustdoc, .. } => {
rustc_target::spec::TargetTuple::TargetTuple(triple) => triple.clone(),
rustc_target::spec::TargetTuple::TargetJson { path_for_rustdoc, .. } => {
path_for_rustdoc.to_str().unwrap().to_owned()
}
},
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl<'gcc, 'tcx> StaticCodegenMethods for CodegenCx<'gcc, 'tcx> {

// Wasm statics with custom link sections get special treatment as they
// go into custom sections of the wasm executable.
if self.tcx.sess.opts.target_triple.triple().starts_with("wasm32") {
if self.tcx.sess.opts.target_triple.tuple().starts_with("wasm32") {
if let Some(_section) = attrs.link_section {
unimplemented!();
}
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ fn create_section_with_flags_asm(section_name: &str, section_flags: &str, data:
}

fn target_is_apple(cgcx: &CodegenContext<LlvmCodegenBackend>) -> bool {
let triple = cgcx.opts.target_triple.triple();
let triple = cgcx.opts.target_triple.tuple();
triple.contains("-ios")
|| triple.contains("-darwin")
|| triple.contains("-tvos")
Expand All @@ -954,7 +954,7 @@ fn target_is_apple(cgcx: &CodegenContext<LlvmCodegenBackend>) -> bool {
}

fn target_is_aix(cgcx: &CodegenContext<LlvmCodegenBackend>) -> bool {
cgcx.opts.target_triple.triple().contains("-aix")
cgcx.opts.target_triple.tuple().contains("-aix")
}

pub(crate) fn bitcode_section_name(cgcx: &CodegenContext<LlvmCodegenBackend>) -> &'static CStr {
Expand Down Expand Up @@ -1030,7 +1030,7 @@ unsafe fn embed_bitcode(
let is_aix = target_is_aix(cgcx);
let is_apple = target_is_apple(cgcx);
unsafe {
if is_apple || is_aix || cgcx.opts.target_triple.triple().starts_with("wasm") {
if is_apple || is_aix || cgcx.opts.target_triple.tuple().starts_with("wasm") {
// We don't need custom section flags, create LLVM globals.
let llconst = common::bytes_in_context(llcx, bitcode);
let llglobal = llvm::LLVMAddGlobal(
Expand Down
8 changes: 3 additions & 5 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ fn link_natively(
{
let is_vs_installed = windows_registry::find_vs_version().is_ok();
let has_linker = windows_registry::find_tool(
sess.opts.target_triple.triple(),
sess.opts.target_triple.tuple(),
"link.exe",
)
.is_some();
Expand Down Expand Up @@ -1322,10 +1322,8 @@ fn link_sanitizer_runtime(
} else {
let default_sysroot =
filesearch::get_or_default_sysroot().expect("Failed finding sysroot");
let default_tlib = filesearch::make_target_lib_path(
&default_sysroot,
sess.opts.target_triple.triple(),
);
let default_tlib =
filesearch::make_target_lib_path(&default_sysroot, sess.opts.target_triple.tuple());
default_tlib
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub(crate) fn get_linker<'a>(
self_contained: bool,
target_cpu: &'a str,
) -> Box<dyn Linker + 'a> {
let msvc_tool = windows_registry::find_tool(sess.opts.target_triple.triple(), "link.exe");
let msvc_tool = windows_registry::find_tool(sess.opts.target_triple.tuple(), "link.exe");

// If our linker looks like a batch script on Windows then to execute this
// we'll need to spawn `cmd` explicitly. This is primarily done to handle
Expand Down
15 changes: 8 additions & 7 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ use rustc_session::{EarlyDiagCtxt, Session, config, filesearch};
use rustc_span::FileName;
use rustc_span::source_map::FileLoader;
use rustc_target::json::ToJson;
use rustc_target::spec::{Target, TargetTriple};
use rustc_target::spec::{Target, TargetTuple};
use time::OffsetDateTime;
use tracing::trace;

Expand Down Expand Up @@ -730,6 +730,7 @@ fn print_crate_info(
targets.sort_unstable();
println_info!("{}", targets.join("\n"));
}
HostTuple => println_info!("{}", rustc_session::config::host_tuple()),
Sysroot => println_info!("{}", sess.sysroot.display()),
TargetLibdir => println_info!("{}", sess.target_tlib_path.dir.display()),
TargetSpec => {
Expand All @@ -738,7 +739,7 @@ fn print_crate_info(
AllTargetSpecs => {
let mut targets = BTreeMap::new();
for name in rustc_target::spec::TARGETS {
let triple = TargetTriple::from_triple(name);
let triple = TargetTuple::from_tuple(name);
let target = Target::expect_builtin(&triple);
targets.insert(name, target.to_json());
}
Expand Down Expand Up @@ -918,7 +919,7 @@ pub fn version_at_macro_invocation(
safe_println!("binary: {binary}");
safe_println!("commit-hash: {commit_hash}");
safe_println!("commit-date: {commit_date}");
safe_println!("host: {}", config::host_triple());
safe_println!("host: {}", config::host_tuple());
safe_println!("release: {release}");

let debug_flags = matches.opt_strs("Z");
Expand Down Expand Up @@ -1495,7 +1496,7 @@ fn report_ice(
}

let version = util::version_str!().unwrap_or("unknown_version");
let triple = config::host_triple();
let tuple = config::host_tuple();

static FIRST_PANIC: AtomicBool = AtomicBool::new(true);

Expand All @@ -1505,7 +1506,7 @@ fn report_ice(
Ok(mut file) => {
dcx.emit_note(session_diagnostics::IcePath { path: path.clone() });
if FIRST_PANIC.swap(false, Ordering::SeqCst) {
let _ = write!(file, "\n\nrustc version: {version}\nplatform: {triple}");
let _ = write!(file, "\n\nrustc version: {version}\nplatform: {tuple}");
}
Some(file)
}
Expand All @@ -1518,12 +1519,12 @@ fn report_ice(
.map(PathBuf::from)
.map(|env_var| session_diagnostics::IcePathErrorEnv { env_var }),
});
dcx.emit_note(session_diagnostics::IceVersion { version, triple });
dcx.emit_note(session_diagnostics::IceVersion { version, triple: tuple });
None
}
}
} else {
dcx.emit_note(session_diagnostics::IceVersion { version, triple });
dcx.emit_note(session_diagnostics::IceVersion { version, triple: tuple });
None
};

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_errors/src/diagnostic_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc_macros::Subdiagnostic;
use rustc_span::Span;
use rustc_span::edition::Edition;
use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent, Symbol};
use rustc_target::spec::{PanicStrategy, SplitDebuginfo, StackProtector, TargetTriple};
use rustc_target::spec::{PanicStrategy, SplitDebuginfo, StackProtector, TargetTuple};
use rustc_type_ir::{ClosureKind, FloatTy};
use {rustc_ast as ast, rustc_hir as hir};

Expand Down Expand Up @@ -89,7 +89,7 @@ into_diag_arg_using_display!(
MacroRulesNormalizedIdent,
ParseIntError,
StackProtector,
&TargetTriple,
&TargetTuple,
SplitDebuginfo,
ExitStatus,
ErrCode,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ fn fatally_break_rust(tcx: TyCtxt<'_>, span: Span) -> ! {
"we would appreciate a joke overview: \
https://github.com/rust-lang/rust/issues/43162#issuecomment-320764675",
);
diag.note(format!("rustc {} running on {}", tcx.sess.cfg_version, config::host_triple(),));
diag.note(format!("rustc {} running on {}", tcx.sess.cfg_version, config::host_tuple(),));
if let Some((flags, excluded_cargo_defaults)) = rustc_session::utils::extra_compiler_flags() {
diag.note(format!("compiler flags: {}", flags.join(" ")));
if excluded_cargo_defaults {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_interface/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc_data_structures::sync;
use rustc_metadata::{DylibError, load_symbol_from_dylib};
use rustc_middle::ty::CurrentGcx;
use rustc_parse::validate_attr;
use rustc_session::config::{Cfg, OutFileName, OutputFilenames, OutputTypes, host_triple};
use rustc_session::config::{Cfg, OutFileName, OutputFilenames, OutputTypes, host_tuple};
use rustc_session::filesearch::sysroot_candidates;
use rustc_session::lint::{self, BuiltinLintDiag, LintBuffer};
use rustc_session::output::{CRATE_TYPES, categorize_crate_type};
Expand Down Expand Up @@ -310,7 +310,7 @@ fn get_codegen_sysroot(
"cannot load the default codegen backend twice"
);

let target = host_triple();
let target = host_tuple();
let sysroot_candidates = sysroot_candidates();

let sysroot = iter::once(sysroot)
Expand Down
10 changes: 8 additions & 2 deletions compiler/rustc_lint/src/non_local_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,15 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
// };
// };
// ```
//
// It isn't possible to mix a impl in a module with const-anon, but an item can
// be put inside a module and referenced by a impl so we also have to treat the
// item parent as transparent to module and for consistency we have to do the same
// for impl, otherwise the item-def and impl-def won't have the same parent.
let outermost_impl_parent = peel_parent_while(cx.tcx, parent, |tcx, did| {
tcx.def_kind(did) == DefKind::Const
&& tcx.opt_item_name(did) == Some(kw::Underscore)
tcx.def_kind(did) == DefKind::Mod
|| (tcx.def_kind(did) == DefKind::Const
&& tcx.opt_item_name(did) == Some(kw::Underscore))
});

// 2. We check if any of the paths reference a the `impl`-parent.
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_metadata/src/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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() {
Expand Down
Loading
Loading