Skip to content

Rollup of 6 pull requests #143507

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 70 commits into from
Jul 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
6e05d61
Synced rust-analyzer configs
YohDeadfall Jun 27, 2025
40ec147
Merge pull request #4415 from YohDeadfall/sync-ra-configs
RalfJung Jun 28, 2025
75e22d5
Preparing for merge from rustc
Jun 29, 2025
7b985d5
Merge from rustc
Jun 29, 2025
03a7b9f
Merge pull request #4420 from rust-lang/rustup-2025-06-29
RalfJung Jun 29, 2025
7be1bf7
make ./miri work on stable again
RalfJung Jun 29, 2025
d01e001
Merge pull request #4423 from RalfJung/miri-script-stable
RalfJung Jun 29, 2025
ea69081
also test on arm-64 linux hosts
RalfJung Jun 29, 2025
651d2f8
Merge pull request #4424 from RalfJung/aarch64-linux-ci
RalfJung Jun 29, 2025
d539e66
Preparing for merge from rustc
RalfJung Jun 29, 2025
9c22372
Merge from rustc
RalfJung Jun 29, 2025
33f1700
Merge pull request #4425 from RalfJung/rustup
RalfJung Jun 29, 2025
ab2443c
fix type mismatches in native-lib/scalar_arguments test
RalfJung Jun 29, 2025
6aaaff8
test on x86-32 and arm-32
RalfJung Jun 29, 2025
e788b3c
also test on s390x via qemu
RalfJung Jun 29, 2025
d559073
remove duplicate clippy check
RalfJung Jun 29, 2025
ec85b70
add a riscv64 test job
RalfJung Jun 29, 2025
d69b8e2
Add shims for `gettid`-esque functions
tgross35 Jun 13, 2025
d1ee0eb
Merge pull request #4422 from RalfJung/more-ci
RalfJung Jun 29, 2025
555553f
Merge pull request #4397 from tgross35/gettid-shims
RalfJung Jun 29, 2025
cd971c6
linux futex: fix for val > i32::MAX
RalfJung Jun 30, 2025
8bb5f8c
Merge pull request #4429 from RalfJung/futex-val-too-big
RalfJung Jun 30, 2025
0c3c9e4
Preparing for merge from rustc
Jul 1, 2025
e6371c9
Merge from rustc
Jul 1, 2025
8958967
fmt
Jul 1, 2025
c52d522
./miri toolchain: no need to run 'cargo metadata'
RalfJung Jul 1, 2025
83d519c
Merge pull request #4431 from rust-lang/rustup-2025-07-01
RalfJung Jul 1, 2025
828f594
re-balance CI jobs
RalfJung Jul 1, 2025
d72b15b
Merge pull request #4432 from RalfJung/no-metadata
RalfJung Jul 1, 2025
b9b8fd2
Merge pull request #4433 from RalfJung/ci-balance
RalfJung Jul 1, 2025
4606afb
Remove leaky synchronisation objects.
LorrensP-2158466 Jun 12, 2025
0ca0671
Merge pull request #4411 from LorrensP-2158466/remove-leaky-syncobj
RalfJung Jul 1, 2025
9d9f0e0
Preparing for merge from rustc
Jul 2, 2025
af5f4be
Merge from rustc
Jul 2, 2025
28900b0
Add tracing feature to enable tracing_chrome support
Stypox Jun 18, 2025
d2f2271
rename show_error -> fatal_error
RalfJung Jul 2, 2025
0234984
Merge pull request #4436 from rust-lang/rustup-2025-07-02
RalfJung Jul 2, 2025
0d43e2f
Merge pull request #4406 from Stypox/tracing
RalfJung Jul 2, 2025
510040f
skip env var memory for leak check
RalfJung Jul 2, 2025
5ce7a04
Merge pull request #4437 from RalfJung/env-cleanup
RalfJung Jul 2, 2025
8fc0fd5
use more clever approach for genmc conditional import
RalfJung Jul 2, 2025
143c05a
Merge pull request #4438 from RalfJung/genmc-conditional-import
RalfJung Jul 2, 2025
db617af
only set host-specific CC; improve and de-duplicate native libs testi…
RalfJung Jul 3, 2025
4be7583
Merge pull request #4439 from RalfJung/ci
RalfJung Jul 3, 2025
2cbbd6c
Preparing for merge from rustc
RalfJung Jul 3, 2025
484c64b
Merge from rustc
RalfJung Jul 3, 2025
3c3f1e4
Merge pull request #4440 from RalfJung/rustup
RalfJung Jul 3, 2025
7ea812f
nanosleep: fix argument name and add a missing argument read
RalfJung Jul 3, 2025
2119b7e
Merge pull request #4441 from RalfJung/nanosleep
RalfJung Jul 3, 2025
04522bb
Preparing for merge from rustc
Jul 4, 2025
f655289
Merge from rustc
Jul 4, 2025
0018401
Merge pull request #4442 from rust-lang/rustup-2025-07-04
oli-obk Jul 4, 2025
0d656e0
declare data race and weak memory support as non-experimental
RalfJung Jul 4, 2025
23b3be5
Merge pull request #4443 from RalfJung/concurrency-ub-detection
RalfJung Jul 4, 2025
1620117
Preparing for merge from rustc
RalfJung Jul 5, 2025
61f3705
Merge from rustc
RalfJung Jul 5, 2025
72043e3
fmt
RalfJung Jul 5, 2025
6e3e05b
Merge pull request #4445 from RalfJung/rustup
RalfJung Jul 5, 2025
a1f4172
update lockfile
RalfJung Jul 5, 2025
44d7238
remove armv5te-unknown-linux-gnueabi target maintainer
koalatux Jul 5, 2025
90762c2
Complete mut_visit.
cjgillot Jul 5, 2025
39ee1b2
Remove yields_in_scope from the scope tree.
cjgillot Jul 5, 2025
8eb9f70
Stop using Key trait randomly
compiler-errors Jul 5, 2025
2d8ffff
Port `#[ignore]` to the new attribute parsing infrastructure
JonathanBrouwer Jun 30, 2025
9a921a3
Rollup merge of #143238 - JonathanBrouwer:ignore_parser, r=jdonszelmann
matthiaskrgr Jul 5, 2025
0311159
Rollup merge of #143441 - compiler-errors:no-key, r=petrochenkov
matthiaskrgr Jul 5, 2025
7ad67e6
Rollup merge of #143478 - RalfJung:miri-sync, r=RalfJung
matthiaskrgr Jul 5, 2025
5aa7be4
Rollup merge of #143486 - husqvarnagroup:af/no-armv5te-target-maintai…
matthiaskrgr Jul 5, 2025
8a5d239
Rollup merge of #143489 - cjgillot:mut-visit-span, r=petrochenkov
matthiaskrgr Jul 5, 2025
c3c4fd7
Rollup merge of #143494 - cjgillot:no-yield-in-scope, r=compiler-errors
matthiaskrgr Jul 5, 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
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2394,6 +2394,7 @@ dependencies = [
"regex",
"rustc_version",
"serde",
"serde_json",
"smallvec",
"tempfile",
"tikv-jemalloc-sys",
Expand Down
90 changes: 79 additions & 11 deletions compiler/rustc_ast/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,9 +1202,10 @@ macro_rules! common_visitor_and_walkers {
let TyPat { id, kind, span, tokens: _ } = tp;
try_visit!(visit_id(vis, id));
match kind {
TyPatKind::Range(start, end, _include_end) => {
TyPatKind::Range(start, end, Spanned { span, node: _include_end }) => {
visit_opt!(vis, visit_anon_const, start);
visit_opt!(vis, visit_anon_const, end);
try_visit!(visit_span(vis, span));
}
TyPatKind::Or(variants) => walk_list!(vis, visit_ty_pat, variants),
TyPatKind::Err(_) => {}
Expand Down Expand Up @@ -1523,16 +1524,26 @@ macro_rules! common_visitor_and_walkers {
}

pub fn walk_inline_asm<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, asm: &$($lt)? $($mut)? InlineAsm) -> V::Result {
// FIXME: Visit spans inside all this currently ignored stuff.
let InlineAsm {
asm_macro: _,
template: _,
template_strs: _,
template,
template_strs,
operands,
clobber_abis: _,
clobber_abis,
options: _,
line_spans: _,
line_spans,
} = asm;
for piece in template {
match piece {
InlineAsmTemplatePiece::String(_str) => {}
InlineAsmTemplatePiece::Placeholder { operand_idx: _, modifier: _, span } => {
try_visit!(visit_span(vis, span));
}
}
}
for (_s1, _s2, span) in template_strs {
try_visit!(visit_span(vis, span));
}
for (op, span) in operands {
match op {
InlineAsmOperand::In { expr, reg: _ }
Expand All @@ -1553,6 +1564,12 @@ macro_rules! common_visitor_and_walkers {
}
try_visit!(visit_span(vis, span));
}
for (_s1, span) in clobber_abis {
try_visit!(visit_span(vis, span))
}
for span in line_spans {
try_visit!(visit_span(vis, span))
}
V::Result::output()
}

Expand All @@ -1565,9 +1582,9 @@ macro_rules! common_visitor_and_walkers {
vis.visit_path(path)
}

// FIXME: visit the template exhaustively.
pub fn walk_format_args<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, fmt: &$($lt)? $($mut)? FormatArgs) -> V::Result {
let FormatArgs { span, template: _, arguments, uncooked_fmt_str: _, is_source_literal: _ } = fmt;
let FormatArgs { span, template, arguments, uncooked_fmt_str: _, is_source_literal: _ } = fmt;

let args = $(${ignore($mut)} arguments.all_args_mut())? $(${ignore($lt)} arguments.all_args())? ;
for FormatArgument { kind, expr } in args {
match kind {
Expand All @@ -1578,9 +1595,58 @@ macro_rules! common_visitor_and_walkers {
}
try_visit!(vis.visit_expr(expr));
}
for piece in template {
match piece {
FormatArgsPiece::Literal(_symbol) => {}
FormatArgsPiece::Placeholder(placeholder) => try_visit!(walk_format_placeholder(vis, placeholder)),
}
}
visit_span(vis, span)
}

fn walk_format_placeholder<$($lt,)? V: $Visitor$(<$lt>)?>(
vis: &mut V,
placeholder: &$($lt)? $($mut)? FormatPlaceholder,
) -> V::Result {
let FormatPlaceholder { argument, span, format_options, format_trait: _ } = placeholder;
if let Some(span) = span {
try_visit!(visit_span(vis, span));
}
let FormatArgPosition { span, index: _, kind: _ } = argument;
if let Some(span) = span {
try_visit!(visit_span(vis, span));
}
let FormatOptions {
width,
precision,
alignment: _,
fill: _,
sign: _,
alternate: _,
zero_pad: _,
debug_hex: _,
} = format_options;
match width {
None => {}
Some(FormatCount::Literal(_)) => {}
Some(FormatCount::Argument(FormatArgPosition { span, index: _, kind: _ })) => {
if let Some(span) = span {
try_visit!(visit_span(vis, span));
}
}
}
match precision {
None => {}
Some(FormatCount::Literal(_)) => {}
Some(FormatCount::Argument(FormatArgPosition { span, index: _, kind: _ })) => {
if let Some(span) = span {
try_visit!(visit_span(vis, span));
}
}
}
V::Result::output()
}

pub fn walk_expr<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, expression: &$($lt)? $($mut)? Expr) -> V::Result {
let Expr { id, kind, span, attrs, tokens: _ } = expression;
try_visit!(visit_id(vis, id));
Expand All @@ -1601,7 +1667,7 @@ macro_rules! common_visitor_and_walkers {
try_visit!(visit_expr_fields(vis, fields));
match rest {
StructRest::Base(expr) => try_visit!(vis.visit_expr(expr)),
StructRest::Rest(_span) => {}
StructRest::Rest(span) => try_visit!(visit_span(vis, span)),
StructRest::None => {}
}
}
Expand Down Expand Up @@ -1688,7 +1754,8 @@ macro_rules! common_visitor_and_walkers {
visit_opt!(vis, visit_label, opt_label);
try_visit!(vis.visit_block(block));
}
ExprKind::Gen(_capt, body, _kind, decl_span) => {
ExprKind::Gen(capture_clause, body, _kind, decl_span) => {
try_visit!(vis.visit_capture_by(capture_clause));
try_visit!(vis.visit_block(body));
try_visit!(visit_span(vis, decl_span));
}
Expand All @@ -1705,9 +1772,10 @@ macro_rules! common_visitor_and_walkers {
try_visit!(vis.visit_expr(rhs));
try_visit!(visit_span(vis, span));
}
ExprKind::AssignOp(_op, left_expression, right_expression) => {
ExprKind::AssignOp(Spanned { span, node: _ }, left_expression, right_expression) => {
try_visit!(vis.visit_expr(left_expression));
try_visit!(vis.visit_expr(right_expression));
try_visit!(visit_span(vis, span));
}
ExprKind::Field(subexpression, ident) => {
try_visit!(vis.visit_expr(subexpression));
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_attr_data_structures/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ pub enum AttributeKind {
span: Span,
},

/// Represents `#[ignore]`
Ignore {
span: Span,
/// ignore can optionally have a reason: `#[ignore = "reason this is ignored"]`
reason: Option<Symbol>,
},

/// Represents `#[inline]` and `#[rustc_force_inline]`.
Inline(InlineAttr, Span),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ impl AttributeKind {
Deprecation { .. } => Yes,
DocComment { .. } => Yes,
ExportName { .. } => Yes,
Ignore { .. } => No,
Inline(..) => No,
LinkName { .. } => Yes,
LinkSection { .. } => No,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_attr_parsing/src/attributes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub(crate) mod repr;
pub(crate) mod rustc_internal;
pub(crate) mod semantics;
pub(crate) mod stability;
pub(crate) mod test_attrs;
pub(crate) mod traits;
pub(crate) mod transparency;
pub(crate) mod util;
Expand Down
46 changes: 46 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/test_attrs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
use rustc_attr_data_structures::AttributeKind;
use rustc_attr_data_structures::lints::AttributeLintKind;
use rustc_feature::{AttributeTemplate, template};
use rustc_span::{Symbol, sym};

use crate::attributes::{AttributeOrder, OnDuplicate, SingleAttributeParser};
use crate::context::{AcceptContext, Stage};
use crate::parser::ArgParser;

pub(crate) struct IgnoreParser;

impl<S: Stage> SingleAttributeParser<S> for IgnoreParser {
const PATH: &[Symbol] = &[sym::ignore];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepLast;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
const TEMPLATE: AttributeTemplate = template!(Word, NameValueStr: "reason");

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
Some(AttributeKind::Ignore {
span: cx.attr_span,
reason: match args {
ArgParser::NoArgs => None,
ArgParser::NameValue(name_value) => {
let Some(str_value) = name_value.value_as_str() else {
let suggestions = <Self as SingleAttributeParser<S>>::TEMPLATE
.suggestions(false, "ignore");
let span = cx.attr_span;
cx.emit_lint(
AttributeLintKind::IllFormedAttributeInput { suggestions },
span,
);
return None;
};
Some(str_value)
}
ArgParser::List(_) => {
let suggestions =
<Self as SingleAttributeParser<S>>::TEMPLATE.suggestions(false, "ignore");
let span = cx.attr_span;
cx.emit_lint(AttributeLintKind::IllFormedAttributeInput { suggestions }, span);
return None;
}
},
})
}
}
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 @@ -37,6 +37,7 @@ use crate::attributes::semantics::MayDangleParser;
use crate::attributes::stability::{
BodyStabilityParser, ConstStabilityIndirectParser, ConstStabilityParser, StabilityParser,
};
use crate::attributes::test_attrs::IgnoreParser;
use crate::attributes::traits::SkipDuringMethodDispatchParser;
use crate::attributes::transparency::TransparencyParser;
use crate::attributes::{AttributeParser as _, Combine, Single, WithoutArgs};
Expand Down Expand Up @@ -126,6 +127,7 @@ attribute_parsers!(
// tidy-alphabetical-start
Single<DeprecationParser>,
Single<ExportNameParser>,
Single<IgnoreParser>,
Single<InlineParser>,
Single<LinkNameParser>,
Single<LinkSectionParser>,
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_const_eval/src/const_eval/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Not in interpret to make sure we do not use private implementation details

use rustc_abi::{FieldIdx, VariantIdx};
use rustc_middle::query::Key;
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_middle::{bug, mir};
use rustc_span::DUMMY_SP;
use tracing::instrument;

use crate::interpret::InterpCx;
Expand Down Expand Up @@ -71,8 +71,7 @@ pub fn tag_for_variant_provider<'tcx>(
let (ty, variant_index) = key.value;
assert!(ty.is_enum());

let ecx =
InterpCx::new(tcx, ty.default_span(tcx), key.typing_env, crate::const_eval::DummyMachine);
let ecx = InterpCx::new(tcx, DUMMY_SP, key.typing_env, crate::const_eval::DummyMachine);

let layout = ecx.layout_of(ty).unwrap();
ecx.tag_for_variant(layout, variant_index).unwrap().map(|(tag, _tag_field)| tag)
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,7 @@ impl AttributeExt for Attribute {
Attribute::Parsed(AttributeKind::Deprecation { span, .. }) => *span,
Attribute::Parsed(AttributeKind::DocComment { span, .. }) => *span,
Attribute::Parsed(AttributeKind::MayDangle(span)) => *span,
Attribute::Parsed(AttributeKind::Ignore { span, .. }) => *span,
a => panic!("can't get the span of an arbitrary parsed attribute: {a:?}"),
}
}
Expand Down
Loading