Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dad850c
Re-export `core::fmt::NumBuffer` in `alloc` (and `std`)
cuviper Aug 20, 2026
f59ff9d
mir-transform: Remove `is_optimization_stage`
jamie-osec Aug 20, 2026
ea39610
Clarify examples related to `Sync` and `SyncView`
tisonkun Sep 11, 2026
c03ff79
Prevent `should-fail` to be used in `rustdoc-ui` testsuite
GuillaumeGomez Sep 7, 2026
df47c83
Remove unused argument of `write_splatted_call`
JonathanBrouwer Sep 11, 2026
dfec7d9
Remove unused argument of `simplify_rvalue`
JonathanBrouwer Sep 11, 2026
c6dceb8
Remove unused argument of `check_let`
JonathanBrouwer Sep 11, 2026
7318943
Remove unused argument of `process_registered_region_obligations`
JonathanBrouwer Sep 11, 2026
f59c31f
Remove unused argument of `lower_fn_decl`
JonathanBrouwer Sep 11, 2026
0563dc2
Remove unused argument of `try_match_macro_derive`
JonathanBrouwer Sep 11, 2026
162f273
Remove unused argument of `try_match_macro_attr`
JonathanBrouwer Sep 11, 2026
1b6bd7c
Remove unused argument of `try_match_macro`
JonathanBrouwer Sep 11, 2026
15fd45c
Remove unused argument of `unify_query_var_values`
JonathanBrouwer Sep 11, 2026
f47f54d
Apply suggestion from @tisonkun
tisonkun Sep 11, 2026
26ff14a
Remove needless test running instructions
mati865 Sep 11, 2026
92eba24
Initialize mingw for all mingw targets
ChrisDenton Sep 11, 2026
29f7a91
Remove my target docs mention
Noratrieb Sep 11, 2026
d85cbdc
Rollup merge of #161413 - clubby789:remove-is-optimization, r=saethlin
JonathanBrouwer Sep 11, 2026
378c1a2
Rollup merge of #161430 - cuviper:fmt_numbuffer, r=JohnTitor
JonathanBrouwer Sep 11, 2026
a5e64e6
Rollup merge of #162446 - GuillaumeGomez:rustdoc-ui-should-fail, r=ji…
JonathanBrouwer Sep 11, 2026
f1213cd
Rollup merge of #162621 - tisonkun:patch-2, r=JohnTitor
JonathanBrouwer Sep 11, 2026
488eda2
Rollup merge of #162641 - JonathanBrouwer:unused_args, r=boxyuwu
JonathanBrouwer Sep 11, 2026
db87363
Rollup merge of #162650 - ChrisDenton:setup-msys2, r=jieyouxu
JonathanBrouwer Sep 11, 2026
49c778c
Rollup merge of #162651 - mati865:cleanup-test-instructions, r=jieyouxu
JonathanBrouwer Sep 11, 2026
c467623
Rollup merge of #162658 - Noratrieb:Noratrieb-patch-4, r=Noratrieb
JonathanBrouwer Sep 11, 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
5 changes: 2 additions & 3 deletions compiler/rustc_ast_lowering/src/expr/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl<'hir> LoweringContext<'_, 'hir> {

let bound_generic_params = self.lower_lifetime_binder(closure_id, generic_params);
// Lower outside new scope to preserve `is_in_loop_condition`.
let fn_decl = self.lower_fn_decl(decl, closure_id, fn_decl_span, FnDeclKind::Closure, None);
let fn_decl = self.lower_fn_decl(decl, closure_id, FnDeclKind::Closure, None);

