Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
22996d6
Remove inactive nvptx maintainer
ZuseZ4 Dec 22, 2025
b0e65da
rustc_parse_format: improve error for missing `:` before `?` in forma…
Unique-Usman Jan 7, 2026
a9749be
mgca: Type-check fields of ADT constructor expr const args
camelid Jan 5, 2026
1c2cb16
mgca: Type-check fields of tuple expr const args
camelid Jan 8, 2026
3c136cc
Fix broken documentation links to SipHash
eggyal Jan 9, 2026
b9ae4f7
rustdoc_json: Remove one call to `std::mem::take` in `after_krate`.
Hywan Jan 9, 2026
5af08c0
Ignore `rustc-src-gpl` in fast try builds
Kobzol Jan 9, 2026
01e8f14
Mention that `rustc_codegen_gcc` is a subtree in `rustc-dev-guide`
GuillaumeGomez Jan 9, 2026
47f28fc
Refactor artifact keep mode in bootstrap
Kobzol Jan 9, 2026
2a39322
Supress unused_parens lint for guard patterns
eggyal Jan 9, 2026
e275c23
Update bors email in CI postprocessing step
Kobzol Jan 9, 2026
7c7cf45
Don't special-case `while` block type mismatch
eggyal Jan 9, 2026
5674be2
Don't suggest breaking with value from `for` or `while` loops
eggyal Jan 9, 2026
1df4902
Rollup merge of #150269 - update-nvptx-maintainers, r=jieyouxu
matthiaskrgr Jan 10, 2026
727688a
Rollup merge of #150713 - mgca-typeck-struct-fields, r=BoxyUwU
matthiaskrgr Jan 10, 2026
a8d66d4
Rollup merge of #150765 - ua/missing-colon, r=estebank
matthiaskrgr Jan 10, 2026
6ab61b3
Rollup merge of #150847 - siphash-doc-link, r=joboet
matthiaskrgr Jan 10, 2026
68bd262
Rollup merge of #150867 - chore-librustdoc-json-mem-take, r=Guillaume…
matthiaskrgr Jan 10, 2026
86806ab
Rollup merge of #150872 - issue-150850, r=dianne
matthiaskrgr Jan 10, 2026
da772d5
Rollup merge of #150874 - fast-try-build-src-gpl, r=jieyouxu
matthiaskrgr Jan 10, 2026
980e6ad
Rollup merge of #150875 - bootstrap-refactor-build-outputs, r=bjorn3
matthiaskrgr Jan 10, 2026
0161646
Rollup merge of #150876 - gcc-dev-guide, r=Kobzol
matthiaskrgr Jan 10, 2026
e7b0803
Rollup merge of #150882 - issue-149594, r=JonathanBrouwer
matthiaskrgr Jan 10, 2026
9399309
Rollup merge of #150884 - bors-email-ci, r=jieyouxu
matthiaskrgr Jan 10, 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ jobs:
fi

# Get closest bors merge commit
PARENT_COMMIT=`git rev-list --author='bors <bors@rust-lang.org>' -n1 --first-parent HEAD^1`
PARENT_COMMIT=`git rev-list --author='122020455+rust-bors\[bot\]@users.noreply.github.com' -n1 --first-parent HEAD^1`

./build/citool/debug/citool postprocess-metrics \
--job-name ${CI_JOB_NAME} \
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_builtin_macros/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ builtin_macros_expected_other = expected operand, {$is_inline_asm ->

builtin_macros_export_macro_rules = cannot export macro_rules! macros from a `proc-macro` crate type currently

builtin_macros_format_add_missing_colon = add a colon before the format specifier

builtin_macros_format_duplicate_arg = duplicate argument named `{$ident}`
.label1 = previously here
.label2 = duplicate argument
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_builtin_macros/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,15 @@ pub(crate) enum InvalidFormatStringSuggestion {
span: Span,
replacement: String,
},
#[suggestion(
builtin_macros_format_add_missing_colon,
code = ":?",
applicability = "machine-applicable"
)]
AddMissingColon {
#[primary_span]
span: Span,
},
}

