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 <[email protected]>
Abhishek Chanda <[email protected]> Abhishek Chanda <[email protected]>
Abhijeet Bhagat <[email protected]>
Abroskin Alexander <[email protected]>
Adolfo Ochagavía <[email protected]>
Adolfo Ochagavía <[email protected]> <[email protected]>
Adrian Heine né Lang <[email protected]>
Adrien Tétar <[email protected]>
Ahmed Charles <[email protected]> <[email protected]>
Expand All @@ -36,6 +36,7 @@ Amanda Stjerna <[email protected]> <[email protected]>
Amanda Stjerna <[email protected]> <[email protected]>
Amanieu d'Antras <[email protected]> <[email protected]>
Amos Onn <[email protected]>
Amos Wenger <[email protected]> <[email protected]>
Ana-Maria Mihalache <[email protected]>
Anatoly Ikorsky <[email protected]>
Andre Bogus <[email protected]>
Expand Down Expand Up @@ -276,7 +277,8 @@ Irina Popa <[email protected]>
Ivan Ivaschenko <[email protected]>
ivan tkachenko <[email protected]>
J. J. Weber <[email protected]>
Jack Huey <[email protected]> <[email protected]>
Jack Huey <[email protected]> <[email protected]>
Jack Huey <[email protected]> <[email protected]>
Jacob <[email protected]>
Jacob Hoffman-Andrews <[email protected]> <[email protected]>
Jacob Greenfield <[email protected]>
Expand All @@ -292,6 +294,8 @@ Jakub Adam Wieczorek <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Beránek <[email protected]> <[email protected]>
James [Undefined] <[email protected]>
James Deng <[email protected]> <[email protected]>
Expand All @@ -303,6 +307,7 @@ Jamie Hill-Daniel <[email protected]> <[email protected]>
Jana Dönszelmann <[email protected]>
Jana Dönszelmann <[email protected]> <[email protected]>
Jana Dönszelmann <[email protected]> <[email protected]>
Jane Lusby <[email protected]> <[email protected]>
Jan-Erik Rediger <[email protected]> <[email protected]>
Jaro Fietz <[email protected]>
Jason Fager <[email protected]>
Expand All @@ -313,6 +318,7 @@ Jason Toffaletti <[email protected]> Jason Toffaletti <[email protected]>
Jauhien Piatlicki <[email protected]> Jauhien Piatlicki <[email protected]>
Jay True <[email protected]>
Jeremy Letang <[email protected]>
Jeremy Soller <[email protected]> <[email protected]>
Jeremy Sorensen <[email protected]>
Jeremy Stucki <[email protected]> <[email protected]>
Jeremy Stucki <[email protected]> <[email protected]>
Expand All @@ -336,6 +342,7 @@ John Kåre Alsaker <[email protected]>
John Kåre Alsaker <[email protected]> <[email protected]>
John Talling <[email protected]>
John Van Enk <[email protected]>
Jon Gjengset <[email protected]> <[email protected]>
Jonas Tepe <[email protected]>
Jonathan Bailey <[email protected]> <[email protected]>
Jonathan Chan Kwan Yin <[email protected]>
Expand Down Expand Up @@ -424,7 +431,7 @@ Malo Jaffré <[email protected]>
Manish Goregaokar <[email protected]>
Mara Bos <[email protected]>
Marcell Pardavi <[email protected]>
Marco Ieni <[email protected]>
Marco Ieni <[email protected]> <[email protected]>
Marcus Klaas de Vries <[email protected]>
Margaret Meyerhofer <[email protected]> <mmeyerho@andrew>
Marijn Schouten <[email protected]> <[email protected]>
Expand Down Expand Up @@ -531,6 +538,7 @@ 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]> <[email protected]>
Onur Özkan <[email protected]>
Ömer Sinan Ağacan <[email protected]>
Expand Down Expand Up @@ -591,6 +599,7 @@ Rusty Blitzerr <[email protected]>
RustyYato <[email protected]>
Ruud van Asseldonk <[email protected]> Ruud van Asseldonk <[email protected]>
Ryan Leung <[email protected]>
Ryan Levick <[email protected]> <[email protected]>
Ryan Scheel <[email protected]>
Ryan Sullivant <[email protected]>
Ryan Wiedemann <[email protected]>
Expand Down Expand Up @@ -686,6 +695,8 @@ Weihang Lo <[email protected]>
Weihang Lo <[email protected]> <[email protected]>
Wesley Wiser <[email protected]> <[email protected]>
whitequark <[email protected]>
Will Crichton <[email protected]> <[email protected]>
Will Crichton <[email protected]> <[email protected]>
William Ting <[email protected]> <[email protected]>
Wim Looman <[email protected]> <[email protected]>
Wim Looman <[email protected]> <[email protected]>
Expand All @@ -695,6 +706,8 @@ Xinye Tao <[email protected]>
Xuefeng Wu <[email protected]> Xuefeng Wu <[email protected]>
Xuefeng Wu <[email protected]> XuefengWu <[email protected]>
York Xiang <[email protected]>
Yoshua Wuyts <[email protected]> <[email protected]>
Yoshua Wuyts <[email protected]> <[email protected]>
Yotam Ofek <[email protected]> <[email protected]>
Youngsoo Son <[email protected]> <[email protected]>
Youngsuk Kim <[email protected]>
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