Skip to content

Commit aa58379

Browse files
author
The Miri Cronjob Bot
committed
Merge ref '269d5b56bcfd' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 269d5b5 Filtered ref: a221b1d3ebb78ec8a01dcb1fe6bb165378e2f5c9 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents a10bdf9 + b8160e9 commit aa58379

File tree

310 files changed

+5537
-2780
lines changed

Some content is hidden

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

310 files changed

+5537
-2780
lines changed

Cargo.lock

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ dependencies = [
266266

267267
[[package]]
268268
name = "bitflags"
269-
version = "2.9.2"
269+
version = "2.9.3"
270270
source = "registry+https://github.com/rust-lang/crates.io-index"
271-
checksum = "6a65b545ab31d687cff52899d4890855fec459eb6afe0da6417b8a18da87aa29"
271+
checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d"
272272

273273
[[package]]
274274
name = "blake3"
@@ -5988,9 +5988,9 @@ dependencies = [
59885988

59895989
[[package]]
59905990
name = "wasi-preview1-component-adapter-provider"
5991-
version = "34.0.2"
5991+
version = "36.0.1"
59925992
source = "registry+https://github.com/rust-lang/crates.io-index"
5993-
checksum = "33696c5f1ff1e083de9f36c3da471abd736362bc173e093f8b0b1ed5a387e39b"
5993+
checksum = "20689c88791776219f78c2529700d15e6a9bd57a27858c62e9ef8487956b571c"
59945994

59955995
[[package]]
59965996
name = "wasm-bindgen"
@@ -6052,17 +6052,17 @@ dependencies = [
60526052

60536053
[[package]]
60546054
name = "wasm-component-ld"
6055-
version = "0.5.15"
6055+
version = "0.5.16"
60566056
source = "registry+https://github.com/rust-lang/crates.io-index"
6057-
checksum = "6d95124e34fee1316222e03b9bbf41af186ecbae2c8b79f8debe6e21b3ff60c5"
6057+
checksum = "14cd35d6cae91109a0ffd207b573cf3c741cab7e921dd376ea7aaf2c52a3408c"
60586058
dependencies = [
60596059
"anyhow",
60606060
"clap",
60616061
"lexopt",
60626062
"libc",
60636063
"tempfile",
60646064
"wasi-preview1-component-adapter-provider",
6065-
"wasmparser 0.234.0",
6065+
"wasmparser 0.237.0",
60666066
"wat",
60676067
"windows-sys 0.59.0",
60686068
"winsplit",
@@ -6089,34 +6089,24 @@ dependencies = [
60896089

60906090
[[package]]
60916091
name = "wasm-encoder"
6092-
version = "0.234.0"
6093-
source = "registry+https://github.com/rust-lang/crates.io-index"
6094-
checksum = "170a0157eef517a179f2d20ed7c68df9c3f7f6c1c047782d488bf5a464174684"
6095-
dependencies = [
6096-
"leb128fmt",
6097-
"wasmparser 0.234.0",
6098-
]
6099-
6100-
[[package]]
6101-
name = "wasm-encoder"
6102-
version = "0.236.1"
6092+
version = "0.237.0"
61036093
source = "registry+https://github.com/rust-lang/crates.io-index"
6104-
checksum = "724fccfd4f3c24b7e589d333fc0429c68042897a7e8a5f8694f31792471841e7"
6094+
checksum = "efe92d1321afa53ffc88a57c497bb7330c3cf84c98ffdba4a4caf6a0684fad3c"
61056095
dependencies = [
61066096
"leb128fmt",
6107-
"wasmparser 0.236.1",
6097+
"wasmparser 0.237.0",
61086098
]
61096099

61106100
[[package]]
61116101
name = "wasm-metadata"
6112-
version = "0.234.0"
6102+
version = "0.237.0"
61136103
source = "registry+https://github.com/rust-lang/crates.io-index"
6114-
checksum = "a42fe3f5cbfb56fc65311ef827930d06189160038e81db62188f66b4bf468e3a"
6104+
checksum = "4cc0b0a0c4f35ca6efa7a797671372915d4e9659dba2d59edc6fafc931d19997"
61156105
dependencies = [
61166106
"anyhow",
61176107
"indexmap",
6118-
"wasm-encoder 0.234.0",
6119-
"wasmparser 0.234.0",
6108+
"wasm-encoder 0.237.0",
6109+
"wasmparser 0.237.0",
61206110
]
61216111

61226112
[[package]]
@@ -6131,46 +6121,45 @@ dependencies = [
61316121

61326122
[[package]]
61336123
name = "wasmparser"
6134-
version = "0.234.0"
6124+
version = "0.236.1"
61356125
source = "registry+https://github.com/rust-lang/crates.io-index"
6136-
checksum = "be22e5a8f600afce671dd53c8d2dd26b4b7aa810fd18ae27dfc49737f3e02fc5"
6126+
checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7"
61376127
dependencies = [
61386128
"bitflags",
6139-
"hashbrown",
61406129
"indexmap",
6141-
"semver",
6142-
"serde",
61436130
]
61446131

61456132
[[package]]
61466133
name = "wasmparser"
6147-
version = "0.236.1"
6134+
version = "0.237.0"
61486135
source = "registry+https://github.com/rust-lang/crates.io-index"
6149-
checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7"
6136+
checksum = "7d2a40ca0d2bdf4b0bf36c13a737d0b2c58e4c8aaefe1c57f336dd75369ca250"
61506137
dependencies = [
61516138
"bitflags",
6139+
"hashbrown",
61526140
"indexmap",
61536141
"semver",
6142+
"serde",
61546143
]
61556144

61566145
[[package]]
61576146
name = "wast"
6158-
version = "236.0.1"
6147+
version = "237.0.0"
61596148
source = "registry+https://github.com/rust-lang/crates.io-index"
6160-
checksum = "d3bec4b4db9c6808d394632fd4b0cd4654c32c540bd3237f55ee6a40fff6e51f"
6149+
checksum = "fcf66f545acbd55082485cb9a6daab54579cb8628a027162253e8e9f5963c767"
61616150
dependencies = [
61626151
"bumpalo",
61636152
"leb128fmt",
61646153
"memchr",
61656154
"unicode-width 0.2.1",
6166-
"wasm-encoder 0.236.1",
6155+
"wasm-encoder 0.237.0",
61676156
]
61686157

61696158
[[package]]
61706159
name = "wat"
6171-
version = "1.236.1"
6160+
version = "1.237.0"
61726161
source = "registry+https://github.com/rust-lang/crates.io-index"
6173-
checksum = "64475e2f77d6071ce90624098fc236285ddafa8c3ea1fb386f2c4154b6c2bbdb"
6162+
checksum = "27975186f549e4b8d6878b627be732863883c72f7bf4dcf8f96e5f8242f73da9"
61746163
dependencies = [
61756164
"wast",
61766165
]
@@ -6659,9 +6648,9 @@ dependencies = [
66596648

66606649
[[package]]
66616650
name = "wit-component"
6662-
version = "0.234.0"
6651+
version = "0.237.0"
66636652
source = "registry+https://github.com/rust-lang/crates.io-index"
6664-
checksum = "5a8888169acf4c6c4db535beb405b570eedac13215d6821ca9bd03190f7f8b8c"
6653+
checksum = "bfb7674f76c10e82fe00b256a9d4ffb2b8d037d42ab8e9a83ebb3be35c9d0bf6"
66656654
dependencies = [
66666655
"anyhow",
66676656
"bitflags",
@@ -6670,17 +6659,17 @@ dependencies = [
66706659
"serde",
66716660
"serde_derive",
66726661
"serde_json",
6673-
"wasm-encoder 0.234.0",
6662+
"wasm-encoder 0.237.0",
66746663
"wasm-metadata",
6675-
"wasmparser 0.234.0",
6664+
"wasmparser 0.237.0",
66766665
"wit-parser",
66776666
]
66786667

66796668
[[package]]
66806669
name = "wit-parser"
6681-
version = "0.234.0"
6670+
version = "0.237.0"
66826671
source = "registry+https://github.com/rust-lang/crates.io-index"
6683-
checksum = "465492df47d8dcc015a3b7f241aed8ea03688fee7c5e04162285c5b1a3539c8b"
6672+
checksum = "ce2596a5bc7c24cc965b56ad6ff9e32394c4e401764f89620a888519c6e849ab"
66846673
dependencies = [
66856674
"anyhow",
66866675
"id-arena",
@@ -6691,7 +6680,7 @@ dependencies = [
66916680
"serde_derive",
66926681
"serde_json",
66936682
"unicode-xid",
6694-
"wasmparser 0.234.0",
6683+
"wasmparser 0.237.0",
66956684
]
66966685

66976686
[[package]]

bootstrap.example.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,11 @@
407407
#build.profiler = false
408408

409409
# Use the optimized LLVM C intrinsics for `compiler_builtins`, rather than Rust intrinsics.
410-
# Requires the LLVM submodule to be managed by bootstrap (i.e. not external) so that `compiler-rt`
411-
# sources are available.
410+
# Choosing true requires the LLVM submodule to be managed by bootstrap (i.e. not external)
411+
# so that `compiler-rt` sources are available.
412+
#
413+
# Setting this to a path removes the requirement for a C toolchain, but requires setting the
414+
# path to an existing library containing the builtins library from LLVM's compiler-rt.
412415
#
413416
# Setting this to `false` generates slower code, but removes the requirement for a C toolchain in
414417
# order to run `x check`.
@@ -1041,13 +1044,15 @@
10411044
#runner = <none> (string)
10421045

10431046
# Use the optimized LLVM C intrinsics for `compiler_builtins`, rather than Rust intrinsics
1044-
# on this target.
1045-
# Requires the LLVM submodule to be managed by bootstrap (i.e. not external) so that `compiler-rt`
1046-
# sources are available.
1047+
# on this target. Choosing true requires the LLVM submodule to be managed by bootstrap
1048+
# (i.e. not external) so that `compiler-rt` sources are available.
1049+
#
1050+
# Setting this to a path removes the requirement for a C toolchain, but requires setting the
1051+
# path to an existing library containing the builtins library from LLVM's compiler-rt.
10471052
#
10481053
# Setting this to `false` generates slower code, but removes the requirement for a C toolchain in
10491054
# order to run `x check`.
1050-
#optimized-compiler-builtins = build.optimized-compiler-builtins (bool)
1055+
#optimized-compiler-builtins = build.optimized-compiler-builtins (bool or path)
10511056

10521057
# Link the compiler and LLVM against `jemalloc` instead of the default libc allocator.
10531058
# This overrides the global `rust.jemalloc` option. See that option for more info.

compiler/rustc_attr_parsing/messages.ftl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ attr_parsing_invalid_repr_hint_no_value =
8686
attr_parsing_invalid_since =
8787
'since' must be a Rust version number, such as "1.31.0"
8888
89+
attr_parsing_invalid_style = {$is_used_as_inner ->
90+
[false] crate-level attribute should be an inner attribute: add an exclamation mark: `#![{$name}]`
91+
*[other] the `#![{$name}]` attribute can only be used at the crate root
92+
}
93+
.note = This attribute does not have an `!`, which means it is applied to this {$target}
94+
8995
attr_parsing_link_ordinal_out_of_range = ordinal value in `link_ordinal` is too large: `{$ordinal}`
9096
.note = the value may not exceed `u16::MAX`
9197

compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ impl<S: Stage> SingleAttributeParser<S> for ExportNameParser {
127127
Warn(Target::Field),
128128
Warn(Target::Arm),
129129
Warn(Target::MacroDef),
130+
Warn(Target::MacroCall),
130131
]);
131132
const TEMPLATE: AttributeTemplate = template!(NameValueStr: "name");
132133

@@ -174,6 +175,7 @@ impl<S: Stage> AttributeParser<S> for NakedParser {
174175
Allow(Target::Method(MethodKind::Inherent)),
175176
Allow(Target::Method(MethodKind::Trait { body: true })),
176177
Allow(Target::Method(MethodKind::TraitImpl)),
178+
Warn(Target::MacroCall),
177179
]);
178180

179181
fn finalize(self, cx: &FinalizeContext<'_, '_, S>) -> Option<AttributeKind> {
@@ -278,6 +280,7 @@ impl<S: Stage> NoArgsAttributeParser<S> for TrackCallerParser {
278280
Warn(Target::MacroDef),
279281
Warn(Target::Arm),
280282
Warn(Target::Field),
283+
Warn(Target::MacroCall),
281284
]);
282285
const CREATE: fn(Span) -> AttributeKind = AttributeKind::TrackCaller;
283286
}
@@ -365,7 +368,8 @@ impl<S: Stage> AttributeParser<S> for UsedParser {
365368
}
366369
},
367370
)];
368-
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Static)]);
371+
const ALLOWED_TARGETS: AllowedTargets =
372+
AllowedTargets::AllowList(&[Allow(Target::Static), Warn(Target::MacroCall)]);
369373

