Skip to content

Commit 51cba78

Browse files
authored
Merge pull request #4449 from rust-lang/rustup-2025-07-07
Automatic Rustup
2 parents b2d8c81 + 0e043a8 commit 51cba78

File tree

356 files changed

+4270
-2701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+4270
-2701
lines changed

Cargo.lock

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,17 @@ dependencies = [
19471947
"unic-langid",
19481948
]
19491949

1950+
[[package]]
1951+
name = "io-uring"
1952+
version = "0.7.8"
1953+
source = "registry+https://github.com/rust-lang/crates.io-index"
1954+
checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013"
1955+
dependencies = [
1956+
"bitflags",
1957+
"cfg-if",
1958+
"libc",
1959+
]
1960+
19501961
[[package]]
19511962
name = "ipc-channel"
19521963
version = "0.19.0"
@@ -2058,9 +2069,9 @@ dependencies = [
20582069

20592070
[[package]]
20602071
name = "jsonpath-rust"
2061-
version = "1.0.2"
2072+
version = "1.0.3"
20622073
source = "registry+https://github.com/rust-lang/crates.io-index"
2063-
checksum = "5b37465feaf9d41f74df7da98c6c1c31ca8ea06d11b5bf7869c8f1ccc51a793f"
2074+
checksum = "7d057f8fd19e20c3f14d3663983397155739b6bc1148dc5cd4c4a1a5b3130eb0"
20642075
dependencies = [
20652076
"pest",
20662077
"pest_derive",
@@ -2117,19 +2128,19 @@ dependencies = [
21172128

21182129
[[package]]
21192130
name = "libffi"
2120-
version = "4.1.0"
2131+
version = "4.1.1"
21212132
source = "registry+https://github.com/rust-lang/crates.io-index"
2122-
checksum = "ebfd30a67b482a08116e753d0656cb626548cf4242543e5cc005be7639d99838"
2133+
checksum = "e7681c6fab541f799a829e44a445a0666cf8d8a6cfebf89419e6aed52c604e87"
21232134
dependencies = [
21242135
"libc",
21252136
"libffi-sys",
21262137
]
21272138

21282139
[[package]]
21292140
name = "libffi-sys"
2130-
version = "3.3.1"
2141+
version = "3.3.2"
21312142
source = "registry+https://github.com/rust-lang/crates.io-index"
2132-
checksum = "f003aa318c9f0ee69eb0ada7c78f5c9d2fedd2ceb274173b5c7ff475eee584a3"
2143+
checksum = "7b0d828d367b4450ed08e7d510dc46636cd660055f50d67ac943bfe788767c29"
21332144
dependencies = [
21342145
"cc",
21352146
]
@@ -5463,13 +5474,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
54635474

54645475
[[package]]
54655476
name = "tokio"
5466-
version = "1.45.1"
5477+
version = "1.46.1"
54675478
source = "registry+https://github.com/rust-lang/crates.io-index"
5468-
checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779"
5479+
checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
54695480
dependencies = [
54705481
"backtrace",
54715482
"bytes",
5483+
"io-uring",
5484+
"libc",
5485+
"mio",
54725486
"pin-project-lite",
5487+
"slab",
54735488
]
54745489

54755490
[[package]]
@@ -5995,9 +6010,9 @@ dependencies = [
59956010

59966011
[[package]]
59976012
name = "wasm-component-ld"
5998-
version = "0.5.14"
6013+
version = "0.5.15"
59996014
source = "registry+https://github.com/rust-lang/crates.io-index"
6000-
checksum = "b015ec93764aa5517bc8b839efa9941b90be8ce680b1134f8224644ba1e48e3f"
6015+
checksum = "6d95124e34fee1316222e03b9bbf41af186ecbae2c8b79f8debe6e21b3ff60c5"
60016016
dependencies = [
60026017
"anyhow",
60036018
"clap",

compiler/rustc_abi/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,7 @@ impl Size {
527527
/// not a multiple of 8.
528528
pub fn from_bits(bits: impl TryInto<u64>) -> Size {
529529
let bits = bits.try_into().ok().unwrap();
530-
// Avoid potential overflow from `bits + 7`.
531-
Size { raw: bits / 8 + ((bits % 8) + 7) / 8 }
530+
Size { raw: bits.div_ceil(8) }
532531
}
533532

534533
#[inline]

compiler/rustc_ast/src/visit.rs

Lines changed: 79 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,9 +1202,10 @@ macro_rules! common_visitor_and_walkers {
12021202
let TyPat { id, kind, span, tokens: _ } = tp;
12031203
try_visit!(visit_id(vis, id));
12041204
match kind {
1205-
TyPatKind::Range(start, end, _include_end) => {
1205+
TyPatKind::Range(start, end, Spanned { span, node: _include_end }) => {
12061206
visit_opt!(vis, visit_anon_const, start);
12071207
visit_opt!(vis, visit_anon_const, end);
1208+
try_visit!(visit_span(vis, span));
12081209
}
12091210
TyPatKind::Or(variants) => walk_list!(vis, visit_ty_pat, variants),
12101211
TyPatKind::Err(_) => {}
@@ -1523,16 +1524,26 @@ macro_rules! common_visitor_and_walkers {
15231524
}
15241525

15251526
pub fn walk_inline_asm<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, asm: &$($lt)? $($mut)? InlineAsm) -> V::Result {
1526-
// FIXME: Visit spans inside all this currently ignored stuff.
15271527
let InlineAsm {
15281528
asm_macro: _,
1529-
template: _,
1530-
template_strs: _,
1529+
template,
1530+
template_strs,
15311531
operands,
1532-
clobber_abis: _,
1532+
clobber_abis,
15331533
options: _,
1534-
line_spans: _,
1534+
line_spans,
15351535
} = asm;
1536+
for piece in template {
1537+
match piece {
1538+
InlineAsmTemplatePiece::String(_str) => {}
1539+
InlineAsmTemplatePiece::Placeholder { operand_idx: _, modifier: _, span } => {
1540+
try_visit!(visit_span(vis, span));
1541+
}
1542+
}
1543+
}
1544+
for (_s1, _s2, span) in template_strs {
1545+
try_visit!(visit_span(vis, span));
1546+
}
15361547
for (op, span) in operands {
15371548
match op {
15381549
InlineAsmOperand::In { expr, reg: _ }
@@ -1553,6 +1564,12 @@ macro_rules! common_visitor_and_walkers {
15531564
}
15541565
try_visit!(visit_span(vis, span));
15551566
}
1567+
for (_s1, span) in clobber_abis {
1568+
try_visit!(visit_span(vis, span))
1569+
}
1570+
for span in line_spans {
1571+
try_visit!(visit_span(vis, span))
1572+
}
15561573
V::Result::output()
15571574
}
15581575

@@ -1565,9 +1582,9 @@ macro_rules! common_visitor_and_walkers {
15651582
vis.visit_path(path)
15661583
}
15671584

1568-
// FIXME: visit the template exhaustively.
15691585
pub fn walk_format_args<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, fmt: &$($lt)? $($mut)? FormatArgs) -> V::Result {
1570-
let FormatArgs { span, template: _, arguments, uncooked_fmt_str: _, is_source_literal: _ } = fmt;
1586+
let FormatArgs { span, template, arguments, uncooked_fmt_str: _, is_source_literal: _ } = fmt;
1587+
15711588
let args = $(${ignore($mut)} arguments.all_args_mut())? $(${ignore($lt)} arguments.all_args())? ;
15721589
for FormatArgument { kind, expr } in args {
15731590
match kind {
@@ -1578,9 +1595,58 @@ macro_rules! common_visitor_and_walkers {
15781595
}
15791596
try_visit!(vis.visit_expr(expr));
15801597
}
1598+
for piece in template {
1599+
match piece {
1600+
FormatArgsPiece::Literal(_symbol) => {}
1601+
FormatArgsPiece::Placeholder(placeholder) => try_visit!(walk_format_placeholder(vis, placeholder)),
1602+
}
1603+
}
15811604
visit_span(vis, span)
15821605
}
15831606

1607+
fn walk_format_placeholder<$($lt,)? V: $Visitor$(<$lt>)?>(
1608+
vis: &mut V,
1609+
placeholder: &$($lt)? $($mut)? FormatPlaceholder,
1610+
) -> V::Result {
1611+
let FormatPlaceholder { argument, span, format_options, format_trait: _ } = placeholder;
1612+
if let Some(span) = span {
1613+
try_visit!(visit_span(vis, span));
1614+
}
1615+
let FormatArgPosition { span, index: _, kind: _ } = argument;
1616+
if let Some(span) = span {
1617+
try_visit!(visit_span(vis, span));
1618+
}
1619+
let FormatOptions {
1620+
width,
1621+
precision,
1622+
alignment: _,
1623+
fill: _,
1624+
sign: _,
1625+
alternate: _,
1626+
zero_pad: _,
1627+
debug_hex: _,
1628+
} = format_options;
1629+
match width {
1630+
None => {}
1631+
Some(FormatCount::Literal(_)) => {}
1632+
Some(FormatCount::Argument(FormatArgPosition { span, index: _, kind: _ })) => {
1633+
if let Some(span) = span {
1634+
try_visit!(visit_span(vis, span));
1635+
}
1636+
}
1637+
}
1638+
match precision {
1639+
None => {}
1640+
Some(FormatCount::Literal(_)) => {}
1641+
Some(FormatCount::Argument(FormatArgPosition { span, index: _, kind: _ })) => {
1642+
if let Some(span) = span {
1643+
try_visit!(visit_span(vis, span));
1644+
}
1645+
}
1646+
}
1647+
V::Result::output()
1648+
}
1649+
15841650
pub fn walk_expr<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, expression: &$($lt)? $($mut)? Expr) -> V::Result {
15851651
let Expr { id, kind, span, attrs, tokens: _ } = expression;
15861652
try_visit!(visit_id(vis, id));
@@ -1601,7 +1667,7 @@ macro_rules! common_visitor_and_walkers {
16011667
try_visit!(visit_expr_fields(vis, fields));
16021668
match rest {
16031669
StructRest::Base(expr) => try_visit!(vis.visit_expr(expr)),
1604-
StructRest::Rest(_span) => {}
1670+
StructRest::Rest(span) => try_visit!(visit_span(vis, span)),
16051671
StructRest::None => {}
16061672
}
16071673
}
@@ -1688,7 +1754,8 @@ macro_rules! common_visitor_and_walkers {
16881754
visit_opt!(vis, visit_label, opt_label);
16891755
try_visit!(vis.visit_block(block));
16901756
}
1691-
ExprKind::Gen(_capt, body, _kind, decl_span) => {
1757+
ExprKind::Gen(capture_clause, body, _kind, decl_span) => {
1758+
try_visit!(vis.visit_capture_by(capture_clause));
16921759
try_visit!(vis.visit_block(body));
16931760
try_visit!(visit_span(vis, decl_span));
16941761
}
@@ -1705,9 +1772,10 @@ macro_rules! common_visitor_and_walkers {
17051772
try_visit!(vis.visit_expr(rhs));
17061773
try_visit!(visit_span(vis, span));
17071774
}
1708-
ExprKind::AssignOp(_op, left_expression, right_expression) => {
1775+
ExprKind::AssignOp(Spanned { span, node: _ }, left_expression, right_expression) => {
17091776
try_visit!(vis.visit_expr(left_expression));
17101777
try_visit!(vis.visit_expr(right_expression));
1778+
try_visit!(visit_span(vis, span));
17111779
}
17121780
ExprKind::Field(subexpression, ident) => {
17131781
try_visit!(vis.visit_expr(subexpression));

compiler/rustc_attr_data_structures/src/attributes.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ pub enum ReprAttr {
6767
ReprSimd,
6868
ReprTransparent,
6969
ReprAlign(Align),
70-
// this one is just so we can emit a lint for it
71-
ReprEmpty,
7270
}
7371
pub use ReprAttr::*;
7472

@@ -250,6 +248,13 @@ pub enum AttributeKind {
250248
span: Span,
251249
},
252250

251+
/// Represents `#[ignore]`
252+
Ignore {
253+
span: Span,
254+
/// ignore can optionally have a reason: `#[ignore = "reason this is ignored"]`
255+
reason: Option<Symbol>,
256+
},
257+
253258
/// Represents `#[inline]` and `#[rustc_force_inline]`.
254259
Inline(InlineAttr, Span),
255260

@@ -297,7 +302,7 @@ pub enum AttributeKind {
297302
PubTransparent(Span),
298303

299304
/// Represents [`#[repr]`](https://doc.rust-lang.org/stable/reference/type-layout.html#representations).
300-
Repr(ThinVec<(ReprAttr, Span)>),
305+
Repr { reprs: ThinVec<(ReprAttr, Span)>, first_span: Span },
301306

302307
/// Represents `#[rustc_layout_scalar_valid_range_end]`.
303308
RustcLayoutScalarValidRangeEnd(Box<u128>, Span),

compiler/rustc_attr_data_structures/src/encode_cross_crate.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ impl AttributeKind {
2626
Deprecation { .. } => Yes,
2727
DocComment { .. } => Yes,
2828
ExportName { .. } => Yes,
29+
Ignore { .. } => No,
2930
Inline(..) => No,
3031
LinkName { .. } => Yes,
3132
LinkSection { .. } => No,
@@ -40,7 +41,7 @@ impl AttributeKind {
4041
Optimize(..) => No,
4142
PassByValue(..) => Yes,
4243
PubTransparent(..) => Yes,
43-
Repr(..) => No,
44+
Repr { .. } => No,
4445
RustcLayoutScalarValidRangeEnd(..) => Yes,
4546
RustcLayoutScalarValidRangeStart(..) => Yes,
4647
RustcObjectLifetimeDefault => No,

compiler/rustc_attr_data_structures/src/lints.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ pub struct AttributeLint<Id> {
1212
pub enum AttributeLintKind {
1313
UnusedDuplicate { this: Span, other: Span, warning: bool },
1414
IllFormedAttributeInput { suggestions: Vec<String> },
15+
EmptyAttribute { first_span: Span },
1516
}

compiler/rustc_attr_parsing/messages.ftl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ attr_parsing_deprecated_item_suggestion =
66
.help = add `#![feature(deprecated_suggestion)]` to the crate root
77
.note = see #94785 for more details
88
9+
attr_parsing_empty_attribute =
10+
unused attribute
11+
.suggestion = remove this attribute
12+
913
attr_parsing_empty_confusables =
1014
expected at least one confusable name
1115
attr_parsing_expected_one_cfg_pattern =

compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ impl<S: Stage> CombineAttributeParser<S> for TargetFeatureParser {
298298
cx.expected_list(cx.attr_span);
299299
return features;
300300
};
301+
if list.is_empty() {
302+
cx.warn_empty_attribute(cx.attr_span);
303+
return features;
304+
}
301305
for item in list.mixed() {
302306
let Some(name_value) = item.meta_item() else {
303307
cx.expected_name_value(item.span(), Some(sym::enable));

compiler/rustc_attr_parsing/src/attributes/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub(crate) mod repr;
4141
pub(crate) mod rustc_internal;
4242
pub(crate) mod semantics;
4343
pub(crate) mod stability;
44+
pub(crate) mod test_attrs;
4445
pub(crate) mod traits;
4546
pub(crate) mod transparency;
4647
pub(crate) mod util;

compiler/rustc_attr_parsing/src/attributes/repr.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ pub(crate) struct ReprParser;
2323
impl<S: Stage> CombineAttributeParser<S> for ReprParser {
2424
type Item = (ReprAttr, Span);
2525
const PATH: &[Symbol] = &[sym::repr];
26-
const CONVERT: ConvertFn<Self::Item> = |items, _| AttributeKind::Repr(items);
26+
const CONVERT: ConvertFn<Self::Item> =
27+
|items, first_span| AttributeKind::Repr { reprs: items, first_span };
2728
// FIXME(jdonszelmann): never used
2829
const TEMPLATE: AttributeTemplate =
2930
template!(List: "C | Rust | align(...) | packed(...) | <integer type> | transparent");
@@ -40,8 +41,8 @@ impl<S: Stage> CombineAttributeParser<S> for ReprParser {
4041
};
4142

4243
if list.is_empty() {
43-
// this is so validation can emit a lint
44-
reprs.push((ReprAttr::ReprEmpty, cx.attr_span));
44+
cx.warn_empty_attribute(cx.attr_span);
45+
return reprs;
4546
}
4647

4748
for param in list.mixed() {

0 commit comments

Comments
 (0)