Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4da823b
Do not enable split debuginfo for windows-gnu
mati865 Feb 19, 2026
7adb9ba
Add is_disconnected functions to mpsc and mpmc channels
LevitatingBusinessMan Feb 27, 2026
feef7b4
warn of possible race condition in channel is_disconnected doc
LevitatingBusinessMan Feb 28, 2026
f5a2bb6
Add hygiene annotations for tokens in macro_rules! bodies
aytey Mar 2, 2026
bf6db4f
Add regression tests for token hygiene annotations in macro bodies
aytey Mar 3, 2026
ce2de64
assign mpsc_is_disconnected issue 153668
LevitatingBusinessMan Mar 10, 2026
b36ee95
ci: add runners for vanilla LLVM 22
cuviper Mar 11, 2026
b3b6627
Derive Macro Eq: link to more detailed documentation
DanielEScherzer Mar 13, 2026
6e7d6d7
Add `Wake` diagnostic item for `alloc::task::Wake`
samueltardieu Mar 12, 2026
02ac190
dec2flt: Rename `Integer` to `Int`
tgross35 Jan 31, 2026
b07c043
dec2flt: Split up the `RawFloat` trait
tgross35 Jan 31, 2026
bec94a3
dec2flt: Move internal traits to better locations
tgross35 Jan 31, 2026
24d86b5
Fix rust build failure for vxworks
gautam899 Mar 3, 2026
7ec77fd
Fix invalid suggestion on `for-loops-over-fallibles`
JohnTitor Mar 15, 2026
924374c
mGCA: Lower const generic args to infer when needed
reddevilmidzy Mar 17, 2026
11810b8
fix inference variables leaking into HIR const lowering logic
Human9000-bit Mar 8, 2026
5113488
Improve `ty::Infer` handling during const literal lowering
Human9000-bit Mar 17, 2026
69fd61e
merge `kindck/send-*` tests
cyrgani Mar 17, 2026
b4c1677
Do not lint `for-loops-over-fallibles` on external macros
JohnTitor Mar 15, 2026
cfe18cf
Correct dir name
JohnTitor Mar 15, 2026
caeda18
reformat and update remaining `ui/kindck` tests
cyrgani Mar 17, 2026
62b9fa1
move tests from `ui/kindck` to `ui/traits`
cyrgani Mar 17, 2026
eda328c
delete incorrect test
cyrgani Mar 17, 2026
38aa322
borrowck/type_check: remove helper left-over from unsized locals
RalfJung Mar 18, 2026
6b0fecf
merge `regions-outlives-nominal-type-*` tests into one file
cyrgani Mar 18, 2026
a4d2384
Move hashes into a separate json file
jyn514 Mar 18, 2026
49bb371
When single impl can satisfy inference error, suggest type
estebank Mar 11, 2026
ca2139d
Point at return type when it is the source of the type expectation
estebank Mar 16, 2026
1098a9d
Support `--bless`-ing editor hashes
jyn514 Mar 18, 2026
ebb1f47
Optimize 128-bit integer formatting
jhpratt Mar 19, 2026
b2e8177
Reorder `define_callbacks`.
nnethercote Mar 19, 2026
091d000
Minor `define_callbacks` tweaks.
nnethercote Mar 19, 2026
7cec833
Rename `query_helper_param_ty`.
nnethercote Mar 19, 2026
ed012ea
Rollup merge of #152870 - mati865:mingw-disable-packed-debuginfo-in-b…
JonathanBrouwer Mar 19, 2026
2c49023
Rollup merge of #153333 - gautam899:main, r=Mark-Simulacrum
JonathanBrouwer Mar 19, 2026
1c77331
Rollup merge of #153681 - cuviper:ci-llvm-22, r=Mark-Simulacrum
JonathanBrouwer Mar 19, 2026
3734ede
Rollup merge of #153727 - estebank:issue-100802, r=JohnTitor
JonathanBrouwer Mar 19, 2026
ea542a0
Rollup merge of #153824 - samueltardieu:wake-diagnostic-item, r=Mark-…
JonathanBrouwer Mar 19, 2026
f7ac53b
Rollup merge of #154077 - jhpratt:optimize-128-bit-formatting, r=dtolnay
JonathanBrouwer Mar 19, 2026
a00da10
Rollup merge of #154078 - nnethercote:define_callbacks-tweaks, r=Zala…
JonathanBrouwer Mar 19, 2026
7c6fc44
Rollup merge of #151905 - tgross35:dec2flt-traits, r=Mark-Simulacrum
JonathanBrouwer Mar 19, 2026
981f837
Rollup merge of #153170 - LevitatingBusinessMan:is_disconnected, r=Ma…
JonathanBrouwer Mar 19, 2026
e103550
Rollup merge of #153308 - aytey:macro_meta_hygiene, r=jdonszelmann
JonathanBrouwer Mar 19, 2026
a3898aa
Rollup merge of #153557 - Human9000-bit:issue-153525, r=BoxyUwU
JonathanBrouwer Mar 19, 2026
793d1c9
Rollup merge of #153804 - DanielEScherzer:derive-eq-docs, r=Mark-Simu…
JonathanBrouwer Mar 19, 2026
0c78b9a
Rollup merge of #153913 - JohnTitor:issue-148814, r=Kivooeo
JonathanBrouwer Mar 19, 2026
db7db62
Rollup merge of #153974 - estebank:issue-43608, r=nnethercote
JonathanBrouwer Mar 19, 2026
dfba606
Rollup merge of #153987 - reddevilmidzy:mgca-ast, r=BoxyUwU
JonathanBrouwer Mar 19, 2026
94386a3
Rollup merge of #154018 - cyrgani:kindck-tests, r=jieyouxu
JonathanBrouwer Mar 19, 2026
690edba
Rollup merge of #154036 - RalfJung:unsized-locals-helper-rm, r=nnethe…
JonathanBrouwer Mar 19, 2026
bd9ffab
Rollup merge of #154038 - cyrgani:regiontests, r=Kivooeo
JonathanBrouwer Mar 19, 2026
71e463b
Rollup merge of #154041 - ferrocene:jyn/bless-hashes, r=jieyouxu
JonathanBrouwer Mar 19, 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
7 changes: 4 additions & 3 deletions bootstrap.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,10 @@
# its historical default, but when compiling the compiler itself, we skip it by
# default since we know it's safe to do so in that case.
#
# On Windows platforms, packed debuginfo is the only supported option,
# producing a `.pdb` file.
#split-debuginfo = if linux { off } else if windows { packed } else if apple { unpacked }
# On Windows MSVC platforms, packed debuginfo is the only supported option,
# producing a `.pdb` file. On Windows GNU rustc doesn't support splitting debuginfo,
# and enabling it causes issues.
#split-debuginfo = if linux || windows-gnu { off } else if windows-msvc { packed } else if apple { unpacked }