370374
fn finalize(self, _cx: &FinalizeContext<'_, '_, S>) -> Option<AttributeKind> {
371375
// Ratcheting behaviour, if both `linker` and `compiler` are specified, use `linker`
@@ -450,6 +454,7 @@ impl<S: Stage> CombineAttributeParser<S> for TargetFeatureParser {
450454
Warn(Target::Field),
451455
Warn(Target::Arm),
452456
Warn(Target::MacroDef),
457+
Warn(Target::MacroCall),
453458
]);
454459
}
455460

compiler/rustc_attr_parsing/src/attributes/crate_level.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use rustc_feature::AttributeType;
2+
13
use super::prelude::*;
24

35
pub(crate) struct CrateNameParser;
@@ -7,6 +9,7 @@ impl<S: Stage> SingleAttributeParser<S> for CrateNameParser {
79
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
810
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
911
const TEMPLATE: AttributeTemplate = template!(NameValueStr: "name");
12+
const TYPE: AttributeType = AttributeType::CrateLevel;
1013

1114
// FIXME: crate name is allowed on all targets and ignored,
1215
// even though it should only be valid on crates of course

compiler/rustc_attr_parsing/src/attributes/inline.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ impl<S: Stage> SingleAttributeParser<S> for InlineParser {
2525
Warn(Target::MacroDef),
2626
Warn(Target::Arm),
2727
Warn(Target::AssocConst),
28+
Warn(Target::MacroCall),
2829
]);
2930
const TEMPLATE: AttributeTemplate = template!(
3031
Word,

compiler/rustc_attr_parsing/src/attributes/link_attrs.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ impl<S: Stage> SingleAttributeParser<S> for LinkOrdinalParser {
110110
const PATH: &[Symbol] = &[sym::link_ordinal];
111111
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
112112
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
113-
const ALLOWED_TARGETS: AllowedTargets =
114-
AllowedTargets::AllowList(&[Allow(Target::ForeignFn), Allow(Target::ForeignStatic)]);
113+
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
114+
Allow(Target::ForeignFn),
115+
Allow(Target::ForeignStatic),
116+
Warn(Target::MacroCall),
117+
]);
115118
const TEMPLATE: AttributeTemplate = template!(
116119
List: &["ordinal"],
117120
"https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute"

compiler/rustc_attr_parsing/src/attributes/mod.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@
1212
//! - [`CombineAttributeParser`](crate::attributes::CombineAttributeParser): makes it easy to implement an attribute which should combine the
1313
//! contents of attributes, if an attribute appear multiple times in a list
1414
//!
15+
//! By default, attributes are allowed anywhere. When adding an attribute that should only be used
16+
//! at the crate root, consider setting the `TYPE` in the parser trait to
17+
//! [`AttributeType::CrateLevel`](rustc_feature::AttributeType::CrateLevel).
18+
//!
1519
//! Attributes should be added to `crate::context::ATTRIBUTE_PARSERS` to be parsed.
1620
1721
use std::marker::PhantomData;
1822

19-
use rustc_feature::{AttributeTemplate, template};
23+
use rustc_feature::{AttributeTemplate, AttributeType, template};
2024
use rustc_hir::attrs::AttributeKind;
2125
use rustc_span::{Span, Symbol};
2226
use thin_vec::ThinVec;
@@ -88,6 +92,8 @@ pub(crate) trait AttributeParser<S: Stage>: Default + 'static {
8892

8993
const ALLOWED_TARGETS: AllowedTargets;
9094

95+
const TYPE: AttributeType = AttributeType::Normal;
96+
9197
/// The parser has gotten a chance to accept the attributes on an item,
9298
/// here it can produce an attribute.
9399
///
@@ -129,6 +135,8 @@ pub(crate) trait SingleAttributeParser<S: Stage>: 'static {
129135
/// The template this attribute parser should implement. Used for diagnostics.
130136
const TEMPLATE: AttributeTemplate;
131137

138+
const TYPE: AttributeType = AttributeType::Normal;
139+
132140
/// Converts a single syntactical attribute to a single semantic attribute, or [`AttributeKind`]
133141
fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind>;
134142
}
@@ -175,6 +183,8 @@ impl<T: SingleAttributeParser<S>, S: Stage> AttributeParser<S> for Single<T, S>
175183
)];
176184
const ALLOWED_TARGETS: AllowedTargets = T::ALLOWED_TARGETS;
177185

