Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ee2a5df
avoid trivial `fn map_bound` validations
lcnr Oct 2, 2026
6e2fd19
Fix typo
WiktorPrzetacznik Aug 31, 2024
02d1672
Introduce layout section in Saturating
WiktorPrzetacznik Aug 31, 2024
4613f38
Send -fno-lto when linker plugin LTO is not requested to avoid having…
antoyo Jul 25, 2026
fa05b78
Distinguish `repr(C)` ZSTs from others in ABI compatibility rules
Jules-Bertholet Jun 16, 2026
bc1da7a
yeet compare-mode-coherence
lcnr Oct 2, 2026
180aa92
preserve overflow in builtin Field candidates
amirHdev Sep 5, 2026
a785a9f
make Field base kind invariant explicit
amirHdev Oct 2, 2026
01ad9b7
update Field UI stderr after diagnostic change
amirHdev Oct 2, 2026
df07926
explicitly handle tests that pass with -Znext-solver
lcnr Oct 2, 2026
c76b523
Update the minimum external LLVM to 22
cuviper Sep 30, 2026
e9b0eeb
intrinsics: Rename `abort` to `abort_immediate`
tgross35 Sep 30, 2026
220201e
Rollup merge of #163655 - lcnr:next-solver-pass-tests, r=lqd
JonathanBrouwer Oct 2, 2026
adb1584
Rollup merge of #159924 - antoyo:fix/fno-lto, r=bjorn3
JonathanBrouwer Oct 2, 2026
e70aee9
Rollup merge of #163572 - cuviper:min-llvm-22, r=nikic
JonathanBrouwer Oct 2, 2026
764a91c
Rollup merge of #129822 - WiktorPrzetacznik:docs-guarantees-update, r…
JonathanBrouwer Oct 2, 2026
3bcfbad
Rollup merge of #157973 - Jules-Bertholet:distinguish-c-zst-docs, r=R…
JonathanBrouwer Oct 2, 2026
bb9cac2
Rollup merge of #162332 - amirHdev:fix-field-projection-overflow, r=lcnr
JonathanBrouwer Oct 2, 2026
99f6df7
Rollup merge of #163574 - tgross35:intrinsics-abort-rename, r=clarfon…
JonathanBrouwer Oct 2, 2026
242c2f4
Rollup merge of #163638 - lcnr:map-bound-no-validate, r=oli-obk
JonathanBrouwer Oct 2, 2026
d1db444
Rollup merge of #163660 - lcnr:compare-mode, r=lqd
JonathanBrouwer Oct 2, 2026
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
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_cranelift/example/mini_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ pub trait FnMut<Args: Tuple>: FnOnce<Args> {
pub fn panic(_msg: &'static str) -> ! {
unsafe {
libc::puts("Panicking\n\0" as *const str as *const i8);
intrinsics::abort();
intrinsics::abort_immediate();
}
}

Expand Down Expand Up @@ -539,7 +539,7 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
len,
index,
);
intrinsics::abort();
intrinsics::abort_immediate();
}
}

Expand All @@ -548,7 +548,7 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
fn panic_cannot_unwind() -> ! {
unsafe {
libc::puts("panic in a function that cannot unwind\n\0" as *const str as *const i8);
intrinsics::abort();
intrinsics::abort_immediate();
}
}