# Path to the `llvm-config` binary of the installation of a custom LLVM to link
# against. Note that if this is specified we don't compile LLVM at all for this
Expand Down
10 changes: 7 additions & 3 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1310,9 +1310,13 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
}
GenericArg::Type(self.lower_ty_alloc(ty, itctx).try_as_ambig_ty().unwrap())
}
ast::GenericArg::Const(ct) => GenericArg::Const(
self.lower_anon_const_to_const_arg_and_alloc(ct).try_as_ambig_ct().unwrap(),
),
ast::GenericArg::Const(ct) => {
let ct = self.lower_anon_const_to_const_arg_and_alloc(ct);
match ct.try_as_ambig_ct() {
Some(ct) => GenericArg::Const(ct),
None => GenericArg::Infer(hir::InferArg { hir_id: ct.hir_id, span: ct.span }),
}
}
}
}

Expand Down
17 changes: 17 additions & 0 deletions compiler/rustc_ast_pretty/src/pprust/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,23 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
TokenTree::Token(token, spacing) => {
let token_str = self.token_to_string_ext(token, convert_dollar_crate);
self.word(token_str);
// Emit hygiene annotations for identity-bearing tokens,
// matching how print_ident() and print_lifetime() call ann_post().
match token.kind {
token::Ident(name, _) => {
self.ann_post(Ident::new(name, token.span));
}
token::NtIdent(ident, _) => {
self.ann_post(ident);
}
token::Lifetime(name, _) => {
self.ann_post(Ident::new(name, token.span));
}
token::NtLifetime(ident, _) => {
self.ann_post(ident);
}
_ => {}
}
if let token::DocComment(..) = token.kind {
self.hardbreak()
}
Expand Down
17 changes: 7 additions & 10 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
self.body
}

