Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
09f774d
Mark all arms as being from a desugaring when lowering `?` and for lo…
Jarcho Nov 23, 2025
2135bc1
Remove `rustc_lexer::cursor` module.
nnethercote Jan 21, 2026
506ea79
Move two `rustc_parse` error diagnostics.
nnethercote Jan 21, 2026
b33fdb2
Move `TokenDescription`.
nnethercote Jan 21, 2026
849725e
fix refining_impl_trait suggestion with return_type_notation
enthropy7 Jan 27, 2026
13141af
Consolidate type const checks on `tcx.is_type_const`
eggyal Feb 4, 2026
34cdaeb
Fix typos in riscv64a23-unknown-linux-gnu.md
wolfv Feb 5, 2026
9112039
Port rustc_effective_visibility to the new attribute parser
jdonszelmann Feb 5, 2026
dd61998
Convert to inline diagnostics in `rustc_borrowck`
JonathanBrouwer Feb 4, 2026
6782a19
Register functions in translation
JonathanBrouwer Feb 4, 2026
55d1ba1
Convert to inline diagnostics in `rustc_trait_selection`
JonathanBrouwer Feb 4, 2026
623c9cd
update compiler stable backport zulip msg
apiraino Feb 5, 2026
a2f9dec
Parse #[rustc_abi(..)]
Ozzy1423 Feb 5, 2026
5d42732
update openmp/offload builds to LLVM 22
ZuseZ4 Feb 6, 2026
1dfdfe8
chore: clearify tidy's error message
nyurik Feb 6, 2026
62d0533
Update error message for non-descriptive test files
nyurik Feb 6, 2026
dc87b28
Improve error message for non-descriptive test names
nyurik Feb 6, 2026
d40b633
Rollup merge of #149329 - Jarcho:for_question_ctxt, r=davidtwco
JonathanBrouwer Feb 6, 2026
c276f69
Rollup merge of #151474 - nnethercote:circ-deps, r=davidtwco
JonathanBrouwer Feb 6, 2026
3572553
Rollup merge of #151744 - enthropy7:fix-refining-impl-trait-rtn, r=da…
JonathanBrouwer Feb 6, 2026
8e67013
Rollup merge of #152107 - JonathanBrouwer:convert_borrowck, r=lqd
JonathanBrouwer Feb 6, 2026
82fa67f
Rollup merge of #152117 - JonathanBrouwer:convert_trait_selection2, r…
JonathanBrouwer Feb 6, 2026
015ffc3
Rollup merge of #152136 - eggyal:consolidate-type-const-checks, r=Box…
JonathanBrouwer Feb 6, 2026
07240e1
Rollup merge of #152155 - wolfv:patch-1, r=wesleywiser
JonathanBrouwer Feb 6, 2026
63f2d67
Rollup merge of #152170 - jdonszelmann:port-rustc-effective-visibilit…
JonathanBrouwer Feb 6, 2026
d26021a
Rollup merge of #152182 - apiraino:update-compiler-stable-backport-zu…
JonathanBrouwer Feb 6, 2026
73f8725
Rollup merge of #152184 - Ozzy1423:attrs3, r=jdonszelmann
JonathanBrouwer Feb 6, 2026
8f67025
Rollup merge of #152195 - ZuseZ4:update-offload-llvm22-A, r=jieyouxu
JonathanBrouwer Feb 6, 2026
2a5a629
Rollup merge of #152202 - nyurik:better-msg, r=jieyouxu
JonathanBrouwer Feb 6, 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
4 changes: 0 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3571,7 +3571,6 @@ dependencies = [
"rustc_abi",
"rustc_data_structures",
"rustc_errors",
"rustc_fluent_macro",
"rustc_graphviz",
"rustc_hir",
"rustc_index",
Expand Down Expand Up @@ -3771,7 +3770,6 @@ dependencies = [
"rustc_abi",
"rustc_ast",
"rustc_ast_pretty",
"rustc_borrowck",
"rustc_codegen_ssa",
"rustc_const_eval",
"rustc_data_structures",
Expand All @@ -3797,7 +3795,6 @@ dependencies = [
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
"serde_json",
"shlex",
"tracing",
Expand Down Expand Up @@ -4724,7 +4721,6 @@ dependencies = [
"rustc_ast",
"rustc_data_structures",
"rustc_errors",
"rustc_fluent_macro",
"rustc_hir",
"rustc_infer",
"rustc_macros",
Expand Down
21 changes: 11 additions & 10 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -966,14 +966,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
hir::ExprKind::Break(this.lower_loop_destination(None), Some(x_expr));
this.arena.alloc(this.expr(gen_future_span, expr_break))
});
self.arm(ready_pat, break_x)
self.arm(ready_pat, break_x, span)
};

// `::std::task::Poll::Pending => {}`
let pending_arm = {
let pending_pat = self.pat_lang_item_variant(span, hir::LangItem::PollPending, &[]);
let empty_block = self.expr_block_empty(span);
self.arm(pending_pat, empty_block)
self.arm(pending_pat, empty_block, span)
};

let inner_match_stmt = {
Expand Down Expand Up @@ -1027,7 +1027,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
});

