Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
189b301
CI: use alternative disks if available
the8472 Oct 26, 2025
1787491
[review] add more comments
the8472 Oct 27, 2025
dd2d7c0
print a warning and fallback instead of failing ci
the8472 Nov 13, 2025
dcbcedf
AWS runners have enough disk, no need for cleanup or mount shenanigans
the8472 Dec 1, 2025
d501f96
rustc_target: callconv: powerpc64: Use llvm_abiname rather than targe…
Gelbpunkt Feb 24, 2026
acbfd79
Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup
hoodmane Jan 27, 2026
783afe9
`is_ty_must_use`: do not require a `span` argument
samueltardieu Feb 24, 2026
f4407f2
Update books
rustbot Feb 25, 2026
d13924c
mGCA: Reject negated non-integer literals in const args
reddevilmidzy Feb 25, 2026
5127108
mGCA: drop literal anon-const special case in parser
reddevilmidzy Feb 25, 2026
8eed8bd
Rename `pass_by_value` lint as `disallowed_pass_by_ref`.
nnethercote Feb 23, 2026
d2619b5
Remove mgca_direct_lit_hack indirection
reddevilmidzy Feb 25, 2026
b76b26d
Remove `QuerySystemFns`.
nnethercote Feb 25, 2026
608d85f
Move two functions into `hooks`.
nnethercote Feb 25, 2026
f1ec10e
deprecate `Eq::assert_receiver_is_total_eq` and emit a FCW on manual …
cyrgani Jan 8, 2026
82e5ed6
interpret: avoid dummy spans in the stacktrace
RalfJung Feb 25, 2026
ff0f239
Remove redundant self usages
mu001999 Feb 22, 2026
696a7a1
Simplify `AppendOnlyVec` iterators
cuviper Feb 25, 2026
8fcf512
Refactor url_parts to return is_absolute instead of out param
arferreira Feb 25, 2026
5eb535a
Rollup merge of #148146 - the8472:ci-use-extra-disk, r=marcoieni
jhpratt Feb 26, 2026
cb78bc4
Rollup merge of #151771 - hoodmane:wasm-double-panic, r=bjorn3
jhpratt Feb 26, 2026
d108355
Rollup merge of #153035 - Gelbpunkt:ppc64-callconv-llvm-abiname, r=Ra…
jhpratt Feb 26, 2026
cd09c56
Rollup merge of #153075 - reddevilmidzy:mgca-neg, r=BoxyUwU
jhpratt Feb 26, 2026
49a9885
Rollup merge of #153078 - nnethercote:rm-QuerySystemFns, r=petrochenkov
jhpratt Feb 26, 2026
ec78ad8
Rollup merge of #153089 - RalfJung:no-dummys, r=Kivooeo
jhpratt Feb 26, 2026
e668710
Rollup merge of #153111 - arferreira:refactor-url-parts-return-is-abs…
jhpratt Feb 26, 2026
7a88346
Rollup merge of #149978 - cyrgani:no-eq-assert-receiver-method, r=mad…
jhpratt Feb 26, 2026
f8f4447
Rollup merge of #153029 - nnethercote:disallowed-pass-by-ref, r=Urgau
jhpratt Feb 26, 2026
80fc788
Rollup merge of #153063 - samueltardieu:features/remove-span-paramete…
jhpratt Feb 26, 2026
0bb904e
Rollup merge of #153071 - rustbot:docs-update, r=ehuss
jhpratt Feb 26, 2026
236327e
Rollup merge of #153092 - mu001999-contrib:cleanup/redundant-self, r=…
jhpratt Feb 26, 2026
efae53b
Rollup merge of #153094 - cuviper:AppendOnlyVec-iters, r=Kivooeo
jhpratt Feb 26, 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
6 changes: 4 additions & 2 deletions compiler/rustc_ast/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -757,9 +757,11 @@ macro_rules! common_visitor_and_walkers {
) -> V::Result;
}