fn unsized_feature_enabled(&self) -> bool {
self.tcx().features().unsized_fn_params()
}

/// Equate the inferred type and the annotated type for user type annotations
#[instrument(skip(self), level = "debug")]
fn check_user_type_annotations(&mut self) {
Expand Down Expand Up @@ -660,7 +656,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
);
}

if !self.unsized_feature_enabled() {
if !self.tcx().features().unsized_fn_params() {
let trait_ref = ty::TraitRef::new(
tcx,
tcx.require_lang_item(LangItem::Sized, self.last_span),
Expand Down Expand Up @@ -936,9 +932,10 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
}
}

// When `unsized_fn_params` is enabled, only function calls
// and nullary ops are checked in `check_call_dest`.
if !self.unsized_feature_enabled() {
// When `unsized_fn_params` is enabled, this is checked in `check_call_dest`,
// and `hir_typeck` still forces all non-argument locals to be sized (i.e., we don't
// fully re-check what was already checked on HIR).
if !self.tcx().features().unsized_fn_params() {
match self.body.local_kind(local) {
LocalKind::ReturnPointer | LocalKind::Arg => {
// return values of normal functions are required to be
Expand Down Expand Up @@ -1953,8 +1950,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
}

// When `unsized_fn_params` is not enabled,
// this check is done at `check_local`.
if self.unsized_feature_enabled() {
// this check is done at `visit_local_decl`.
if self.tcx().features().unsized_fn_params() {
let span = term.source_info.span;
self.ensure_place_sized(dest_ty, span);
}
Expand Down
13 changes: 10 additions & 3 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2874,6 +2874,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
span: Span,
) -> Const<'tcx> {
let tcx = self.tcx();

let ty = if !ty.has_infer() { Some(ty) } else { None };

if let LitKind::Err(guar) = *kind {
return ty::Const::new_error(tcx, guar);
}
Expand Down Expand Up @@ -2905,16 +2908,20 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
};

let lit_input = match expr.kind {
hir::ExprKind::Lit(lit) => Some(LitToConstInput { lit: lit.node, ty, neg: false }),
hir::ExprKind::Lit(lit) => {
Some(LitToConstInput { lit: lit.node, ty: Some(ty), neg: false })
}
hir::ExprKind::Unary(hir::UnOp::Neg, expr) => match expr.kind {
hir::ExprKind::Lit(lit) => Some(LitToConstInput { lit: lit.node, ty, neg: true }),
hir::ExprKind::Lit(lit) => {
Some(LitToConstInput { lit: lit.node, ty: Some(ty), neg: true })
}
_ => None,
},
_ => None,
};

lit_input.and_then(|l| {
if const_lit_matches_ty(tcx, &l.lit, l.ty, l.neg) {
if const_lit_matches_ty(tcx, &l.lit, ty, l.neg) {
tcx.at(expr.span)
.lit_to_const(l)
.map(|value| ty::Const::new_value(tcx, value.valtree, value.ty))
Expand Down
41 changes: 40 additions & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc_hir::attrs::DivergingBlockBehavior;
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::Visitor;
use rustc_hir::{Expr, ExprKind, HirId, LangItem, Node, QPath, is_range_literal};
use rustc_hir::{Expr, ExprKind, FnRetTy, HirId, LangItem, Node, QPath, is_range_literal};
use rustc_hir_analysis::check::potentially_plural_count;
use rustc_hir_analysis::hir_ty_lowering::{HirTyLowerer, PermitVariants};
use rustc_index::IndexVec;
Expand Down Expand Up @@ -1587,6 +1587,45 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
}
err.span_note(spans, format!("{} defined here", self.tcx.def_descr(def_id)));
if let DefKind::Fn | DefKind::AssocFn = self.tcx.def_kind(def_id)
&& let ty::Param(_) =
self.tcx.fn_sig(def_id).instantiate_identity().skip_binder().output().kind()
&& let parent = self.tcx.hir_get_parent_item(call_expr.hir_id).def_id
&& let Some((output, body_id)) = match self.tcx.hir_node_by_def_id(parent) {
hir::Node::Item(hir::Item {
kind: hir::ItemKind::Fn { sig, body, .. },
..
})
| hir::Node::TraitItem(hir::TraitItem {
kind: hir::TraitItemKind::Fn(sig, hir::TraitFn::Provided(body)),
..
})
| hir::Node::ImplItem(hir::ImplItem {
kind: hir::ImplItemKind::Fn(sig, body),
..
}) => Some((sig.decl.output, body)),
_ => None,
}
&& let expr = self.tcx.hir_body(*body_id).value
&& (expr.peel_blocks().span == call_expr.span
|| matches!(
self.tcx.parent_hir_node(call_expr.hir_id),
hir::Node::Expr(hir::Expr { kind: hir::ExprKind::Ret(_), .. })
))
{
err.span_label(
output.span(),
match output {
FnRetTy::DefaultReturn(_) => format!(
"this implicit `()` return type influences the call expression's return type"
),
FnRetTy::Return(_) => {
"this return type influences the call expression's return type"
.to_string()
}
},
);
}
} else if let Some(hir::Node::Expr(e)) = self.tcx.hir_get_if_local(def_id)
&& let hir::ExprKind::Closure(hir::Closure { body, .. }) = &e.kind
{
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_lint/src/for_loops_over_fallibles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopsOverFallibles {
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
let Some((pat, arg)) = extract_for_loop(expr) else { return };

// Do not put suggestions for external macros.
if pat.span.from_expansion() {
return;
}

let arg_span = arg.span.source_callsite();

let ty = cx.typeck_results().expr_ty(arg);
Expand Down Expand Up @@ -77,6 +82,8 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopsOverFallibles {
};

let sub = if let Some(recv) = extract_iterator_next_call(cx, arg)
&& recv.span.can_be_used_for_suggestions()
&& recv.span.between(arg_span.shrink_to_hi()).can_be_used_for_suggestions()
&& let Ok(recv_snip) = cx.sess().source_map().span_to_snippet(recv.span)
{
ForLoopsOverFalliblesLoopSub::RemoveNext {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ use crate::mir::mono::{
CodegenUnit, CollectionMode, MonoItem, MonoItemPartitions, NormalizationErrorInMono,
};
use crate::query::describe_as_module;
use crate::query::plumbing::{define_callbacks, query_helper_param_ty};
use crate::query::plumbing::{define_callbacks, maybe_into_query_key};
use crate::traits::query::{
CanonicalAliasGoal, CanonicalDropckOutlivesGoal, CanonicalImpliedOutlivesBoundsGoal,
CanonicalMethodAutoderefStepsGoal, CanonicalPredicateGoal, CanonicalTypeOpAscribeUserTypeGoal,
Expand Down
Loading
Loading