// mut __awaitee => loop { ... }
let awaitee_arm = self.arm(awaitee_pat, loop_expr);
let awaitee_arm = self.arm(awaitee_pat, loop_expr, span);

// `match ::std::future::IntoFuture::into_future(<expr>) { ... }`
let into_future_expr = match await_kind {
Expand Down Expand Up @@ -1817,7 +1817,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let break_expr =
self.with_loop_scope(loop_hir_id, |this| this.expr_break_alloc(for_span));
let pat = self.pat_none(for_span);
self.arm(pat, break_expr)
self.arm(pat, break_expr, for_span)
};

// Some(<pat>) => <body>,
Expand All @@ -1826,7 +1826,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let body_block =
self.with_loop_scope(loop_hir_id, |this| this.lower_block(body, false));
let body_expr = self.arena.alloc(self.expr_block(body_block));
self.arm(some_pat, body_expr)
self.arm(some_pat, body_expr, for_span)
};

// `mut iter`
Expand Down Expand Up @@ -1885,7 +1885,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let loop_expr = self.arena.alloc(hir::Expr { hir_id: loop_hir_id, kind, span: for_span });

// `mut iter => { ... }`
let iter_arm = self.arm(iter_pat, loop_expr);
let iter_arm = self.arm(iter_pat, loop_expr, for_span);

let match_expr = match loop_kind {
ForLoopKind::For => {
Expand Down Expand Up @@ -1930,7 +1930,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
hir::LangItem::IntoAsyncIterIntoIter,
arena_vec![self; head],
);
let iter_arm = self.arm(async_iter_pat, inner_match_expr);
let iter_arm = self.arm(async_iter_pat, inner_match_expr, for_span);
self.arena.alloc(self.expr_match(
for_span,
iter,
Expand Down Expand Up @@ -1997,7 +1997,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let val_expr = self.expr_ident(span, val_ident, val_pat_nid);
self.lower_attrs(val_expr.hir_id, &attrs, span, Target::Expression);
let continue_pat = self.pat_cf_continue(unstable_span, val_pat);
self.arm(continue_pat, val_expr)
self.arm(continue_pat, val_expr, try_span)
};

// `ControlFlow::Break(residual) =>
Expand Down Expand Up @@ -2040,7 +2040,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
self.lower_attrs(ret_expr.hir_id, &attrs, span, Target::Expression);

let break_pat = self.pat_cf_break(try_span, residual_local);
self.arm(break_pat, ret_expr)
self.arm(break_pat, ret_expr, try_span)
};

hir::ExprKind::Match(
Expand Down Expand Up @@ -2368,12 +2368,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
&mut self,
pat: &'hir hir::Pat<'hir>,
expr: &'hir hir::Expr<'hir>,
span: Span,
) -> hir::Arm<'hir> {
hir::Arm {
hir_id: self.next_id(),
pat,
guard: None,
span: self.lower_span(expr.span),
span: self.lower_span(span),
body: expr,
}
}
Expand Down
39 changes: 39 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,3 +721,42 @@ impl<S: Stage> CombineAttributeParser<S> for RustcThenThisWouldNeedParser {
Some(ident)
}
}

pub(crate) struct RustcEffectiveVisibilityParser;