// this is only used by the MutVisitor. We include this symmetry here to make writing other functions easier
// This is only used by the MutVisitor. We include this symmetry here to make writing other
// functions easier.
$(${ignore($lt)}
#[expect(unused, rustc::pass_by_value)]
#[cfg_attr(not(bootstrap), expect(unused, rustc::disallowed_pass_by_ref))]
#[cfg_attr(bootstrap, expect(unused, rustc::pass_by_value))]
#[inline]
)?
fn visit_span<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, span: &$($lt)? $($mut)? Span) -> V::Result {
Expand Down
21 changes: 11 additions & 10 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2521,16 +2521,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
ExprKind::Block(block, _) => {
if let [stmt] = block.stmts.as_slice()
&& let StmtKind::Expr(expr) = &stmt.kind
&& matches!(
expr.kind,
ExprKind::Block(..)
| ExprKind::Path(..)
| ExprKind::Struct(..)
| ExprKind::Call(..)
| ExprKind::Tup(..)
| ExprKind::Array(..)
| ExprKind::ConstBlock(..)
)
{
return self.lower_expr_to_const_arg_direct(expr);
}
Expand All @@ -2553,6 +2543,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let span = expr.span;
let literal = self.lower_lit(literal, span);

if !matches!(literal.node, LitKind::Int(..)) {
let err =
self.dcx().struct_span_err(expr.span, "negated literal must be an integer");

return ConstArg {
hir_id: self.next_id(),
kind: hir::ConstArgKind::Error(err.emit()),
span,
};
}

ConstArg {
hir_id: self.lower_node_id(expr.id),
kind: hir::ConstArgKind::Literal { lit: literal.node, negated: true },
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/attributes/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_hir::{

use super::prelude::*;
use super::util::parse_version;
use crate::session_diagnostics::{self};
use crate::session_diagnostics;

macro_rules! reject_outside_std {
($cx: ident) => {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/session_diagnostics.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::num::IntErrorKind;

use rustc_ast::{self as ast};
use rustc_ast as ast;
use rustc_errors::codes::*;
use rustc_errors::{
Applicability, Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/cmdline_attrs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Attributes injected into the crate root from command line using `-Z crate-attr`.

use rustc_ast::{self as ast};
use rustc_ast as ast;
use rustc_errors::Diag;
use rustc_parse::parser::attr::InnerAttrPolicy;
use rustc_parse::{parse_in, source_str_to_stream};
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ pub(crate) fn expand_deriving_eq(
additional_bounds: Vec::new(),
supports_unions: true,
methods: vec![MethodDef {
name: sym::assert_receiver_is_total_eq,
name: sym::assert_fields_are_eq,
generics: Bounds::empty(),
explicit_self: true,
nonself_args: vec![],
ret_ty: Unit,
attributes: thin_vec![
cx.attr_word(sym::inline, span),
cx.attr_nested_word(sym::doc, sym::hidden, span),
cx.attr_nested_word(sym::coverage, sym::off, span)
cx.attr_nested_word(sym::coverage, sym::off, span),
],
fieldless_variants_strategy: FieldlessVariantsStrategy::Unify,
combine_substructure: combine_substructure(Box::new(|a, b, c| {
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_codegen_gcc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,10 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
unimplemented!();
}

fn get_funclet_cleanuppad(&self, _funclet: &Funclet) -> RValue<'gcc> {
unimplemented!();
}

// Atomic Operations
fn atomic_cmpxchg(
&mut self,
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,10 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
ret
}

fn get_funclet_cleanuppad(&self, funclet: &Funclet<'ll>) -> &'ll Value {
funclet.cleanuppad()
}

// Atomic Operations
fn atomic_cmpxchg(
&mut self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use crate::debuginfo::metadata::{
size_and_align_of, type_di_node, unknown_file_metadata, visibility_di_flags,
};
use crate::debuginfo::utils::DIB;
use crate::llvm;
use crate::llvm::debuginfo::{DIFile, DIFlags, DIType};
use crate::llvm::{self};

// The names of the associated constants in each variant wrapper struct.
// These have to match up with the names being used in `intrinsic.natvis`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use crate::debuginfo::metadata::{
file_metadata_from_def_id, type_di_node, unknown_file_metadata,
};
use crate::debuginfo::utils::{DIB, create_DIArray, get_namespace_for_item};
use crate::llvm;
use crate::llvm::debuginfo::{DIFlags, DIType};
use crate::llvm::{self};

mod cpp_like;
mod native;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ use rustc_abi::{Size, TagEncoding, VariantIdx, Variants};
use rustc_codegen_ssa::debuginfo::type_names::compute_debuginfo_type_name;
use rustc_codegen_ssa::debuginfo::{tag_base_type, wants_c_like_enum_debuginfo};
use rustc_codegen_ssa::traits::{ConstCodegenMethods, MiscCodegenMethods};
use rustc_middle::bug;
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
use rustc_middle::ty::{self};
use rustc_middle::{bug, ty};
use smallvec::smallvec;

use crate::common::{AsCCharPtr, CodegenCx};
Expand All @@ -18,8 +17,8 @@ use crate::debuginfo::metadata::{
unknown_file_metadata, visibility_di_flags,
};
use crate::debuginfo::utils::{DIB, create_DIArray, get_namespace_for_item};
use crate::llvm;
use crate::llvm::debuginfo::{DIFile, DIFlags, DIType};
use crate::llvm::{self};

/// Build the debuginfo node for an enum type. The listing below shows how such a
/// type looks like at the LLVM IR/DWARF level. It is a `DW_TAG_structure_type`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use rustc_middle::ty::{self, ExistentialTraitRef, Ty, TyCtxt};
use super::{DefinitionLocation, SmallVec, UNKNOWN_LINE_NUMBER, unknown_file_metadata};
use crate::common::CodegenCx;
use crate::debuginfo::utils::{DIB, create_DIArray, debug_context};
use crate::llvm;
use crate::llvm::debuginfo::{DIFlags, DIScope, DIType};
use crate::llvm::{self};

mod private {
use rustc_macros::HashStable;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
use rustc_codegen_ssa::mir::place::{PlaceRef, PlaceValue};
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::assert_matches;
use rustc_hir as hir;
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_hir::{self as hir};
use rustc_middle::mir::BinOp;
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, HasTypingEnv, LayoutOf};
use rustc_middle::ty::offload_meta::OffloadMetadata;
Expand Down
96 changes: 77 additions & 19 deletions compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,18 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
mir::UnwindAction::Continue => None,
mir::UnwindAction::Unreachable => None,
mir::UnwindAction::Terminate(reason) => {
if fx.mir[self.bb].is_cleanup && base::wants_new_eh_instructions(fx.cx.tcx().sess) {
if fx.mir[self.bb].is_cleanup && base::wants_wasm_eh(fx.cx.tcx().sess) {
// For wasm, we need to generate a nested `cleanuppad within %outer_pad`
// to catch exceptions during cleanup and call `panic_in_cleanup`.
Some(fx.terminate_block(reason, Some(self.bb)))
} else if fx.mir[self.bb].is_cleanup
&& base::wants_new_eh_instructions(fx.cx.tcx().sess)
{
// MSVC SEH will abort automatically if an exception tries to
// propagate out from cleanup.

// FIXME(@mirkootter): For wasm, we currently do not support terminate during
// cleanup, because this requires a few more changes: The current code
// caches the `terminate_block` for each function; funclet based code - however -
// requires a different terminate_block for each funclet
// Until this is implemented, we just do not unwind inside cleanup blocks

None
} else {
Some(fx.terminate_block(reason))
Some(fx.terminate_block(reason, None))
}
}
};
Expand All @@ -239,7 +238,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {

if let Some(unwind_block) = unwind_block {
let ret_llbb = if let Some((_, target)) = destination {
fx.llbb(target)
self.llbb_with_cleanup(fx, target)
} else {
fx.unreachable_block()
};
Expand Down Expand Up @@ -310,15 +309,15 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
) -> MergingSucc {
let unwind_target = match unwind {
mir::UnwindAction::Cleanup(cleanup) => Some(self.llbb_with_cleanup(fx, cleanup)),
mir::UnwindAction::Terminate(reason) => Some(fx.terminate_block(reason)),
mir::UnwindAction::Terminate(reason) => Some(fx.terminate_block(reason, None)),
mir::UnwindAction::Continue => None,
mir::UnwindAction::Unreachable => None,
};

if operands.iter().any(|x| matches!(x, InlineAsmOperandRef::Label { .. })) {
assert!(unwind_target.is_none());
let ret_llbb = if let Some(target) = destination {
fx.llbb(target)
self.llbb_with_cleanup(fx, target)
} else {
fx.unreachable_block()
};
Expand All @@ -335,7 +334,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
MergingSucc::False
} else if let Some(cleanup) = unwind_target {
let ret_llbb = if let Some(target) = destination {
fx.llbb(target)
self.llbb_with_cleanup(fx, target)
} else {
fx.unreachable_block()
};
Expand Down Expand Up @@ -1830,8 +1829,39 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
})
}

fn terminate_block(&mut self, reason: UnwindTerminateReason) -> Bx::BasicBlock {
if let Some((cached_bb, cached_reason)) = self.terminate_block
fn terminate_block(
&mut self,
reason: UnwindTerminateReason,
outer_catchpad_bb: Option<mir::BasicBlock>,
) -> Bx::BasicBlock {
// mb_funclet_bb should be present if and only if the target is wasm and
// we're terminating because of an unwind in a cleanup block. In that
// case we have nested funclets and the inner catch_switch needs to know
// what outer catch_pad it is contained in.
debug_assert!(
outer_catchpad_bb.is_some()
== (base::wants_wasm_eh(self.cx.tcx().sess)
&& reason == UnwindTerminateReason::InCleanup)
);

// When we aren't in a wasm InCleanup block, there's only one terminate
// block needed so we cache at START_BLOCK index.
let mut cache_bb = mir::START_BLOCK;
// In wasm eh InCleanup, use the outer funclet's cleanup BB as the cache
// key.
if let Some(outer_bb) = outer_catchpad_bb {
let cleanup_kinds =
self.cleanup_kinds.as_ref().expect("cleanup_kinds required for funclets");
cache_bb = cleanup_kinds[outer_bb]
.funclet_bb(outer_bb)
.expect("funclet_bb should be in a funclet");

// Ensure the outer funclet is created first
if self.funclets[cache_bb].is_none() {
self.landing_pad_for(cache_bb);
}
}
if let Some((cached_bb, cached_reason)) = self.terminate_blocks[cache_bb]
&& reason == cached_reason
{
return cached_bb;
Expand Down Expand Up @@ -1869,12 +1899,35 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
// cp_terminate:
// %cp = catchpad within %cs [null, i32 64, null]
// ...
//
// By contrast, on WebAssembly targets, we specifically _do_ want to
// catch foreign exceptions. The situation with MSVC is a
// regrettable hack which we don't want to extend to other targets
// unless necessary. For WebAssembly, to generate catch(...) and
// catch only C++ exception instead of generating a catch_all, we
// need to call the intrinsics @llvm.wasm.get.exception and
// @llvm.wasm.get.ehselector in the catch pad. Since we don't do
// this, we generate a catch_all. We originally got this behavior
// by accident but it luckily matches our intention.

llbb = Bx::append_block(self.cx, self.llfn, "cs_terminate");
let cp_llbb = Bx::append_block(self.cx, self.llfn, "cp_terminate");

let mut cs_bx = Bx::build(self.cx, llbb);
let cs = cs_bx.catch_switch(None, None, &[cp_llbb]);

// For wasm InCleanup blocks, our catch_switch is nested within the
// outer catchpad, so we need to provide it as the parent value to
// catch_switch.
let mut outer_cleanuppad = None;
if outer_catchpad_bb.is_some() {
// Get the outer funclet's catchpad
let outer_funclet = self.funclets[cache_bb]
.as_ref()
.expect("landing_pad_for didn't create funclet");
outer_cleanuppad = Some(cs_bx.get_funclet_cleanuppad(outer_funclet));
}
let cp_llbb = Bx::append_block(self.cx, self.llfn, "cp_terminate");
let cs = cs_bx.catch_switch(outer_cleanuppad, None, &[cp_llbb]);
drop(cs_bx);

bx = Bx::build(self.cx, cp_llbb);
let null =
Expand All @@ -1895,13 +1948,18 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
} else {
// Specifying more arguments than necessary usually doesn't
// hurt, but the `WasmEHPrepare` LLVM pass does not recognize
// anything other than a single `null` as a `catch (...)` block,
// anything other than a single `null` as a `catch_all` block,
// leading to problems down the line during instruction
// selection.
&[null] as &[_]
};

funclet = Some(bx.catch_pad(cs, args));
// On wasm, if we wanted to generate a catch(...) and only catch C++
// exceptions, we'd call @llvm.wasm.get.exception and
// @llvm.wasm.get.ehselector selectors here. We want a catch_all so
// we leave them out. This is intentionally diverging from the MSVC
// behavior.
} else {
llbb = Bx::append_block(self.cx, self.llfn, "terminate");
bx = Bx::build(self.cx, llbb);
Expand All @@ -1927,7 +1985,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {

bx.unreachable();

self.terminate_block = Some((llbb, reason));
self.terminate_blocks[cache_bb] = Some((llbb, reason));
llbb
}

Expand Down
9 changes: 6 additions & 3 deletions compiler/rustc_codegen_ssa/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ pub struct FunctionCx<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
/// Cached unreachable block
unreachable_block: Option<Bx::BasicBlock>,

/// Cached terminate upon unwinding block and its reason
terminate_block: Option<(Bx::BasicBlock, UnwindTerminateReason)>,
/// Cached terminate upon unwinding block and its reason. For non-wasm
/// targets, there is at most one such block per function, stored at index
/// `START_BLOCK`. For wasm targets, each funclet needs its own terminate
/// block, indexed by the cleanup block that is the funclet's head.
terminate_blocks: IndexVec<mir::BasicBlock, Option<(Bx::BasicBlock, UnwindTerminateReason)>>,

/// A bool flag for each basic block indicating whether it is a cold block.
/// A cold block is a block that is unlikely to be executed at runtime.
Expand Down Expand Up @@ -227,7 +230,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
personality_slot: None,
cached_llbbs,
unreachable_block: None,
terminate_block: None,
terminate_blocks: IndexVec::from_elem(None, &mir.basic_blocks),
cleanup_kinds,
landing_pads: IndexVec::from_elem(None, &mir.basic_blocks),
funclets: IndexVec::from_fn_n(|_| None, mir.basic_blocks.len()),
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_codegen_ssa/src/traits/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,12 +552,12 @@ pub trait BuilderMethods<'a, 'tcx>:

fn set_personality_fn(&mut self, personality: Self::Function);

// These are used by everyone except msvc
// These are used by everyone except msvc and wasm EH
fn cleanup_landing_pad(&mut self, pers_fn: Self::Function) -> (Self::Value, Self::Value);
fn filter_landing_pad(&mut self, pers_fn: Self::Function);
fn resume(&mut self, exn0: Self::Value, exn1: Self::Value);

// These are used only by msvc
// These are used by msvc and wasm EH
fn cleanup_pad(&mut self, parent: Option<Self::Value>, args: &[Self::Value]) -> Self::Funclet;
fn cleanup_ret(&mut self, funclet: &Self::Funclet, unwind: Option<Self::BasicBlock>);
fn catch_pad(&mut self, parent: Self::Value, args: &[Self::Value]) -> Self::Funclet;
Expand All @@ -567,6 +567,7 @@ pub trait BuilderMethods<'a, 'tcx>:
unwind: Option<Self::BasicBlock>,
handlers: &[Self::BasicBlock],
) -> Self::Value;
fn get_funclet_cleanuppad(&self, funclet: &Self::Funclet) -> Self::Value;

fn atomic_cmpxchg(
&mut self,
Expand Down
Loading
Loading