Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
65a91d1
Add suggestion for E0401 on inner const items
JohnTitor Mar 8, 2026
3f7c645
Suggest public re-exports when a private module blocks an import path
jakubadamw Mar 30, 2026
70fd887
Add and update tests for public re-export suggestions on private modu…
jakubadamw Mar 30, 2026
d4617fa
Parametrise the newly added test by all four editions
jakubadamw Mar 30, 2026
d09d4c9
Update the expected results for two other tests
jakubadamw Mar 30, 2026
526f3d9
Move test files from issues/ to appropriate subdirectories
ujjwalvishwakarma2006 Apr 19, 2026
c4f6148
Add issue links
ujjwalvishwakarma2006 Apr 19, 2026
1a681b0
Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets
lapla-cogito Apr 27, 2026
c13cfc6
move `AstFragment::to_string` out of `ast_fragments!`
cyrgani Apr 15, 2026
712d30f
merge `$mut_visit_ast` and `$visit_ast`
cyrgani Apr 15, 2026
210f03a
smaller tweaks
cyrgani Apr 19, 2026
5ad560f
remove `MethodReceiverExpr` special-casing
cyrgani Apr 28, 2026
b072d24
Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup
hoodmane Jan 27, 2026
d3992fa
Add feature gate for view_types
scrabsha Apr 28, 2026
72a59e7
move fragment printing code
cyrgani Apr 29, 2026
77fb8d1
Parse view type syntax, mark it as unstable
scrabsha Apr 29, 2026
41796ec
add `c_variadic_experimental_arch` feature
folkertdev Apr 29, 2026
6d79bc6
Move `feature*` methods from `parse` mod to `errors` mod.
nnethercote Apr 28, 2026
ee7e430
Remove unnecessary `lift` calls.
nnethercote Apr 28, 2026
a762dbf
Make lifting infallible.
nnethercote Apr 30, 2026
ef93fbb
tests/run-make/print-cfg: add Android target_env case
Vastargazing Apr 30, 2026
e4eb91c
catch callback unwinding to finalize in-flight self-profiling events …
lqd Apr 29, 2026
c5e38b7
Pass Session to optimize_and_codegen_fat_lto
bjorn3 Apr 30, 2026
2cefe9b
Rollup merge of #155249 - hoodmane:wasm-panic-in-cleanup-reland, r=bj…
JonathanBrouwer Apr 30, 2026
2afa5d1
Rollup merge of #155853 - lapla-cogito:rv_mcount, r=mati865
JonathanBrouwer Apr 30, 2026
fe86e5f
Rollup merge of #155919 - cyrgani:ast-fragments, r=petrochenkov
JonathanBrouwer Apr 30, 2026
71f9f9a
Rollup merge of #155939 - scrabsha:view-types/feature-gate, r=nikomat…
JonathanBrouwer Apr 30, 2026
8acfab4
Rollup merge of #155974 - folkertdev:c-variadic-experimental-arch, r=…
JonathanBrouwer Apr 30, 2026
5e7a586
Rollup merge of #155991 - lqd:in-flight-query-profiling, r=bjorn3
JonathanBrouwer Apr 30, 2026
50d2cca
Rollup merge of #156003 - bjorn3:lto_refactors17, r=lqd
JonathanBrouwer Apr 30, 2026
196f88e
Rollup merge of #153566 - JohnTitor:sugg-generic-params-from-outer-it…
JonathanBrouwer Apr 30, 2026
299fd8b
Rollup merge of #154610 - jakubadamw:issue-13065, r=TaKO8Ki
JonathanBrouwer Apr 30, 2026
443b3e7
Rollup merge of #155523 - ujjwalvishwakarma2006:reorg-tests-02, r=Kiv…
JonathanBrouwer Apr 30, 2026
8123c56
Rollup merge of #155980 - nnethercote:mv-feature-methods, r=TaKO8Ki
JonathanBrouwer Apr 30, 2026
1dda4d1
Rollup merge of #155987 - nnethercote:infallible-Lifting, r=oli-obk
JonathanBrouwer Apr 30, 2026
c323908
Rollup merge of #155988 - Vastargazing:tests/android-target-env-print…
JonathanBrouwer Apr 30, 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
1 change: 1 addition & 0 deletions compiler/rustc_abi/src/extern_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ impl StableOrd for ExternAbi {
rustc_error_messages::into_diag_arg_using_display!(ExternAbi);

#[cfg(feature = "nightly")]
#[derive(Debug)]
pub enum CVariadicStatus {
NotSupported,
Stable,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
use rustc_errors::msg;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_session::parse::feature_err;
use rustc_session::errors::feature_err;
use rustc_span::{Span, sym};
use rustc_target::asm;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
&& !self.tcx.features().coroutines()
&& !self.tcx.features().gen_blocks()
{
rustc_session::parse::feature_err(
rustc_session::errors::feature_err(
&self.tcx.sess,
sym::yield_expr,
span,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use rustc_macros::extension;
use rustc_middle::hir::{self as mid_hir};
use rustc_middle::span_bug;
use rustc_middle::ty::{DelegationInfo, ResolverAstLowering, TyCtxt};
use rustc_session::parse::add_feature_diagnostics;
use rustc_session::errors::add_feature_diagnostics;
use rustc_span::symbol::{Ident, Symbol, kw, sym};
use rustc_span::{DUMMY_SP, DesugaringKind, Span};
use smallvec::SmallVec;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc_hir::def::{DefKind, PartialRes, PerNS, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::{self as hir, GenericArg};
use rustc_middle::{span_bug, ty};
use rustc_session::parse::add_feature_diagnostics;
use rustc_session::errors::add_feature_diagnostics;
use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, Ident, Span, Symbol, sym};
use smallvec::smallvec;
use tracing::{debug, instrument};
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::fmt;
use rustc_abi::ExternAbi;
use rustc_feature::Features;
use rustc_session::Session;
use rustc_session::parse::feature_err;
use rustc_session::errors::feature_err;
use rustc_span::symbol::sym;
use rustc_span::{Span, Symbol};

Expand Down
25 changes: 18 additions & 7 deletions compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ use rustc_data_structures::fx::FxIndexMap;
use rustc_errors::{DiagCtxtHandle, Diagnostic, LintBuffer};
use rustc_feature::Features;
use rustc_session::Session;
use rustc_session::errors::feature_err;
use rustc_session::lint::builtin::{
DEPRECATED_WHERE_CLAUSE_LOCATION, MISSING_ABI, MISSING_UNSAFE_ON_EXTERN,
PATTERNS_IN_FNS_WITHOUT_BODY, UNUSED_VISIBILITIES,
};
use rustc_session::parse::feature_err;
use rustc_span::{Ident, Span, kw, sym};
use rustc_target::spec::{AbiMap, AbiMapping};
use thin_vec::thin_vec;
Expand Down Expand Up @@ -762,12 +762,23 @@ impl<'a> AstValidator<'a> {
match fn_ctxt {
FnCtxt::Foreign => return,
FnCtxt::Free | FnCtxt::Assoc(_) => {
if !self.sess.target.supports_c_variadic_definitions() {
self.dcx().emit_err(errors::CVariadicNotSupported {
variadic_span: variadic_param.span,
target: &*self.sess.target.llvm_target,
});
return;
match self.sess.target.supports_c_variadic_definitions() {
CVariadicStatus::NotSupported => {
self.dcx().emit_err(errors::CVariadicNotSupported {
variadic_span: variadic_param.span,
target: &*self.sess.target.llvm_target,
});
return;
}
CVariadicStatus::Unstable { feature } if !self.features.enabled(feature) => {
let msg =
format!("C-variadic function definitions on this target are unstable");
feature_err(&self.sess, feature, variadic_param.span, msg).emit();
return;
}
CVariadicStatus::Unstable { .. } | CVariadicStatus::Stable => {
/* fall through */
}
}

match sig.header.ext {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc_feature::{AttributeGate, BUILTIN_ATTRIBUTE_MAP, BuiltinAttribute, Feat
use rustc_hir::Attribute;
use rustc_hir::attrs::AttributeKind;
use rustc_session::Session;
use rustc_session::parse::{feature_err, feature_warn};
use rustc_session::errors::{feature_err, feature_warn};
use rustc_span::{Span, Spanned, Symbol, sym};
use thin_vec::ThinVec;

Expand Down Expand Up @@ -510,6 +510,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
gate_all!(try_blocks_heterogeneous, "`try bikeshed` expression is experimental");
gate_all!(unsafe_binders, "unsafe binder types are experimental");
gate_all!(unsafe_fields, "`unsafe` fields are experimental");
gate_all!(view_types, "view types are experimental");
gate_all!(where_clause_attrs, "attributes in `where` clause are unstable");
gate_all!(yeet_expr, "`do yeet` expression is experimental");
// tidy-alphabetical-end
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ use rustc_parse::parser::{ForceCollect, Parser, Recovery};
use rustc_parse::{exp, parse_in};
use rustc_session::Session;
use rustc_session::config::ExpectedValues;
use rustc_session::errors::feature_err;
use rustc_session::lint::builtin::UNEXPECTED_CFGS;
use rustc_session::parse::{ParseSess, feature_err};
use rustc_session::parse::ParseSess;
use rustc_span::{ErrorGuaranteed, Span, Symbol, sym};
use thin_vec::ThinVec;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rustc_hir::attrs::{CoverageAttrKind, OptimizeAttr, RtsanSetting, SanitizerSet, UsedBy};
use rustc_session::parse::feature_err;
use rustc_session::errors::feature_err;
use rustc_span::edition::Edition::Edition2024;

use super::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/attributes/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_hir::Target;
use rustc_hir::attrs::{
AttributeKind, CfgEntry, CfgHideShow, CfgInfo, DocAttribute, DocInline, HideOrShow,
};
use rustc_session::parse::feature_err;
use rustc_session::errors::feature_err;
use rustc_span::{Span, Symbol, edition, sym};
use thin_vec::ThinVec;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/attributes/link_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use rustc_feature::Features;
use rustc_hir::attrs::AttributeKind::{LinkName, LinkOrdinal, LinkSection};
use rustc_hir::attrs::*;
use rustc_session::Session;
use rustc_session::errors::feature_err;
use rustc_session::lint::builtin::ILL_FORMED_ATTRIBUTE_INPUT;
use rustc_session::parse::feature_err;
use rustc_span::edition::Edition::Edition2024;
use rustc_span::kw;
use rustc_target::spec::{Arch, BinaryFormat};
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 @@ -1659,6 +1659,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: 2 additions & 2 deletions compiler/rustc_codegen_gcc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,16 +430,16 @@ impl WriteBackendMethods for GccCodegenBackend {
}

fn optimize_and_codegen_fat_lto(
sess: &Session,
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: &SharedEmitter,
_tm_factory: TargetMachineFactoryFn<Self>,
// FIXME(bjorn3): Limit LTO exports to these symbols
_exported_symbols_for_lto: &[String],
each_linked_rlib_for_lto: &[PathBuf],
modules: Vec<FatLtoInput<Self>>,
) -> CompiledModule {
back::lto::run_fat(cgcx, prof, shared_emitter, each_linked_rlib_for_lto, modules)
back::lto::run_fat(cgcx, &sess.prof, shared_emitter, each_linked_rlib_for_lto, modules)
}

fn run_thin_lto(
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 @@ -1289,6 +1289,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
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ impl WriteBackendMethods for LlvmCodegenBackend {
back::write::target_machine_factory(sess, optlvl, target_features)
}
fn optimize_and_codegen_fat_lto(
sess: &Session,
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: &SharedEmitter,
tm_factory: TargetMachineFactoryFn<LlvmCodegenBackend>,
exported_symbols_for_lto: &[String],
Expand All @@ -143,7 +143,7 @@ impl WriteBackendMethods for LlvmCodegenBackend {
) -> CompiledModule {
let mut module = back::lto::run_fat(
cgcx,
prof,
&sess.prof,
shared_emitter,
tm_factory,
exported_symbols_for_lto,
Expand All @@ -153,9 +153,9 @@ impl WriteBackendMethods for LlvmCodegenBackend {

let dcx = DiagCtxt::new(Box::new(shared_emitter.clone()));
let dcx = dcx.handle();
back::lto::run_pass_manager(cgcx, prof, dcx, &mut module, false);
back::lto::run_pass_manager(cgcx, &sess.prof, dcx, &mut module, false);

back::write::codegen(cgcx, prof, shared_emitter, module, &cgcx.module_config)
back::write::codegen(cgcx, &sess.prof, shared_emitter, module, &cgcx.module_config)
}
fn run_thin_lto(
cgcx: &CodegenContext,
Expand Down
10 changes: 9 additions & 1 deletion compiler/rustc_codegen_llvm/src/va_arg.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_abi::{Align, BackendRepr, Endian, HasDataLayout, Primitive, Size};
use rustc_abi::{Align, BackendRepr, CVariadicStatus, Endian, HasDataLayout, Primitive, Size};
use rustc_codegen_ssa::MemFlags;
use rustc_codegen_ssa::common::IntPredicate;
use rustc_codegen_ssa::mir::operand::OperandRef;
Expand Down Expand Up @@ -1038,6 +1038,8 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
assert!(!bx.layout_of(target_ty).is_zst());

let target = &bx.cx.tcx.sess.target;
let stability = target.supports_c_variadic_definitions();

match target.arch {
Arch::X86 => emit_ptr_va_arg(
bx,
Expand Down Expand Up @@ -1094,6 +1096,7 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
ForceRightAdjust::Yes,
),
Arch::RiscV32 if target.llvm_abiname == LlvmAbi::Ilp32e => {
std::assert_matches!(stability, CVariadicStatus::Unstable { .. });
// FIXME: clang manually adjusts the alignment for this ABI. It notes:
//
// > To be compatible with GCC's behaviors, we force arguments with
Expand Down Expand Up @@ -1215,10 +1218,15 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
Arch::SpirV => bug!("spirv does not support c-variadic functions"),

Arch::Sparc | Arch::Avr | Arch::M68k | Arch::Msp430 => {
std::assert_matches!(stability, CVariadicStatus::Unstable { .. });

// Clang uses the LLVM implementation for these architectures.
bx.va_arg(addr.immediate(), bx.cx.layout_of(target_ty).llvm_type(bx.cx))
}

Arch::Other(ref arch) => {
std::assert_matches!(stability, CVariadicStatus::Unstable { .. });

// Just to be safe we error out explicitly here, instead of crossing our fingers that
// the default LLVM implementation has the correct behavior for this target.
bug!("c-variadic functions are not currently implemented for custom target {arch}")
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -961,24 +961,24 @@ fn execute_copy_from_cache_work_item(
}

fn do_fat_lto<B: WriteBackendMethods>(
sess: &Session,
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: SharedEmitter,
tm_factory: TargetMachineFactoryFn<B>,
exported_symbols_for_lto: &[String],
each_linked_rlib_for_lto: &[PathBuf],
needs_fat_lto: Vec<FatLtoInput<B>>,
) -> CompiledModule {
let _timer = prof.verbose_generic_activity("LLVM_fatlto");
let _timer = sess.prof.verbose_generic_activity("LLVM_fatlto");

let dcx = DiagCtxt::new(Box::new(shared_emitter.clone()));
let dcx = dcx.handle();

check_lto_allowed(&cgcx, dcx);

B::optimize_and_codegen_fat_lto(
sess,
cgcx,
prof,
&shared_emitter,
tm_factory,
exported_symbols_for_lto,
Expand Down Expand Up @@ -2177,8 +2177,8 @@ impl<B: WriteBackendMethods> OngoingCodegen<B> {

CompiledModules {
modules: vec![do_fat_lto(
sess,
&cgcx,
&sess.prof,
shared_emitter,
tm_factory,
&exported_symbols_for_lto,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use rustc_middle::middle::codegen_fn_attrs::{
use rustc_middle::mono::Visibility;
use rustc_middle::query::Providers;
use rustc_middle::ty::{self as ty, TyCtxt};
use rustc_session::errors::feature_err;
use rustc_session::lint;
use rustc_session::parse::feature_err;
use rustc_span::{Span, sym};
use rustc_target::spec::Os;

Expand Down
Loading
Loading