impl<S: Stage> NoArgsAttributeParser<S> for RustcEffectiveVisibilityParser {
const PATH: &'static [Symbol] = &[sym::rustc_effective_visibility];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
Allow(Target::Use),
Allow(Target::Static),
Allow(Target::Const),
Allow(Target::Fn),
Allow(Target::Closure),
Allow(Target::Mod),
Allow(Target::ForeignMod),
Allow(Target::TyAlias),
Allow(Target::Enum),
Allow(Target::Variant),
Allow(Target::Struct),
Allow(Target::Field),
Allow(Target::Union),
Allow(Target::Trait),
Allow(Target::TraitAlias),
Allow(Target::Impl { of_trait: false }),
Allow(Target::Impl { of_trait: true }),
Allow(Target::AssocConst),
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Method(MethodKind::Trait { body: false })),
Allow(Target::Method(MethodKind::Trait { body: true })),
Allow(Target::Method(MethodKind::TraitImpl)),
Allow(Target::AssocTy),
Allow(Target::ForeignFn),
Allow(Target::ForeignStatic),
Allow(Target::ForeignTy),
Allow(Target::MacroDef),
Allow(Target::PatField),
Allow(Target::Crate),
]);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcEffectiveVisibility;
}
50 changes: 50 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/test_attrs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use rustc_hir::attrs::RustcAbiAttrKind;
use rustc_session::lint::builtin::ILL_FORMED_ATTRIBUTE_INPUT;

use super::prelude::*;
Expand Down Expand Up @@ -140,3 +141,52 @@ impl<S: Stage> SingleAttributeParser<S> for ReexportTestHarnessMainParser {
Some(AttributeKind::ReexportTestHarnessMain(name))
}
}

pub(crate) struct RustcAbiParser;

impl<S: Stage> SingleAttributeParser<S> for RustcAbiParser {
const PATH: &[Symbol] = &[sym::rustc_abi];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
const TEMPLATE: AttributeTemplate = template!(OneOf: &[sym::debug, sym::assert_eq]);
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
Allow(Target::TyAlias),
Allow(Target::Fn),
Allow(Target::ForeignFn),
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Method(MethodKind::Trait { body: true })),
Allow(Target::Method(MethodKind::Trait { body: false })),
Allow(Target::Method(MethodKind::TraitImpl)),
]);

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option<AttributeKind> {
let Some(args) = args.list() else {
cx.expected_specific_argument_and_list(cx.attr_span, &[sym::assert_eq, sym::debug]);
return None;
};

let Some(arg) = args.single() else {
cx.expected_single_argument(cx.attr_span);
return None;
};

let fail_incorrect_argument =
|span| cx.expected_specific_argument(span, &[sym::assert_eq, sym::debug]);

let Some(arg) = arg.meta_item() else {
fail_incorrect_argument(args.span);
return None;
};

let kind: RustcAbiAttrKind = match arg.path().word_sym() {
Some(sym::assert_eq) => RustcAbiAttrKind::AssertEq,
Some(sym::debug) => RustcAbiAttrKind::Debug,
None | Some(_) => {
fail_incorrect_argument(arg.span());
return None;
}
};

Some(AttributeKind::RustcAbi { attr_span: cx.attr_span, kind })
}
}
2 changes: 2 additions & 0 deletions compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ attribute_parsers!(
Single<ProcMacroDeriveParser>,
Single<RecursionLimitParser>,
Single<ReexportTestHarnessMainParser>,
Single<RustcAbiParser>,
Single<RustcAllocatorZeroedVariantParser>,
Single<RustcBuiltinMacroParser>,
Single<RustcForceInlineParser>,
Expand Down Expand Up @@ -258,6 +259,7 @@ attribute_parsers!(
Single<WithoutArgs<RustcDumpPredicatesParser>>,
Single<WithoutArgs<RustcDumpUserArgsParser>>,
Single<WithoutArgs<RustcDumpVtableParser>>,
Single<WithoutArgs<RustcEffectiveVisibilityParser>>,
Single<WithoutArgs<RustcHasIncoherentInherentImplsParser>>,
Single<WithoutArgs<RustcHiddenTypeOfOpaquesParser>>,
Single<WithoutArgs<RustcLintOptTyParser>>,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_borrowck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ polonius-engine = "0.13.0"
rustc_abi = { path = "../rustc_abi" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
rustc_graphviz = { path = "../rustc_graphviz" }
rustc_hir = { path = "../rustc_hir" }
rustc_index = { path = "../rustc_index" }
Expand Down
Loading
Loading