Skip to content

Rollup of 9 pull requests #142381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6f958ac
Remove unneeded `check_id` calls as they are already called in `visit…
GuillaumeGomez Jun 10, 2025
296f9f2
remove ice group pings from `triagebot.toml`
cyrgani Jun 10, 2025
9dd7c01
add trace_cmd import in tracing feature in execution context
Shourya742 Jun 11, 2025
103d668
remove myself from the project
onur-ozkan Jun 11, 2025
052a7c5
add tracing flag in bootstrap check cmd in mingw-check-2 ci workflow
Shourya742 Jun 11, 2025
8c236ab
add comment over ci change
Shourya742 Jun 11, 2025
cd04717
Fix enter_trace_span!() using wrong $crate paths
Stypox Jun 11, 2025
d4d90ca
put flag check at the end of command chain in mingw-check-2
Shourya742 Jun 11, 2025
796ee4f
Do not warn on `rust.incremental` when using download CI rustc
Kobzol Jun 11, 2025
edc405d
Add expectation for `{` when parsing lone coroutine qualifiers
Veykril Jun 11, 2025
34241e5
document attribute parsers better
jdonszelmann Jun 11, 2025
ce04386
consistently rename (old) attribute groups
jdonszelmann Jun 11, 2025
87b068c
Fix missing newline trim in bootstrap
Kobzol Jun 11, 2025
b29c9a3
Rollup merge of #142305 - GuillaumeGomez:remove-visit_id-EarlyContext…
matthiaskrgr Jun 11, 2025
deea067
Rollup merge of #142314 - cyrgani:icebreaker, r=jieyouxu
matthiaskrgr Jun 11, 2025
13f9542
Rollup merge of #142343 - onur-ozkan:remove-myself-from-the-project, …
matthiaskrgr Jun 11, 2025
507c575
Rollup merge of #142346 - Shourya742:2025-06-11-add-tracing-import-to…
matthiaskrgr Jun 11, 2025
e2846d6
Rollup merge of #142356 - Stypox:fix-enter_trace_span, r=RalfJung
matthiaskrgr Jun 11, 2025
e78b619
Rollup merge of #142362 - Veykril:push-rzmrsswqourz, r=oli-obk
matthiaskrgr Jun 11, 2025
e80be0b
Rollup merge of #142364 - Kobzol:download-ci-incremental-warning-remo…
matthiaskrgr Jun 11, 2025
f417620
Rollup merge of #142369 - jdonszelmann:attr-docs, r=fmease
matthiaskrgr Jun 11, 2025
c97dca6
Rollup merge of #142374 - Kobzol:fix-newline, r=tmiasko
matthiaskrgr Jun 11, 2025
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
11 changes: 10 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! - [`CombineAttributeParser`]: makes it easy to implement an attribute which should combine the
//! contents of attributes, if an attribute appear multiple times in a list
//!
//! Attributes should be added to [`ATTRIBUTE_MAPPING`](crate::context::ATTRIBUTE_MAPPING) to be parsed.
//! Attributes should be added to [`ATTRIBUTE_PARSERS`](crate::context::ATTRIBUTE_PARSERS) to be parsed.
use std::marker::PhantomData;

Expand Down Expand Up @@ -51,6 +51,9 @@ type AcceptMapping<T> = &'static [(&'static [Symbol], AcceptFn<T>)];
/// whether it has seen the attribute it has been looking for.
///
/// The state machine is automatically reset to parse attributes on the next item.
///
/// For a simpler attribute parsing interface, consider using [`SingleAttributeParser`]
/// or [`CombineAttributeParser`] instead.
pub(crate) trait AttributeParser: Default + 'static {
/// The symbols for the attributes that this parser is interested in.
///
Expand All @@ -59,6 +62,12 @@ pub(crate) trait AttributeParser: Default + 'static {

/// The parser has gotten a chance to accept the attributes on an item,
/// here it can produce an attribute.
///
/// All finalize methods of all parsers are unconditionally called.
/// This means you can't unconditionally return `Some` here,
/// that'd be equivalent to unconditionally applying an attribute to
/// every single syntax item that could have attributes applied to it.
/// Your accept mappings should determine whether this returns something.
fn finalize(self, cx: &FinalizeContext<'_>) -> Option<AttributeKind>;
}

Expand Down
24 changes: 13 additions & 11 deletions compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::attributes::transparency::TransparencyParser;
use crate::attributes::{AttributeParser as _, Combine, Single};
use crate::parser::{ArgParser, MetaItemParser};

macro_rules! attribute_groups {
macro_rules! attribute_parsers {
(
pub(crate) static $name: ident = [$($names: ty),* $(,)?];
) => {
Expand Down Expand Up @@ -63,8 +63,8 @@ macro_rules! attribute_groups {
};
}

attribute_groups!(
pub(crate) static ATTRIBUTE_MAPPING = [
attribute_parsers!(
pub(crate) static ATTRIBUTE_PARSERS = [
// tidy-alphabetical-start
BodyStabilityParser,
ConfusablesParser,
Expand All @@ -90,7 +90,7 @@ attribute_groups!(
///
/// Gives [`AttributeParser`]s enough information to create errors, for example.
pub(crate) struct AcceptContext<'a> {
pub(crate) group_cx: &'a FinalizeContext<'a>,
pub(crate) finalize_cx: &'a FinalizeContext<'a>,
/// The span of the attribute currently being parsed
pub(crate) attr_span: Span,
}
Expand All @@ -109,7 +109,7 @@ impl<'a> Deref for AcceptContext<'a> {
type Target = FinalizeContext<'a>;

fn deref(&self) -> &Self::Target {
&self.group_cx
&self.finalize_cx
}
}

Expand Down Expand Up @@ -219,7 +219,7 @@ impl<'sess> AttributeParser<'sess> {
) -> Vec<Attribute> {
let mut attributes = Vec::new();

let group_cx = FinalizeContext { cx: self, target_span };
let finalize_cx = FinalizeContext { cx: self, target_span };

for attr in attrs {
// If we're only looking for a single attribute, skip all the ones we don't care about.
Expand Down Expand Up @@ -268,9 +268,11 @@ impl<'sess> AttributeParser<'sess> {
let args = parser.args();
let parts = path.segments().map(|i| i.name).collect::<Vec<_>>();

if let Some(accept) = ATTRIBUTE_MAPPING.0.get(parts.as_slice()) {
let cx =
AcceptContext { group_cx: &group_cx, attr_span: lower_span(attr.span) };
if let Some(accept) = ATTRIBUTE_PARSERS.0.get(parts.as_slice()) {
let cx = AcceptContext {
finalize_cx: &finalize_cx,
attr_span: lower_span(attr.span),
};

accept(&cx, &args)
} else {
Expand Down Expand Up @@ -302,8 +304,8 @@ impl<'sess> AttributeParser<'sess> {
}

let mut parsed_attributes = Vec::new();
for f in &ATTRIBUTE_MAPPING.1 {
if let Some(attr) = f(&group_cx) {
for f in &ATTRIBUTE_PARSERS.1 {
if let Some(attr) = f(&finalize_cx) {
parsed_attributes.push(Attribute::Parsed(attr));
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_const_eval/src/interpret/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ pub enum MaybeEnteredSpan {
macro_rules! enter_trace_span {
($machine:ident, $($tt:tt)*) => {
if $machine::TRACING_ENABLED {
$crate::interpret::tracing_utils::MaybeEnteredSpan::Some(tracing::info_span!($($tt)*).entered())
$crate::interpret::util::MaybeEnteredSpan::Some(tracing::info_span!($($tt)*).entered())
} else {
$crate::interpret::tracing_utils::MaybeEnteredSpan::None
$crate::interpret::util::MaybeEnteredSpan::None
}
}
}
2 changes: 0 additions & 2 deletions compiler/rustc_lint/src/early.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ impl<'ast, 'ecx, 'tcx, T: EarlyLintPass> ast_visit::Visitor<'ast>
// the AST struct that they wrap (e.g. an item)
self.with_lint_attrs(s.id, s.attrs(), |cx| {
lint_callback!(cx, check_stmt, s);
cx.check_id(s.id);
});
// The visitor for the AST struct wrapped
// by the statement (e.g. `Item`) will call
Expand All @@ -147,7 +146,6 @@ impl<'ast, 'ecx, 'tcx, T: EarlyLintPass> ast_visit::Visitor<'ast>

fn visit_fn(&mut self, fk: ast_visit::FnKind<'ast>, span: Span, id: ast::NodeId) {
lint_callback!(self, check_fn, fk, span, id);
self.check_id(id);
ast_visit::walk_fn(self, fk);
}

Expand Down
32 changes: 19 additions & 13 deletions compiler/rustc_parse/src/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1520,22 +1520,20 @@ impl<'a> Parser<'a> {
Ok(this.mk_expr(this.prev_token.span, ExprKind::Underscore))
} else if this.token_uninterpolated_span().at_least_rust_2018() {
// `Span::at_least_rust_2018()` is somewhat expensive; don't get it repeatedly.
let at_async = this.check_keyword(exp!(Async));
// check for `gen {}` and `gen move {}`
// or `async gen {}` and `async gen move {}`
// FIXME: (async) gen closures aren't yet parsed.
// FIXME(gen_blocks): Parse `gen async` and suggest swap
if this.token_uninterpolated_span().at_least_rust_2024()
// check for `gen {}` and `gen move {}`
// or `async gen {}` and `async gen move {}`
&& (this.is_gen_block(kw::Gen, 0)
|| (this.check_keyword(exp!(Async)) && this.is_gen_block(kw::Gen, 1)))
&& this.is_gen_block(kw::Gen, at_async as usize)
{
// FIXME: (async) gen closures aren't yet parsed.
this.parse_gen_block()
} else if this.check_keyword(exp!(Async)) {
// FIXME(gen_blocks): Parse `gen async` and suggest swap
if this.is_gen_block(kw::Async, 0) {
// Check for `async {` and `async move {`,
this.parse_gen_block()
} else {
this.parse_expr_closure()
}
// Check for `async {` and `async move {`,
} else if this.is_gen_block(kw::Async, 0) {
this.parse_gen_block()
} else if at_async {
this.parse_expr_closure()
} else if this.eat_keyword_noexpect(kw::Await) {
this.recover_incorrect_await_syntax(lo)
} else {
Expand Down Expand Up @@ -2407,6 +2405,14 @@ impl<'a> Parser<'a> {
None
};

if let ClosureBinder::NotPresent = binder
&& coroutine_kind.is_some()
{
// coroutine closures and generators can have the same qualifiers, so we might end up
// in here if there is a missing `|` but also no `{`. Adjust the expectations in that case.
self.expected_token_types.insert(TokenType::OpenBrace);
}

let capture_clause = self.parse_capture_clause()?;
let (fn_decl, fn_arg_span) = self.parse_fn_block_decl()?;
let decl_hi = self.prev_token.span;
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,8 @@ impl Config {
// If there is a tag named after the current branch, git will try to disambiguate by prepending `heads/` to the branch name.
// This syntax isn't accepted by `branch.{branch}`. Strip it.
let branch = current_branch.stdout();
let branch = branch.strip_prefix("heads/").unwrap_or(&branch);
let branch = branch.trim();
let branch = branch.strip_prefix("heads/").unwrap_or(branch);
git.arg("-c").arg(format!("branch.{branch}.remote=origin"));
}
git.args(["submodule", "update", "--init", "--recursive", "--depth=1"]);
Expand Down
3 changes: 1 addition & 2 deletions src/bootstrap/src/core/config/toml/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ pub fn check_incompatible_options_for_ci_rustc(
rpath,
channel,
description,
incremental,
default_linker,
std_features,

// Rest of the options can simply be ignored.
incremental: _,
debug: _,
codegen_units: _,
codegen_units_std: _,
Expand Down Expand Up @@ -389,7 +389,6 @@ pub fn check_incompatible_options_for_ci_rustc(

warn!(current_rust_config.channel, channel, "rust");
warn!(current_rust_config.description, description, "rust");
warn!(current_rust_config.incremental, incremental, "rust");

Ok(())
}
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/src/utils/execution_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use std::sync::{Arc, Mutex};

use crate::core::config::DryRun;
#[cfg(feature = "tracing")]
use crate::trace_cmd;
use crate::{BehaviorOnFailure, BootstrapCommand, CommandOutput, OutputMode, exit};

#[derive(Clone, Default)]
Expand Down
5 changes: 4 additions & 1 deletion src/ci/docker/host-x86_64/mingw-check-2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ ENV SCRIPT \
RUSTDOCFLAGS=\"--document-private-items --document-hidden-items\" python3 ../x.py doc --stage 1 library && \
mkdir -p /checkout/obj/staging/doc && \
cp -r build/x86_64-unknown-linux-gnu/doc /checkout/obj/staging && \
RUSTDOCFLAGS=\"--document-private-items --document-hidden-items\" python3 ../x.py doc --stage 1 library/test
RUSTDOCFLAGS=\"--document-private-items --document-hidden-items\" python3 ../x.py doc --stage 1 library/test && \
# The BOOTSTRAP_TRACING flag is added to verify whether the
# bootstrap process compiles successfully with this flag enabled.
BOOTSTRAP_TRACING=1 python3 ../x.py --help
8 changes: 4 additions & 4 deletions tests/ui/editions/edition-keywords-2018-2015-parsing.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ note: while trying to match `r#async`
LL | (r#async) => (1)
| ^^^^^^^

error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `|`, or `||`
error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `{`, `|`, or `||`
--> $DIR/auxiliary/edition-kw-macro-2015.rs:27:23
|
LL | ($i: ident) => ($i)
| ^ expected one of `move`, `use`, `|`, or `||`
| ^ expected one of `move`, `use`, `{`, `|`, or `||`
|
::: $DIR/edition-keywords-2018-2015-parsing.rs:22:8
|
LL | if passes_ident!(async) == 1 {} // FIXME: Edition hygiene bug, async here is 2018 and reserved
| -------------------- in this macro invocation

error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `|`, or `||`
error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `{`, `|`, or `||`
--> $DIR/edition-keywords-2018-2015-parsing.rs:24:24
|
LL | if passes_tt!(async) == 1 {}
| ^ expected one of `move`, `use`, `|`, or `||`
| ^ expected one of `move`, `use`, `{`, `|`, or `||`

error[E0308]: mismatched types
--> $DIR/edition-keywords-2018-2015-parsing.rs:29:33
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/editions/edition-keywords-2018-2018-parsing.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -44,34 +44,34 @@ note: while trying to match `r#async`
LL | (r#async) => (1)
| ^^^^^^^

error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `|`, or `||`
error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `{`, `|`, or `||`
--> $DIR/auxiliary/edition-kw-macro-2018.rs:27:23
|
LL | ($i: ident) => ($i)
| ^ expected one of `move`, `use`, `|`, or `||`
| ^ expected one of `move`, `use`, `{`, `|`, or `||`
|
::: $DIR/edition-keywords-2018-2018-parsing.rs:29:8
|
LL | if passes_ident!(async) == 1 {} // FIXME: Edition hygiene bug, async here is 2018 and reserved
| -------------------- in this macro invocation

error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `|`, or `||`
error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `{`, `|`, or `||`
--> $DIR/edition-keywords-2018-2018-parsing.rs:31:24
|
LL | if passes_tt!(async) == 1 {}
| ^ expected one of `move`, `use`, `|`, or `||`
| ^ expected one of `move`, `use`, `{`, `|`, or `||`

error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `|`, or `||`
error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `{`, `|`, or `||`
--> $DIR/edition-keywords-2018-2018-parsing.rs:14:23
|
LL | ($i: ident) => ($i)
| ^ expected one of `move`, `use`, `|`, or `||`
| ^ expected one of `move`, `use`, `{`, `|`, or `||`

error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `|`, or `||`
error: macro expansion ends with an incomplete expression: expected one of `move`, `use`, `{`, `|`, or `||`
--> $DIR/edition-keywords-2018-2018-parsing.rs:35:30
|
LL | if local_passes_tt!(async) == 1 {}
| ^ expected one of `move`, `use`, `|`, or `||`
| ^ expected one of `move`, `use`, `{`, `|`, or `||`

error[E0308]: mismatched types
--> $DIR/edition-keywords-2018-2018-parsing.rs:40:33
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/parser/block-no-opening-brace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ fn in_try() {
let x = 0;
}

// FIXME(#80931)
fn in_async() {
async
let x = 0; //~ ERROR expected one of `move`, `use`, `|`, or `||`, found keyword `let`
let x = 0;
//~^ ERROR expected one of `move`, `use`, `{`, `|`, or `||`, found keyword `let`
}

// FIXME(#78168)
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/parser/block-no-opening-brace.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ error: expected expression, found reserved keyword `try`
LL | try
| ^^^ expected expression

error: expected one of `move`, `use`, `|`, or `||`, found keyword `let`
--> $DIR/block-no-opening-brace.rs:33:9
error: expected one of `move`, `use`, `{`, `|`, or `||`, found keyword `let`
--> $DIR/block-no-opening-brace.rs:32:9
|
LL | async
| - expected one of `move`, `use`, `|`, or `||`
| - expected one of `move`, `use`, `{`, `|`, or `||`
LL | let x = 0;
| ^^^ unexpected token

Expand Down
4 changes: 2 additions & 2 deletions tests/ui/parser/misspelled-keywords/async-move.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: expected one of `move`, `use`, `|`, or `||`, found `Move`
error: expected one of `move`, `use`, `{`, `|`, or `||`, found `Move`
--> $DIR/async-move.rs:4:11
|
LL | async Move {}
| ^^^^ expected one of `move`, `use`, `|`, or `||`
| ^^^^ expected one of `move`, `use`, `{`, `|`, or `||`
|
help: write keyword `move` in lowercase
|
Expand Down
28 changes: 2 additions & 26 deletions triagebot.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,6 @@ remove_labels = ["S-waiting-on-author"]
# Those labels are added when PR author requests a review from an assignee
add_labels = ["S-waiting-on-review"]

[ping.icebreakers-llvm]
message = """\
Hey LLVM ICE-breakers! This bug has been identified as a good
"LLVM ICE-breaking candidate". In case it's useful, here are some
[instructions] for tackling these sorts of bugs. Maybe take a look?
Thanks! <3

[instructions]: https://rustc-dev-guide.rust-lang.org/notification-groups/llvm.html
"""
label = "ICEBreaker-LLVM"

[ping.icebreakers-cleanup-crew]
alias = ["cleanup", "cleanups", "cleanup-crew", "shrink", "reduce", "bisect"]
message = """\
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good
"Cleanup ICE-breaking candidate". In case it's useful, here are some
[instructions] for tackling these sorts of bugs. Maybe take a look?
Thanks! <3

[instructions]: https://rustc-dev-guide.rust-lang.org/notification-groups/cleanup-crew.html
"""
label = "ICEBreaker-Cleanup-Crew"

[ping.windows]
message = """\
Hey Windows Group! This bug has been identified as a good "Windows candidate".
Expand Down Expand Up @@ -1266,7 +1243,6 @@ libs = [
bootstrap = [
"@Mark-Simulacrum",
"@albertlarsan68",
"@onur-ozkan",
"@kobzol",
"@jieyouxu",
"@clubby789",
Expand Down Expand Up @@ -1459,8 +1435,8 @@ compiletest = [
"/src/tools/rustdoc-themes" = ["rustdoc"]
"/src/tools/tidy" = ["bootstrap"]
"/src/tools/x" = ["bootstrap"]
"/src/tools/rustdoc-gui-test" = ["bootstrap", "@onur-ozkan"]
"/src/tools/libcxx-version" = ["@onur-ozkan"]
"/src/tools/rustdoc-gui-test" = ["bootstrap"]
"/src/tools/libcxx-version" = ["bootstrap"]

# Enable review queue tracking
# Documentation at: https://forge.rust-lang.org/triagebot/review-queue-tracking.html
Expand Down
Loading