Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
12cde30
Add note for identifier with attempted hygiene violation
chenyukang Nov 7, 2025
5ed01e9
Switch hexagon targets to rust-lld
androm3da Nov 7, 2025
b827732
Enable std locking functions on AIX
amy-kwan Nov 7, 2025
fc20a28
Modify contributor email entries in .mailmap
hkBst Oct 28, 2025
a0ec766
rustc_target: move comment to macro
tamird Nov 7, 2025
556a8e2
rustc_target: rename Arch::{Uknown,Other}
tamird Nov 7, 2025
8585e9d
rustc_target: introduce Vendor
tamird Nov 5, 2025
fdced17
[bootstrap] Make `--open` option work with `doc src/tools/error_index…
GuillaumeGomez Nov 7, 2025
19036c9
rustc_target: introduce Abi
tamird Nov 5, 2025
8ddcc68
rustc_target: introduce Env
tamird Nov 5, 2025
2fc08be
rustc_target: introduce Os
tamird Nov 5, 2025
cd47df7
rustc_target: rehome target_abi comment
tamird Nov 7, 2025
bd23d55
`invalid_atomic_ordering`: also lint `update` & `try_update`
GrigorenkoPV Nov 6, 2025
c07f11a
don't completely reset `HeadUsages`
lcnr Nov 7, 2025
566a86b
show packed alignment in mir_transform_unaligned_packed_ref
21aslade Oct 20, 2025
67802e0
rustc_builtin_macros: rename bench parameter to avoid collisions with…
IntegralPilot Oct 30, 2025
9e1d2c6
Rollup merge of #147743 - 21aslade:packed-diagnostic, r=RalfJung
matthiaskrgr Nov 8, 2025
5d5f11c
Rollup merge of #148204 - hkBst:patch-5, r=nnethercote
matthiaskrgr Nov 8, 2025
8f3e35c
Rollup merge of #148279 - IntegralPilot:master, r=hkBst
matthiaskrgr Nov 8, 2025
e6765ba
Rollup merge of #148531 - tamird:vendor-enum, r=nnethercote
matthiaskrgr Nov 8, 2025
345e481
Rollup merge of #148601 - GrigorenkoPV:invalid_atomic_ordering, r=Kiv…
matthiaskrgr Nov 8, 2025
ce56c50
Rollup merge of #148612 - chenyukang:yukang-fix-148580-macro-hygiene-…
matthiaskrgr Nov 8, 2025
16d8c13
Rollup merge of #148613 - androm3da:bcain/hex_lld, r=JonathanBrouwer,…
matthiaskrgr Nov 8, 2025
426f64b
Rollup merge of #148619 - amy-kwan:amyk/AddLockingFunctions_AIX, r=wo…
matthiaskrgr Nov 8, 2025
26a8c0e
Rollup merge of #148644 - GuillaumeGomez:error-index-index-open, r=Ko…
matthiaskrgr Nov 8, 2025
cd9025b
Rollup merge of #148649 - lcnr:rarwwww, r=BoxyUwU
matthiaskrgr Nov 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 16 additions & 3 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Aaron Todd <github@opprobrio.us>
Abhishek Chanda <abhishek.becs@gmail.com> Abhishek Chanda <abhishek@cloudscaling.com>
Abhijeet Bhagat <abhijeet.bhagat@gmx.com>
Abroskin Alexander <arkweid@evilmartians.com>
Adolfo Ochagavía <aochagavia92@gmail.com>
Adolfo Ochagavía <aochagavia92@gmail.com> <github@adolfo.ochagavia.xyz>
Adrian Heine né Lang <mail@adrianheine.de>
Adrien Tétar <adri-from-59@hotmail.fr>
Ahmed Charles <ahmedcharles@gmail.com> <acharles@outlook.com>
Expand All @@ -36,6 +36,7 @@ Amanda Stjerna <mail@amandastjerna.se> <albin.stjerna@gmail.com>
Amanda Stjerna <mail@amandastjerna.se> <amanda.stjerna@it.uu.se>
Amanieu d'Antras <amanieu@gmail.com> <amanieu.dantras@huawei.com>
Amos Onn <amosonn@gmail.com>
Amos Wenger <amoswenger@gmail.com> <fasterthanlime@users.noreply.github.com>
Ana-Maria Mihalache <mihalacheana.maria@yahoo.com>
Anatoly Ikorsky <aikorsky@gmail.com>
Andre Bogus <bogusandre@gmail.com>
Expand Down Expand Up @@ -276,7 +277,8 @@ Irina Popa <irinagpopa@gmail.com>
Ivan Ivaschenko <defuz.net@gmail.com>
ivan tkachenko <me@ratijas.tk>
J. J. Weber <jjweber@gmail.com>
Jack Huey <jack.huey@umassmed.edu> <jackh726@gmail.com>
Jack Huey <jackh726@gmail.com> <jack.huey@umassmed.edu>
Jack Huey <jackh726@gmail.com> <31162821+jackh726@users.noreply.github.com>
Jacob <jacob.macritchie@gmail.com>
Jacob Hoffman-Andrews <rust@hoffman-andrews.com> <github@hoffman-andrews.com>
Jacob Greenfield <xales@naveria.com>
Expand All @@ -292,6 +294,8 @@ Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com>
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub.bukaj@yahoo.com>
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub@jakub.cc>
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakubw@jakubw.net>
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <ja.wieczorek@student.uw.edu.pl>
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <software@jacobadam.net>
Jakub Beránek <berykubik@gmail.com> <jakub.beranek@vsb.cz>
James [Undefined] <tpzker@thepuzzlemaker.info>
James Deng <cnjamesdeng@gmail.com> <cnJamesDeng@gmail.com>
Expand All @@ -303,6 +307,7 @@ Jamie Hill-Daniel <jamie@hill-daniel.co.uk> <clubby789@gmail.com>
Jana Dönszelmann <jana@donsz.nl>
Jana Dönszelmann <jana@donsz.nl> <jonathan@donsz.nl>
Jana Dönszelmann <jana@donsz.nl> <jonabent@gmail.com>
Jane Lusby <jlusby42@gmail.com> <jlusby@yaah.dev>
Jan-Erik Rediger <janerik@fnordig.de> <badboy@archlinux.us>
Jaro Fietz <jaro.fietz@gmx.de>
Jason Fager <jfager@gmail.com>
Expand All @@ -313,6 +318,7 @@ Jason Toffaletti <toffaletti@gmail.com> Jason Toffaletti <jason@topsy.com>
Jauhien Piatlicki <jauhien@gentoo.org> Jauhien Piatlicki <jpiatlicki@zertisa.com>
Jay True <glacjay@gmail.com>
Jeremy Letang <letang.jeremy@gmail.com>
Jeremy Soller <jackpot51@gmail.com> <jeremy@system76.com>
Jeremy Sorensen <jeremy.a.sorensen@gmail.com>
Jeremy Stucki <dev@jeremystucki.ch> <stucki.jeremy@gmail.com>
Jeremy Stucki <dev@jeremystucki.ch> <jeremy@myelin.ch>
Expand All @@ -336,6 +342,7 @@ John Kåre Alsaker <john.kare.alsaker@gmail.com>
John Kåre Alsaker <john.kare.alsaker@gmail.com> <zoxc32@gmail.com>
John Talling <inrustwetrust@users.noreply.github.com>
John Van Enk <vanenkj@gmail.com>
Jon Gjengset <jon@thesquareplanet.com> <jongje@amazon.com>
Jonas Tepe <jonasprogrammer@gmail.com>
Jonathan Bailey <jbailey@mozilla.com> <jbailey@jbailey-20809.local>
Jonathan Chan Kwan Yin <sofe2038@gmail.com>
Expand Down Expand Up @@ -424,7 +431,7 @@ Malo Jaffré <jaffre.malo@gmail.com>
Manish Goregaokar <manishsmail@gmail.com>
Mara Bos <m-ou.se@m-ou.se>
Marcell Pardavi <marcell.pardavi@gmail.com>
Marco Ieni <11428655+MarcoIeni@users.noreply.github.com>
Marco Ieni <marcoieni@rustfoundation.org> <11428655+MarcoIeni@users.noreply.github.com>
Marcus Klaas de Vries <mail@marcusklaas.nl>
Margaret Meyerhofer <mmeyerho@andrew.cmu.edu> <mmeyerho@andrew>
Marijn Schouten <mhkbst@gmail.com> <hkBst@users.noreply.github.com>
Expand Down Expand Up @@ -531,6 +538,7 @@ Oliver Scherer <oli-obk@users.noreply.github.com> <oliver.schneider@kit.edu>
Oliver Scherer <oli-obk@users.noreply.github.com> <obk8176014uqher834@olio-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com> <rustc-contact@oli-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com>
Onur Özkan <onurozkan.dev@outlook.com> <contact@onurozkan.dev>
Onur Özkan <onurozkan.dev@outlook.com> <work@onurozkan.dev>
Onur Özkan <onurozkan.dev@outlook.com>
Ömer Sinan Ağacan <omeragacan@gmail.com>
Expand Down Expand Up @@ -591,6 +599,7 @@ Rusty Blitzerr <rusty.blitzerr@gmail.com>
RustyYato <krishna.sd.2012@gmail.com>
Ruud van Asseldonk <dev@veniogames.com> Ruud van Asseldonk <ruuda@google.com>
Ryan Leung <rleungx@gmail.com>
Ryan Levick <me@ryanlevick.com> <rylev@users.noreply.github.com>
Ryan Scheel <ryan.havvy@gmail.com>
Ryan Sullivant <rsulli55@gmail.com>
Ryan Wiedemann <Ryan1729@gmail.com>
Expand Down Expand Up @@ -686,6 +695,8 @@ Weihang Lo <me@weihanglo.tw>
Weihang Lo <me@weihanglo.tw> <weihanglo@users.noreply.github.com>
Wesley Wiser <wwiser@gmail.com> <wesleywiser@microsoft.com>
whitequark <whitequark@whitequark.org>
Will Crichton <crichton.will@gmail.com> <wcrichto@stanford.edu>
Will Crichton <crichton.will@gmail.com> <wcrichto@cs.stanford.edu>
William Ting <io@williamting.com> <william.h.ting@gmail.com>
Wim Looman <wim@nemo157.com> <rust-lang@nemo157.com>
Wim Looman <wim@nemo157.com> <git@nemo157.com>
Expand All @@ -695,6 +706,8 @@ Xinye Tao <xy.tao@outlook.com>
Xuefeng Wu <benewu@gmail.com> Xuefeng Wu <xfwu@thoughtworks.com>
Xuefeng Wu <benewu@gmail.com> XuefengWu <benewu@gmail.com>
York Xiang <bombless@126.com>
Yoshua Wuyts <yoshuawuyts@gmail.com> <yoshuawuyts+github@gmail.com>
Yoshua Wuyts <yoshuawuyts@gmail.com> <2467194+yoshuawuyts@users.noreply.github.com>
Yotam Ofek <yotam.ofek@gmail.com> <yotamofek@microsoft.com>
Youngsoo Son <ysson83@gmail.com> <ysoo.son@samsung.com>
Youngsuk Kim <joseph942010@gmail.com>
Expand Down
14 changes: 7 additions & 7 deletions compiler/rustc_builtin_macros/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,30 +207,30 @@ pub(crate) fn expand_test_or_bench(
};

let test_fn = if is_bench {
// A simple ident for a lambda
let b = Ident::from_str_and_span("b", attr_sp);

// avoid name collisions by using the function name within the identifier, see bug #148275
let bencher_param =
Ident::from_str_and_span(&format!("__bench_{}", fn_.ident.name), attr_sp);
cx.expr_call(
sp,
cx.expr_path(test_path("StaticBenchFn")),
thin_vec![
// #[coverage(off)]
// |b| self::test::assert_test_result(
// |__bench_fn_name| self::test::assert_test_result(
coverage_off(cx.lambda1(
sp,
cx.expr_call(
sp,
cx.expr_path(test_path("assert_test_result")),
thin_vec![
// super::$test_fn(b)
// super::$test_fn(__bench_fn_name)
cx.expr_call(
ret_ty_sp,
cx.expr_path(cx.path(sp, vec![fn_.ident])),
thin_vec![cx.expr_ident(sp, b)],
thin_vec![cx.expr_ident(sp, bencher_param)],
),
],
),
b,
bencher_param,
)), // )
],
)
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_cranelift/src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_session::Session;
use rustc_span::source_map::Spanned;
use rustc_target::callconv::{FnAbi, PassMode};
use rustc_target::spec::Arch;
use rustc_target::spec::{Arch, Vendor};
use smallvec::SmallVec;

use self::pass_mode::*;
Expand Down Expand Up @@ -788,8 +788,8 @@ pub(crate) fn codegen_drop<'tcx>(
pub(crate) fn lib_call_arg_param(tcx: TyCtxt<'_>, ty: Type, is_signed: bool) -> AbiParam {
let param = AbiParam::new(ty);
if ty.is_int() && u64::from(ty.bits()) < tcx.data_layout.pointer_size().bits() {
match (&tcx.sess.target.arch, tcx.sess.target.vendor.as_ref()) {
(Arch::X86_64, _) | (Arch::AArch64, "apple") => match (ty, is_signed) {
match (&tcx.sess.target.arch, &tcx.sess.target.vendor) {
(Arch::X86_64, _) | (Arch::AArch64, Vendor::Apple) => match (ty, is_signed) {
(types::I8 | types::I16, true) => param.sext(),
(types::I8 | types::I16, false) => param.uext(),
_ => param,
Expand Down
28 changes: 14 additions & 14 deletions compiler/rustc_codegen_cranelift/src/codegen_f16_f128.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use rustc_target::spec::Arch;
use rustc_target::spec::{Arch, Vendor};

use crate::prelude::*;

pub(crate) fn f16_to_f32(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
let (value, arg_ty) =
if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == Arch::X86_64 {
if fx.tcx.sess.target.vendor == Vendor::Apple && fx.tcx.sess.target.arch == Arch::X86_64 {
(
fx.bcx.ins().bitcast(types::I16, MemFlags::new(), value),
lib_call_arg_param(fx.tcx, types::I16, false),
Expand All @@ -21,12 +21,12 @@ fn f16_to_f64(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
}

pub(crate) fn f32_to_f16(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
let ret_ty = if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == Arch::X86_64
{
types::I16
} else {
types::F16
};
let ret_ty =
if fx.tcx.sess.target.vendor == Vendor::Apple && fx.tcx.sess.target.arch == Arch::X86_64 {
types::I16
} else {
types::F16
};
let ret = fx.lib_call(
"__truncsfhf2",
vec![AbiParam::new(types::F32)],
Expand All @@ -37,12 +37,12 @@ pub(crate) fn f32_to_f16(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value
}

fn f64_to_f16(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
let ret_ty = if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == Arch::X86_64
{
types::I16
} else {
types::F16
};
let ret_ty =
if fx.tcx.sess.target.vendor == Vendor::Apple && fx.tcx.sess.target.arch == Arch::X86_64 {
types::I16
} else {
types::F16
};
let ret = fx.lib_call(
"__truncdfhf2",
vec![AbiParam::new(types::F64)],
Expand Down
16 changes: 8 additions & 8 deletions compiler/rustc_codegen_cranelift/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
use rustc_session::Session;
use rustc_session::config::OutputFilenames;
use rustc_span::{Symbol, sym};
use rustc_target::spec::Arch;
use rustc_target::spec::{Abi, Arch, Env, Os};

pub use crate::config::*;
use crate::prelude::*;
Expand Down Expand Up @@ -185,15 +185,15 @@ impl CodegenBackend for CraneliftCodegenBackend {
fn target_config(&self, sess: &Session) -> TargetConfig {
// FIXME return the actually used target features. this is necessary for #[cfg(target_feature)]
let target_features = match sess.target.arch {
Arch::X86_64 if sess.target.os != "none" => {
Arch::X86_64 if sess.target.os != Os::None => {
// x86_64 mandates SSE2 support and rustc requires the x87 feature to be enabled
vec![sym::fxsr, sym::sse, sym::sse2, Symbol::intern("x87")]
}
Arch::AArch64 => match &*sess.target.os {
"none" => vec![],
Arch::AArch64 => match &sess.target.os {
Os::None => vec![],
// On macOS the aes, sha2 and sha3 features are enabled by default and ring
// fails to compile on macOS when they are not present.
"macos" => vec![sym::neon, sym::aes, sym::sha2, sym::sha3],
Os::MacOs => vec![sym::neon, sym::aes, sym::sha2, sym::sha3],
// AArch64 mandates Neon support
_ => vec![sym::neon],
},
Expand All @@ -214,9 +214,9 @@ impl CodegenBackend for CraneliftCodegenBackend {
// targets due to GCC using a different ABI than LLVM. Therefore `f16` won't be
// available when using a LLVM-built sysroot.
Arch::X86_64
if sess.target.os == "windows"
&& sess.target.env == "gnu"
&& sess.target.abi != "llvm" =>
if sess.target.os == Os::Windows
&& sess.target.env == Env::Gnu
&& sess.target.abi != Abi::Llvm =>
{
false
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use rustc_codegen_ssa::common;
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, HasTypingEnv};
use rustc_middle::ty::{self, Instance, TypeVisitableExt};
use rustc_target::spec::Arch;
use rustc_target::spec::{Arch, Env};
use tracing::debug;

use crate::context::CodegenCx;
Expand Down Expand Up @@ -145,7 +145,7 @@ pub(crate) fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'t
if cx.use_dll_storage_attrs
&& let Some(library) = tcx.native_library(instance_def_id)
&& library.kind.is_dllimport()
&& !matches!(tcx.sess.target.env.as_ref(), "gnu" | "uclibc")
&& !matches!(tcx.sess.target.env, Env::Gnu | Env::Uclibc)
{
llvm::set_dllimport_storage_class(llfn);
}
Expand Down
14 changes: 7 additions & 7 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use rustc_span::source_map::Spanned;
use rustc_span::{DUMMY_SP, Span, Symbol};
use rustc_symbol_mangling::mangle_internal_symbol;
use rustc_target::spec::{
Arch, HasTargetSpec, RelocModel, SmallDataThresholdSupport, Target, TlsModel,
Abi, Arch, Env, HasTargetSpec, Os, RelocModel, SmallDataThresholdSupport, Target, TlsModel,
};
use smallvec::SmallVec;

Expand Down Expand Up @@ -335,9 +335,9 @@ pub(crate) unsafe fn create_module<'ll>(

// Control Flow Guard is currently only supported by MSVC and LLVM on Windows.
if sess.target.is_like_msvc
|| (sess.target.options.os == "windows"
&& sess.target.options.env == "gnu"
&& sess.target.options.abi == "llvm")
|| (sess.target.options.os == Os::Windows
&& sess.target.options.env == Env::Gnu
&& sess.target.options.abi == Abi::Llvm)
{
match sess.opts.cg.control_flow_guard {
CFGuard::Disabled => {}
Expand Down Expand Up @@ -669,7 +669,7 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
/// This corresponds to the `-fobjc-abi-version=` flag in Clang / GCC.
pub(crate) fn objc_abi_version(&self) -> u32 {
assert!(self.tcx.sess.target.is_like_darwin);
if self.tcx.sess.target.arch == Arch::X86 && self.tcx.sess.target.os == "macos" {
if self.tcx.sess.target.arch == Arch::X86 && self.tcx.sess.target.os == Os::MacOs {
// 32-bit x86 macOS uses ABI version 1 (a.k.a. the "fragile ABI").
1
} else {
Expand Down Expand Up @@ -710,7 +710,7 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
},
);

if self.tcx.sess.target.env == "sim" {
if self.tcx.sess.target.env == Env::Sim {
llvm::add_module_flag_u32(
self.llmod,
llvm::ModuleFlagMergeBehavior::Error,
Expand Down Expand Up @@ -963,7 +963,7 @@ impl<'ll> CodegenCx<'ll, '_> {
return eh_catch_typeinfo;
}
let tcx = self.tcx;
assert!(self.sess().target.os == "emscripten");
assert!(self.sess().target.os == Os::Emscripten);
let eh_catch_typeinfo = match tcx.lang_items().eh_catch_typeinfo() {
Some(def_id) => self.get_static(def_id),
_ => {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use rustc_middle::{bug, span_bug};
use rustc_span::{Span, Symbol, sym};
use rustc_symbol_mangling::{mangle_internal_symbol, symbol_name_for_instance_in_crate};
use rustc_target::callconv::PassMode;
use rustc_target::spec::Os;
use tracing::debug;

use crate::abi::FnAbiLlvmExt;
Expand Down Expand Up @@ -681,7 +682,7 @@ fn catch_unwind_intrinsic<'ll, 'tcx>(
codegen_msvc_try(bx, try_func, data, catch_func, dest);
} else if wants_wasm_eh(bx.sess()) {
codegen_wasm_try(bx, try_func, data, catch_func, dest);
} else if bx.sess().target.os == "emscripten" {
} else if bx.sess().target.os == Os::Emscripten {
codegen_emcc_try(bx, try_func, data, catch_func, dest);
} else {
codegen_gnu_try(bx, try_func, data, catch_func, dest);
Expand Down
Loading
Loading