Expand Down Expand Up @@ -688,7 +688,7 @@ pub union MaybeUninit<T> {

pub mod intrinsics {
#[rustc_intrinsic]
pub fn abort() -> !;
pub fn abort_immediate() -> !;
#[rustc_intrinsic]
pub const fn size_of<T>() -> usize;
#[rustc_intrinsic]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,11 +602,11 @@ pub enum E2<X> {
#[allow(unreachable_patterns)]
fn check_niche_behavior() {
if let E1::V2 { .. } = (E1::V1 { f: true }) {
intrinsics::abort();
intrinsics::abort_immediate();
}

if let E2::V1 { .. } = E2::V3::<Infallible> {
intrinsics::abort();
intrinsics::abort_immediate();
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
let usize_layout = fx.layout_of(fx.tcx.types.usize);

match intrinsic {
sym::abort => {
sym::abort_immediate => {
fx.bcx.set_cold_block(fx.bcx.current_block().unwrap());
fx.bcx.ins().trap(TrapCode::user(2).unwrap());
return Ok(());
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/build_system/src/fuzz/reduce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ fn block_abort(file: &mut Vec<String>, path: &PathBuf, cache: &mut ResultCache)
// ..and insert an unconditional call to abort.
file_copy.insert(
block_starts,
"Call(tmp = core::intrinsics::abort(), ReturnTo(bb1), UnwindUnreachable())\n"
"Call(tmp = core::intrinsics::abort_immediate(), ReturnTo(bb1), UnwindUnreachable())\n"
.to_string(),
);
file_copy.insert(block_starts, "let tmp = ();\n".to_string());
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/example/alloc_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ extern "C" {

#[panic_handler]
fn panic_handler(_: &core::panic::PanicInfo<'_>) -> ! {
core::intrinsics::abort();
core::intrinsics::abort_immediate();
}

#[alloc_error_handler]
fn alloc_error_handler(_: alloc::alloc::Layout) -> ! {
core::intrinsics::abort();
core::intrinsics::abort_immediate();
}

#[lang = "eh_personality"]
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_codegen_gcc/example/mini_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ pub trait FnMut<Args: Tuple>: FnOnce<Args> {
pub fn panic(_msg: &'static str) -> ! {
unsafe {
libc::puts("Panicking\n\0" as *const str as *const u8);
intrinsics::abort();
intrinsics::abort_immediate();
}
}

Expand Down Expand Up @@ -546,7 +546,7 @@ panic_const! {
fn panic_cannot_unwind() -> ! {
unsafe {
libc::puts("Panicking\n\0" as *const str as *const u8);
intrinsics::abort();
intrinsics::abort_immediate();
}
}

Expand All @@ -555,7 +555,7 @@ fn panic_cannot_unwind() -> ! {
fn panic_in_cleanup() -> ! {
unsafe {
libc::printf("panic in a destructor during cleanup\n\0" as *const str as *const i8);
intrinsics::abort();
intrinsics::abort_immediate();
}
}

Expand All @@ -568,7 +568,7 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
len,
index,
);
intrinsics::abort();
intrinsics::abort_immediate();
}
}

Expand Down Expand Up @@ -698,7 +698,7 @@ pub mod intrinsics {
#[rustc_intrinsic]
pub const fn black_box<T>(_dummy: T) -> T;
#[rustc_intrinsic]
pub fn abort() -> !;
pub fn abort_immediate() -> !;
#[rustc_intrinsic]
pub const fn size_of<T>() -> usize;
#[rustc_intrinsic]
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,10 @@ pub enum E2<X> {
#[allow(unreachable_patterns)]
fn check_niche_behavior () {
if let E1::V2 { .. } = (E1::V1 { f: true }) {
intrinsics::abort();
intrinsics::abort_immediate();
}

if let E2::V1 { .. } = E2::V3::<Infallible> {
intrinsics::abort();
intrinsics::abort_immediate();
}
}
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
llret
}

fn abort(&mut self) {
fn abort_immediate(&mut self) {
let func = self.context.get_builtin_function("__builtin_trap");
self.block.add_eval(self.location, self.context.new_call(self.location, func, &[]));
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/tests/run/abort1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern crate mini_core;
use mini_core::*;

fn test_fail() -> ! {
unsafe { intrinsics::abort() };
unsafe { intrinsics::abort_immediate() };
}

#[no_mangle]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/tests/run/abort2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern crate mini_core;
use mini_core::*;

fn fail() -> i32 {
unsafe { intrinsics::abort() };
unsafe { intrinsics::abort_immediate() };
0
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/tests/run/always_inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn fib_a(n: u8) -> u8 {
#[no_mangle]
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
if fib(2) != fib_a(2) {
intrinsics::abort();
intrinsics::abort_immediate();
}
0
}
7 changes: 2 additions & 5 deletions compiler/rustc_codegen_llvm/src/back/llvm_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,12 @@ impl CodegenBackend for LlvmCodegenBackend {
// Intrinsics whose fallback body will not be used by the LLVM backend.
let replaced_intrinsics = {
#[rustfmt::skip]
let mut will_not_use_fallback = vec![
let will_not_use_fallback = vec![
// These are mapped to LLVM intrinsics instead.
sym::unchecked_funnel_shl,
sym::unchecked_funnel_shr,
sym::carrying_mul_add,
sym::carryless_mul,
sym::integer_max,
sym::integer_min,

Expand All @@ -235,10 +236,6 @@ impl CodegenBackend for LlvmCodegenBackend {
sym::copysignf16, sym::copysignf32, sym::copysignf64, sym::copysignf128,
];

if llvm_util::get_version() >= (22, 0, 0) {
will_not_use_fallback.push(sym::carryless_mul);
}

will_not_use_fallback
};

Expand Down
18 changes: 6 additions & 12 deletions compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,9 +919,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
self.set_metadata_node(store, llvm::MD_nontemporal, &[one]);
}
}
if flags.contains(MemFlags::CAPTURES_READ_ONLY)
&& crate::llvm_util::get_version() >= (22, 0, 0)
{
if flags.contains(MemFlags::CAPTURES_READ_ONLY) {
assert!(
self.type_kind(self.val_ty(val)) == TypeKind::Pointer,
"CAPTURED_READ_ONLY is only supported on pointer stores"
Expand Down Expand Up @@ -1903,14 +1901,10 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
return;
}

if crate::llvm_util::get_version() >= (22, 0, 0) {
// LLVM 22 requires the lifetime intrinsic to act directly on the alloca,
// there can't be an addrspacecast in between.
let ptr = unsafe { llvm::LLVMRustStripPointerCasts(ptr) };
self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[ptr]);
} else {
self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[self.cx.const_u64(size), ptr]);
}
// LLVM 22 requires the lifetime intrinsic to act directly on the alloca,
// there can't be an addrspacecast in between.
let ptr = unsafe { llvm::LLVMRustStripPointerCasts(ptr) };
self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[ptr]);
}
}
impl<'a, 'll, CX: Borrow<SCx<'ll>>> GenericBuilder<'a, 'll, CX> {
Expand Down Expand Up @@ -2129,7 +2123,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
self.unreachable();
}
} else {
self.abort();
self.abort_immediate();
self.unreachable();
}

Expand Down
27 changes: 0 additions & 27 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,33 +195,6 @@ pub(crate) unsafe fn create_module<'ll>(
let mut target_data_layout = sess.target.data_layout.to_string();
let llvm_version = llvm_util::get_version();

if llvm_version < (22, 0, 0) {
if sess.target.arch == Arch::Avr {
// LLVM 22.0 updated the default layout on avr: https://github.com/llvm/llvm-project/pull/153010
target_data_layout = target_data_layout.replace("n8:16", "n8")
}
if sess.target.arch == Arch::Nvptx64 {
// LLVM 22 updated the NVPTX layout to indicate 256-bit vector load/store: https://github.com/llvm/llvm-project/pull/155198
target_data_layout = target_data_layout.replace("-i256:256", "");
}
if sess.target.arch == Arch::PowerPC64 {
// LLVM 22 updated the ABI alignment for double on AIX: https://github.com/llvm/llvm-project/pull/144673
target_data_layout = target_data_layout.replace("-f64:32:64", "");

// LLVM 22 fixed the data layout calculation for targets that default to ELFv1
// when the ABI is set to ELFv2. With LLVM 21, the ELFv1 datalayout must be used,
// which will overalign function entries.
// https://github.com/llvm/llvm-project/pull/149725
if sess.target.llvm_target == "powerpc64-unknown-linux-gnu" {
target_data_layout = target_data_layout.replace("-Fn32", "-Fi64");
}
}
if sess.target.arch == Arch::AmdGpu {
// LLVM 22 specified ELF mangling in the amdgpu data layout:
// https://github.com/llvm/llvm-project/pull/163011
target_data_layout = target_data_layout.replace("-m:e", "");
}
}
if llvm_version < (23, 0, 0) {
if sess.target.arch == Arch::S390x {
// LLVM 23 updated the s390x layout to specify the stack alignment: https://github.com/llvm/llvm-project/pull/176041
Expand Down
Loading
Loading