186+
const TYPE: AttributeType = T::TYPE;
187+
178188
fn finalize(self, _cx: &FinalizeContext<'_, '_, S>) -> Option<AttributeKind> {
179189
Some(self.1?.0)
180190
}
@@ -259,6 +269,7 @@ pub(crate) trait NoArgsAttributeParser<S: Stage>: 'static {
259269
const PATH: &[Symbol];
260270
const ON_DUPLICATE: OnDuplicate<S>;
261271
const ALLOWED_TARGETS: AllowedTargets;
272+
const TYPE: AttributeType = AttributeType::Normal;
262273

263274
/// Create the [`AttributeKind`] given attribute's [`Span`].
264275
const CREATE: fn(Span) -> AttributeKind;
@@ -278,6 +289,7 @@ impl<T: NoArgsAttributeParser<S>, S: Stage> SingleAttributeParser<S> for Without
278289
const ON_DUPLICATE: OnDuplicate<S> = T::ON_DUPLICATE;
279290
const ALLOWED_TARGETS: AllowedTargets = T::ALLOWED_TARGETS;
280291
const TEMPLATE: AttributeTemplate = template!(Word);
292+
const TYPE: AttributeType = T::TYPE;
281293

282294
fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
283295
if let Err(span) = args.no_args() {
@@ -311,6 +323,8 @@ pub(crate) trait CombineAttributeParser<S: Stage>: 'static {
311323
/// The template this attribute parser should implement. Used for diagnostics.
312324
const TEMPLATE: AttributeTemplate;
313325

326+
const TYPE: AttributeType = AttributeType::Normal;
327+
314328
/// Converts a single syntactical attribute to a number of elements of the semantic attribute, or [`AttributeKind`]
315329
fn extend<'c>(
316330
cx: &'c mut AcceptContext<'_, '_, S>,
@@ -346,6 +360,7 @@ impl<T: CombineAttributeParser<S>, S: Stage> AttributeParser<S> for Combine<T, S
346360
group.items.extend(T::extend(cx, args))
347361
})];
348362
const ALLOWED_TARGETS: AllowedTargets = T::ALLOWED_TARGETS;
363+
const TYPE: AttributeType = T::TYPE;
349364

350365
fn finalize(self, _cx: &FinalizeContext<'_, '_, S>) -> Option<AttributeKind> {
351366
if let Some(first_span) = self.first_span {

compiler/rustc_attr_parsing/src/attributes/non_exhaustive.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ impl<S: Stage> NoArgsAttributeParser<S> for NonExhaustiveParser {
1919
Warn(Target::Field),
2020
Warn(Target::Arm),
2121
Warn(Target::MacroDef),
22+
Warn(Target::MacroCall),
2223
]);
2324
const CREATE: fn(Span) -> AttributeKind = AttributeKind::NonExhaustive;
2425
}

0 commit comments

Comments
 (0)