#[derive(Diagnostic)]
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_builtin_macros/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ fn make_format_args(
replacement,
});
}
parse::Suggestion::AddMissingColon(span) => {
let span = fmt_span.from_inner(InnerSpan::new(span.start, span.end));
e.sugg_ = Some(errors::InvalidFormatStringSuggestion::AddMissingColon { span });
}
}
let guar = ecx.dcx().emit_err(e);
return ExpandResult::Ready(Err(guar));
Expand Down
9 changes: 4 additions & 5 deletions compiler/rustc_hir_typeck/src/coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use rustc_middle::ty::adjustment::{
};
use rustc_middle::ty::error::TypeError;
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, Span};
use rustc_span::{BytePos, DUMMY_SP, Span};
use rustc_trait_selection::infer::InferCtxtExt as _;
use rustc_trait_selection::solve::inspect::{self, InferCtxtProofTreeExt, ProofTreeVisitor};
use rustc_trait_selection::solve::{Certainty, Goal, NoSolution};
Expand Down Expand Up @@ -1828,10 +1828,9 @@ impl<'tcx> CoerceMany<'tcx> {
// If the block is from an external macro or try (`?`) desugaring, then
// do not suggest adding a semicolon, because there's nowhere to put it.
// See issues #81943 and #87051.
&& matches!(
cond_expr.span.desugaring_kind(),
None | Some(DesugaringKind::WhileLoop)
)
// Similarly, if the block is from a loop desugaring, then also do not
// suggest adding a semicolon. See issue #150850.
&& cond_expr.span.desugaring_kind().is_none()
&& !cond_expr.span.in_external_macro(fcx.tcx.sess.source_map())
&& !matches!(
cond_expr.kind,
Expand Down
22 changes: 15 additions & 7 deletions compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
use rustc_hir::lang_items::LangItem;
use rustc_hir::{
self as hir, Arm, CoroutineDesugaring, CoroutineKind, CoroutineSource, Expr, ExprKind,
GenericBound, HirId, Node, PatExpr, PatExprKind, Path, QPath, Stmt, StmtKind, TyKind,
WherePredicateKind, expr_needs_parens, is_range_literal,
GenericBound, HirId, LoopSource, Node, PatExpr, PatExprKind, Path, QPath, Stmt, StmtKind,
TyKind, WherePredicateKind, expr_needs_parens, is_range_literal,
};
use rustc_hir_analysis::hir_ty_lowering::HirTyLowerer;
use rustc_hir_analysis::suggest_impl_trait;
Expand Down Expand Up @@ -1170,23 +1170,31 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
let found = self.resolve_vars_if_possible(found);

let in_loop = self.is_loop(id)
|| self
.tcx
let innermost_loop = if self.is_loop(id) {
Some(self.tcx.hir_node(id))
} else {
self.tcx
.hir_parent_iter(id)
.take_while(|(_, node)| {
// look at parents until we find the first body owner
node.body_id().is_none()
})
.any(|(parent_id, _)| self.is_loop(parent_id));
.find_map(|(parent_id, node)| self.is_loop(parent_id).then_some(node))
};
let can_break_with_value = innermost_loop.is_some_and(|node| {
matches!(
node,
Node::Expr(Expr { kind: ExprKind::Loop(_, _, LoopSource::Loop, ..), .. })
)
});

let in_local_statement = self.is_local_statement(id)
|| self
.tcx
.hir_parent_iter(id)
.any(|(parent_id, _)| self.is_local_statement(parent_id));

if in_loop && in_local_statement {
if can_break_with_value && in_local_statement {
err.multipart_suggestion(
"you might have meant to break the loop with this value",
vec![
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_lint/src/unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,8 @@ impl UnusedParens {
// `&(a..=b)`, there is a recursive `check_pat` on `a` and `b`, but we will assume
// that if there are unnecessary parens they serve a purpose of readability.
PatKind::Range(..) => return,
// Parentheses may be necessary to disambiguate precedence in guard patterns.
PatKind::Guard(..) => return,
// Avoid `p0 | .. | pn` if we should.
PatKind::Or(..) if avoid_or => return,
// Avoid `mut x` and `mut x @ p` if we should:
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_middle/src/ty/consts/valtree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ impl<'tcx> Value<'tcx> {
}
}

/// Destructures array, ADT or tuple constants into the constants
/// of their fields.
/// Destructures ADT constants into the constants of their fields.
pub fn destructure_adt_const(&self) -> ty::DestructuredAdtConst<'tcx> {
let fields = self.to_branch();

Expand Down
29 changes: 25 additions & 4 deletions compiler/rustc_parse_format/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ pub enum Suggestion {
/// `format!("{foo:?x}")` -> `format!("{foo:x?}")`
/// `format!("{foo:?X}")` -> `format!("{foo:X?}")`
ReorderFormatParameter(Range<usize>, String),
/// Add missing colon:
/// `format!("{foo?}")` -> `format!("{foo:?}")`
AddMissingColon(Range<usize>),
}

/// The parser structure for interpreting the input format string. This is
Expand Down Expand Up @@ -453,10 +456,11 @@ impl<'input> Parser<'input> {
suggestion: Suggestion::None,
});

if let Some((_, _, c)) = self.peek() {
match c {
'?' => self.suggest_format_debug(),
'<' | '^' | '>' => self.suggest_format_align(c),
if let (Some((_, _, c)), Some((_, _, nc))) = (self.peek(), self.peek_ahead()) {
match (c, nc) {
('?', '}') => self.missing_colon_before_debug_formatter(),
('?', _) => self.suggest_format_debug(),
('<' | '^' | '>', _) => self.suggest_format_align(c),
_ => self.suggest_positional_arg_instead_of_captured_arg(arg),
}
}
Expand Down Expand Up @@ -849,6 +853,23 @@ impl<'input> Parser<'input> {
}
}

fn missing_colon_before_debug_formatter(&mut self) {
if let Some((range, _)) = self.consume_pos('?') {
let span = range.clone();
self.errors.insert(
0,
ParseError {
description: "expected `}`, found `?`".to_owned(),
note: Some(format!("to print `{{`, you can escape it using `{{{{`",)),
label: "expected `:` before `?` to format with `Debug`".to_owned(),
span: range,
secondary_label: None,
suggestion: Suggestion::AddMissingColon(span),
},
);
}
}

fn suggest_format_align(&mut self, alignment: char) {
if let Some((range, _)) = self.consume_pos(alignment) {
self.errors.insert(
Expand Down
48 changes: 47 additions & 1 deletion compiler/rustc_trait_selection/src/traits/wf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,53 @@ impl<'a, 'tcx> TypeVisitor<TyCtxt<'tcx>> for WfPredicates<'a, 'tcx> {
| ty::ConstKind::Placeholder(..) => {
// These variants are trivially WF, so nothing to do here.
}
ty::ConstKind::Value(..) => {
ty::ConstKind::Value(val) => {
// FIXME(mgca): no need to feature-gate once valtree lifetimes are not erased
if tcx.features().min_generic_const_args() {
match val.ty.kind() {
ty::Adt(adt_def, args) => {
let adt_val = val.destructure_adt_const();
let variant_def = adt_def.variant(adt_val.variant);
let cause = self.cause(ObligationCauseCode::WellFormed(None));
self.out.extend(variant_def.fields.iter().zip(adt_val.fields).map(
|(field_def, &field_val)| {
let field_ty =
tcx.type_of(field_def.did).instantiate(tcx, args);
let predicate = ty::PredicateKind::Clause(
ty::ClauseKind::ConstArgHasType(field_val, field_ty),
);
traits::Obligation::with_depth(
tcx,
cause.clone(),
self.recursion_depth,
self.param_env,
predicate,
)
},
));
}
ty::Tuple(field_tys) => {
let field_vals = val.to_branch();
let cause = self.cause(ObligationCauseCode::WellFormed(None));
self.out.extend(field_tys.iter().zip(field_vals).map(
|(field_ty, &field_val)| {
let predicate = ty::PredicateKind::Clause(
ty::ClauseKind::ConstArgHasType(field_val, field_ty),
);
traits::Obligation::with_depth(
tcx,
cause.clone(),
self.recursion_depth,
self.param_env,
predicate,
)
},
));
}
_ => {}
}
}

// FIXME: Enforce that values are structurally-matchable.
}
}
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/hash/sip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{cmp, ptr};
/// This is currently the default hashing function used by standard library
/// (e.g., `collections::HashMap` uses it by default).
///
/// See: <https://131002.net/siphash>
/// See: <https://github.com/veorq/SipHash>
#[unstable(feature = "hashmap_internals", issue = "none")]
#[deprecated(since = "1.13.0", note = "use `std::hash::DefaultHasher` instead")]
#[derive(Debug, Clone, Default)]
Expand All @@ -21,7 +21,7 @@ pub struct SipHasher13 {

/// An implementation of SipHash 2-4.
///
/// See: <https://131002.net/siphash/>
/// See: <https://github.com/veorq/SipHash>
#[unstable(feature = "hashmap_internals", issue = "none")]
#[deprecated(since = "1.13.0", note = "use `std::hash::DefaultHasher` instead")]
#[derive(Debug, Clone, Default)]
Expand All @@ -31,7 +31,7 @@ struct SipHasher24 {

/// An implementation of SipHash 2-4.
///
/// See: <https://131002.net/siphash/>
/// See: <https://github.com/veorq/SipHash>
///
/// SipHash is a general-purpose hashing function: it runs at a good
/// speed (competitive with Spooky and City) and permits strong _keyed_
Expand Down
51 changes: 43 additions & 8 deletions src/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use std::fs;
use std::path::{Path, PathBuf};

use crate::core::build_steps::compile::{
add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, std_crates_for_run_make,
ArtifactKeepMode, add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo,
std_crates_for_run_make,
};
use crate::core::build_steps::tool;
use crate::core::build_steps::tool::{
Expand Down Expand Up @@ -111,8 +112,7 @@ impl Step for Std {
builder.config.free_args.clone(),
&check_stamp,
vec![],
true,
false,
ArtifactKeepMode::OnlyRmeta,
);

drop(_guard);
Expand Down Expand Up @@ -148,7 +148,14 @@ impl Step for Std {
build_compiler,
target,
);
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
run_cargo(
builder,
cargo,
builder.config.free_args.clone(),
&stamp,
vec![],
ArtifactKeepMode::OnlyRmeta,
);
check_stamp
}

Expand Down Expand Up @@ -368,7 +375,14 @@ impl Step for Rustc {
let stamp =
build_stamp::librustc_stamp(builder, build_compiler, target).with_prefix("check");

run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
run_cargo(
builder,
cargo,
builder.config.free_args.clone(),
&stamp,
vec![],
ArtifactKeepMode::OnlyRmeta,
);

stamp
}
Expand Down Expand Up @@ -568,7 +582,14 @@ impl Step for CraneliftCodegenBackend {
)
.with_prefix("check");

run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
run_cargo(
builder,
cargo,
builder.config.free_args.clone(),
&stamp,
vec![],
ArtifactKeepMode::OnlyRmeta,
);
}

fn metadata(&self) -> Option<StepMetadata> {
Expand Down Expand Up @@ -639,7 +660,14 @@ impl Step for GccCodegenBackend {
)
.with_prefix("check");

run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
run_cargo(
builder,
cargo,
builder.config.free_args.clone(),
&stamp,
vec![],
ArtifactKeepMode::OnlyRmeta,
);
}

fn metadata(&self) -> Option<StepMetadata> {
Expand Down Expand Up @@ -777,7 +805,14 @@ fn run_tool_check_step(
.with_prefix(&format!("{display_name}-check"));

let _guard = builder.msg(builder.kind, display_name, mode, build_compiler, target);
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
run_cargo(
builder,
cargo,
builder.config.free_args.clone(),
&stamp,
vec![],
ArtifactKeepMode::OnlyRmeta,
);
}

tool_check_step!(Rustdoc {
Expand Down
Loading
Loading