let c = self.arena.alloc(hir::Closure {
def_id: closure_def_id,
Expand Down Expand Up @@ -327,8 +327,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
// We need to lower the declaration outside the new scope, because we
// have to conserve the state of being inside a loop condition for the
// closure argument types.
let fn_decl =
self.lower_fn_decl(&decl, closure_id, fn_decl_span, FnDeclKind::Closure, None);
let fn_decl = self.lower_fn_decl(&decl, closure_id, FnDeclKind::Closure, None);

if let Const::Yes(span) = constness {
self.dcx().span_err(span, "const coroutines are not supported");
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ impl<'hir> LoweringContext<'_, 'hir> {

let itctx = ImplTraitContext::Universal;
let (generics, decl) = this.lower_generics(generics, itctx, |this| {
this.lower_fn_decl(decl, id, *fn_sig_span, FnDeclKind::Fn, coroutine_marker)
this.lower_fn_decl(decl, id, FnDeclKind::Fn, coroutine_marker)
});
let sig = hir::FnSig {
decl,
Expand Down Expand Up @@ -742,7 +742,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let (generics, (decl, fn_args)) = self.lower_generics(generics, itctx, |this| {
(
// Disallow `impl Trait` in foreign items.
this.lower_fn_decl(fdec, i.id, sig.span, FnDeclKind::ExternFn, None),
this.lower_fn_decl(fdec, i.id, FnDeclKind::ExternFn, None),
this.lower_fn_params_to_idents(fdec),
)
});
Expand Down Expand Up @@ -1681,7 +1681,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let header = self.lower_fn_header(sig.header, hir::Safety::Safe, attrs);
let itctx = ImplTraitContext::Universal;
let (generics, decl) = self.lower_generics(generics, itctx, |this| {
this.lower_fn_decl(&sig.decl, id, sig.span, kind, coroutine_marker)
this.lower_fn_decl(&sig.decl, id, kind, coroutine_marker)
});
(generics, hir::FnSig { header, decl, span: self.lower_span(sig.span) })
}
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
generic_params,
safety: self.lower_safety(f.safety, hir::Safety::Safe),
abi: self.lower_extern(f.ext),
decl: self.lower_fn_decl(&f.decl, t.id, t.span, FnDeclKind::Pointer, None),
decl: self.lower_fn_decl(&f.decl, t.id, FnDeclKind::Pointer, None),
param_idents: self.lower_fn_params_to_idents(&f.decl),
}))
}
Expand Down Expand Up @@ -1962,7 +1962,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
&mut self,
decl: &FnDecl,
fn_node_id: NodeId,
fn_span: Span,
kind: FnDeclKind,
coro: Option<CoroutineMarker>,
) -> &'hir hir::FnDecl<'hir> {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_expand/src/mbe/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ pub(super) fn failed_to_match_macro(
let mut tracker = CollectTrackerAndEmitter::new(name, psess.dcx(), sp);

let try_success_result = match args {
FailedMacro::Func => try_match_macro(psess, name, body, rules, &mut tracker),
FailedMacro::Func => try_match_macro(psess, body, rules, &mut tracker),
FailedMacro::Attr(attr_args) => {
try_match_macro_attr(psess, name, attr_args, body, rules, &mut tracker)
try_match_macro_attr(psess, attr_args, body, rules, &mut tracker)
}
FailedMacro::Derive => try_match_macro_derive(psess, name, body, rules, &mut tracker),
FailedMacro::Derive => try_match_macro_derive(psess, body, rules, &mut tracker),
};

if try_success_result.is_ok() {
Expand Down
9 changes: 3 additions & 6 deletions compiler/rustc_expand/src/mbe/macro_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl MacroRulesMacroExpander {
trace_macros_note(&mut cx.expansions, sp, msg);
}

match try_match_macro_derive(psess, name, body, rules, &mut NoopTracker) {
match try_match_macro_derive(psess, body, rules, &mut NoopTracker) {
Ok((rule_index, rule, named_matches)) => {
let MacroRule::Derive { rhs, .. } = rule else {
panic!("try_match_macro_derive returned non-derive rule");
Expand Down Expand Up @@ -447,7 +447,7 @@ fn expand_macro<'cx, 'a: 'cx>(
}

// Track nothing for the best performance.
let try_success_result = try_match_macro(psess, name, &arg, rules, &mut NoopTracker);
let try_success_result = try_match_macro(psess, &arg, rules, &mut NoopTracker);

match try_success_result {
Ok((rule_index, rule, named_matches)) => {
Expand Down Expand Up @@ -538,7 +538,7 @@ fn expand_macro_attr(
}

// Track nothing for the best performance.
match try_match_macro_attr(psess, name, &args, &body, rules, &mut NoopTracker) {
match try_match_macro_attr(psess, &args, &body, rules, &mut NoopTracker) {
Ok((i, rule, named_matches)) => {
let MacroRule::Attr { rhs, unsafe_rule, .. } = rule else {
panic!("try_macro_match_attr returned non-attr rule");
Expand Down Expand Up @@ -606,7 +606,6 @@ pub(super) enum CanRetry {
#[instrument(level = "debug", skip(psess, arg, rules, track), fields(tracking = %T::description()))]
pub(super) fn try_match_macro<'matcher, T: Tracker<'matcher>>(
psess: &ParseSess,
name: Ident,
arg: &TokenStream,
rules: &'matcher [MacroRule],
track: &mut T,
Expand Down Expand Up @@ -686,7 +685,6 @@ pub(super) fn try_match_macro<'matcher, T: Tracker<'matcher>>(
#[instrument(level = "debug", skip(psess, attr_args, attr_body, rules, track), fields(tracking = %T::description()))]
pub(super) fn try_match_macro_attr<'matcher, T: Tracker<'matcher>>(
psess: &ParseSess,
name: Ident,
attr_args: &TokenStream,
attr_body: &TokenStream,
rules: &'matcher [MacroRule],
Expand Down Expand Up @@ -743,7 +741,6 @@ pub(super) fn try_match_macro_attr<'matcher, T: Tracker<'matcher>>(
#[instrument(level = "debug", skip(psess, body, rules, track), fields(tracking = %T::description()))]
pub(super) fn try_match_macro_derive<'matcher, T: Tracker<'matcher>>(
psess: &ParseSess,
name: Ident,
body: &TokenStream,
rules: &'matcher [MacroRule],
track: &mut T,
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_hir_analysis/src/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ where

lint_redundant_lifetimes(tcx, body_def_id, &outlives_env);

let errors = infcx.resolve_regions_with_outlives_env(&outlives_env, tcx.def_span(body_def_id));
let errors = infcx.resolve_regions_with_outlives_env(&outlives_env);
if errors.is_empty() {
return Ok(());
}
Expand All @@ -215,8 +215,7 @@ where
// the implied bounds hack if this contains `bevy_ecs`'s `ParamSet` type.
false,
);
let errors_compat =
infcx_compat.resolve_regions_with_outlives_env(&outlives_env, tcx.def_span(body_def_id));
let errors_compat = infcx_compat.resolve_regions_with_outlives_env(&outlives_env);
if errors_compat.is_empty() {
// FIXME: Once we fix bevy, this would be the place to insert a warning
// to upgrade bevy.
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
pub(crate) fn write_splatted_call(
&self,
hir_id: HirId,
span: Span,
fn_id: SplatLoweringInfo<'tcx>,
callee_generic_args: Option<GenericArgsRef<'tcx>>,
first_tupled_arg_index: u16,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// FIXME(const_trait_impl): does not enforce constness yet
self.write_splatted_call(
call_expr.hir_id,
call_span,
fn_id,
callee_generic_args,
first_tupled_arg_index,
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_infer/src/infer/outlives/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::iter;
use rustc_data_structures::undo_log::UndoLogs;
use rustc_middle::traits::query::OutlivesBound;
use rustc_middle::ty;
use rustc_span::Span;
use tracing::instrument;

use self::env::OutlivesEnvironment;
Expand Down Expand Up @@ -44,9 +43,8 @@ impl<'tcx> InferCtxt<'tcx> {
pub fn resolve_regions_with_outlives_env(
&self,
outlives_env: &OutlivesEnvironment<'tcx>,
span: Span,
) -> Vec<RegionResolutionError<'tcx>> {
self.process_registered_region_obligations(outlives_env, span);
self.process_registered_region_obligations(outlives_env);

let mut storage = {
let mut inner = self.inner.borrow_mut();
Expand Down
7 changes: 1 addition & 6 deletions compiler/rustc_infer/src/infer/outlives/obligations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ use rustc_middle::ty::{
self, GenericArgKind, GenericArgsRef, PolyTypeOutlivesClause, Region, RegionVid, Ty, TyCtxt,
TypeVisitableExt, Upcast, eager_resolve_vars,
};
use rustc_span::Span;
use rustc_type_ir::region_constraint::{self, LeafRegionConstraint};
use smallvec::smallvec;
use tracing::{debug, instrument};
Expand Down Expand Up @@ -335,11 +334,7 @@ impl<'tcx> InferCtxt<'tcx> {
/// invoked after all type-inference variables have been bound --
/// right before lexical region resolution.
#[instrument(level = "debug", skip(self, outlives_env))]
pub fn process_registered_region_obligations(
&self,
outlives_env: &OutlivesEnvironment<'tcx>,
span: Span,
) {
pub fn process_registered_region_obligations(&self, outlives_env: &OutlivesEnvironment<'tcx>) {
assert!(!self.in_snapshot(), "cannot process registered region obligations in a snapshot");

if self.tcx.assumptions_on_binders() {
Expand Down
13 changes: 3 additions & 10 deletions compiler/rustc_mir_build/src/thir/pattern/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl<'p, 'tcx> Visitor<'p, 'tcx> for MatchVisitor<'p, 'tcx> {
self.check_match(scrutinee, arms, MatchSource::Normal, span);
}
ExprKind::Let { ref pat, expr } => {
self.check_let(pat, Some(expr), ex.span, None);
self.check_let(pat, Some(expr), ex.span);
}
ExprKind::LogicalOp { op: LogicalOp::And, .. }
if !matches!(self.let_source, LetSource::None) =>
Expand All @@ -180,9 +180,8 @@ impl<'p, 'tcx> Visitor<'p, 'tcx> for MatchVisitor<'p, 'tcx> {
self.with_hir_source(hir_id, |this| {
let let_source =
if else_block.is_some() { LetSource::LetElse } else { LetSource::PlainLet };
let else_span = else_block.map(|bid| this.thir.blocks[bid].span);
this.with_let_source(let_source, |this| {
this.check_let(pattern, initializer, span, else_span)
this.check_let(pattern, initializer, span)
});
visit::walk_stmt(this, stmt);
});
Expand Down Expand Up @@ -424,13 +423,7 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> {
}

#[instrument(level = "trace", skip(self))]
fn check_let(
&mut self,
pat: &'p Pat<'tcx>,
scrutinee: Option<ExprId>,
span: Span,
else_span: Option<Span>,
) {
fn check_let(&mut self, pat: &'p Pat<'tcx>, scrutinee: Option<ExprId>, span: Span) {
assert!(self.let_source != LetSource::None);
let scrut = scrutinee.map(|id| &self.thir[id]);
if let LetSource::PlainLet = self.let_source {
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_mir_transform/src/gvn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,6 @@ impl<'body, 'a, 'tcx> VnState<'body, 'a, 'tcx> {
#[instrument(level = "trace", skip(self), ret)]
fn simplify_rvalue(
&mut self,
lhs: &Place<'tcx>,
rvalue: &mut Rvalue<'tcx>,
location: Location,
) -> Option<VnIndex> {
Expand Down Expand Up @@ -2100,7 +2099,7 @@ impl<'tcx> MutVisitor<'tcx> for VnState<'_, '_, 'tcx> {
) {
self.simplify_place_projection(lhs, location);

let value = self.simplify_rvalue(lhs, rvalue, location);
let value = self.simplify_rvalue(rvalue, location);
if let Some(value) = value {
// FIXME: Is it correct to make these retagging assignments?
if let Some(const_) = self.try_as_constant(value) {
Expand Down
9 changes: 3 additions & 6 deletions compiler/rustc_mir_transform/src/pass_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,10 @@ fn run_passes_inner<'tcx>(
continue;
};

if is_optimization_stage(body, phase_change)
if body.phase == MirPhase::Runtime(RuntimePhase::PostCleanup)
&& phase_change == Some(MirPhase::Runtime(RuntimePhase::Optimized))
&& let Some(limit) = &tcx.sess.opts.unstable_opts.mir_opt_bisect_limit
&& matches!(pass.policy(&ctx), PassPolicy::Optional { .. })
&& limited_by_opt_bisect(
tcx,
tcx.def_path_debug_str(body.source.def_id()),
Expand Down Expand Up @@ -417,11 +419,6 @@ pub(super) fn dump_mir_for_phase_change<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tc
}
}

fn is_optimization_stage(body: &Body<'_>, phase_change: Option<MirPhase>) -> bool {
body.phase == MirPhase::Runtime(RuntimePhase::PostCleanup)
&& phase_change == Some(MirPhase::Runtime(RuntimePhase::Optimized))
}

fn limited_by_opt_bisect<'tcx, P>(
tcx: TyCtxt<'tcx>,
def_path: String,
Expand Down
7 changes: 2 additions & 5 deletions compiler/rustc_next_trait_solver/src/canonical/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ where
/// the `normalization_nested_goals`
pub(super) fn instantiate_and_apply_query_response<D, I>(
delegate: &D,
param_env: I::ParamEnv,
original_values: &[I::GenericArg],
response: CanonicalResponse<I>,
span: I::Span,
Expand All @@ -115,7 +114,7 @@ where
let Response { var_values, external_constraints, certainty } =
delegate.instantiate_canonical(response, instantiation);

unify_query_var_values(delegate, param_env, &original_values, var_values, span);
unify_query_var_values(delegate, &original_values, var_values, span);

let ExternalConstraintsData { region_constraints, opaque_types, normalization_nested_goals } =
&*external_constraints;
Expand Down Expand Up @@ -490,7 +489,6 @@ where
#[instrument(level = "trace", skip(delegate))]
fn unify_query_var_values<D, I>(
delegate: &D,
param_env: I::ParamEnv,
original_values: &[I::GenericArg],
var_values: CanonicalVarValues<I>,
span: I::Span,
Expand Down Expand Up @@ -577,7 +575,6 @@ where
pub fn instantiate_canonical_state<D, I, T>(
delegate: &D,
span: I::Span,
param_env: I::ParamEnv,
prev_universe: ty::UniverseIndex,
orig_values: &mut ThinVec<I::GenericArg>,
state: inspect::CanonicalState<I, T>,
Expand Down Expand Up @@ -609,7 +606,7 @@ where

let inspect::State { var_values, data } = delegate.instantiate_canonical(state, instantiation);

unify_query_var_values(delegate, param_env, orig_values, var_values, span);
unify_query_var_values(delegate, orig_values, var_values, span);
data
}

Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ where

let (normalization_nested_goals, certainty) = instantiate_and_apply_query_response(
self.delegate,
goal.param_env,
&orig_values,
response,
self.origin_span,
Expand Down Expand Up @@ -1953,7 +1952,6 @@ pub(super) fn evaluate_root_goal_for_proof_tree<D: SolverDelegate<Interner = I>,

let (normalization_nested_goals, _certainty) = instantiate_and_apply_query_response(
delegate,
goal.param_env,
&proof_tree.orig_values,
response,
origin_span,
Expand Down
10 changes: 6 additions & 4 deletions compiler/rustc_trait_selection/src/regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ impl<'tcx> InferCtxt<'tcx> {
param_env: ty::ParamEnv<'tcx>,
assumed_wf_tys: impl IntoIterator<Item = Ty<'tcx>>,
) -> Vec<RegionResolutionError<'tcx>> {
self.resolve_regions_with_outlives_env(
&OutlivesEnvironment::new(self, body_def_id, param_env, assumed_wf_tys),
self.tcx.def_span(body_def_id),
)
self.resolve_regions_with_outlives_env(&OutlivesEnvironment::new(
self,
body_def_id,
param_env,
assumed_wf_tys,
))
}
}

Expand Down
Loading
Loading