Skip to content

Commit 15716a3

Browse files
authored
Merge pull request #4627 from RalfJung/rustup
Rustup
2 parents 77208bc + 0c2e30b commit 15716a3

File tree

534 files changed

+7752
-6458
lines changed

Some content is hidden

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

534 files changed

+7752
-6458
lines changed

.github/ISSUE_TEMPLATE/library_tracking_issue.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ If the feature is changed later, please add those PRs here as well.
5151

5252
(Remember to update the `S-tracking-*` label when checking boxes.)
5353

54+
- [ ] ACP: rust-lang/libs-team#...
5455
- [ ] Implementation: #...
5556
- [ ] Final comment period (FCP)[^1]
5657
- [ ] Stabilization PR

Cargo.lock

Lines changed: 51 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ dependencies = [
495495
"iana-time-zone",
496496
"num-traits",
497497
"serde",
498-
"windows-link",
498+
"windows-link 0.1.3",
499499
]
500500

501501
[[package]]
@@ -4805,7 +4805,6 @@ name = "rustdoc-gui-test"
48054805
version = "0.1.0"
48064806
dependencies = [
48074807
"build_helper",
4808-
"camino",
48094808
"compiletest",
48104809
"getopts",
48114810
"walkdir",
@@ -6059,9 +6058,9 @@ dependencies = [
60596058

60606059
[[package]]
60616060
name = "wasi-preview1-component-adapter-provider"
6062-
version = "36.0.1"
6061+
version = "37.0.2"
60636062
source = "registry+https://github.com/rust-lang/crates.io-index"
6064-
checksum = "20689c88791776219f78c2529700d15e6a9bd57a27858c62e9ef8487956b571c"
6063+
checksum = "8d0fcd636ad2b29a7c0490799a23ad61d1c8dedfafdb970447fddd0549502b60"
60656064

60666065
[[package]]
60676066
name = "wasm-bindgen"
@@ -6123,19 +6122,19 @@ dependencies = [
61236122

61246123
[[package]]
61256124
name = "wasm-component-ld"
6126-
version = "0.5.17"
6125+
version = "0.5.18"
61276126
source = "registry+https://github.com/rust-lang/crates.io-index"
6128-
checksum = "1c9208f87cac2332fd80dcf36d54e9163d3446e28301e0c6e424984425738984"
6127+
checksum = "11f565dfcfd9aabb10d865b608a92ce1f93051aeb56f4c89550ed9cd97d8ce0e"
61296128
dependencies = [
61306129
"anyhow",
61316130
"clap",
61326131
"lexopt",
61336132
"libc",
61346133
"tempfile",
61356134
"wasi-preview1-component-adapter-provider",
6136-
"wasmparser 0.239.0",
6135+
"wasmparser 0.240.0",
61376136
"wat",
6138-
"windows-sys 0.60.2",
6137+
"windows-sys 0.61.2",
61396138
"winsplit",
61406139
"wit-component",
61416140
"wit-parser",
@@ -6160,24 +6159,24 @@ dependencies = [
61606159

61616160
[[package]]
61626161
name = "wasm-encoder"
6163-
version = "0.239.0"
6162+
version = "0.240.0"
61646163
source = "registry+https://github.com/rust-lang/crates.io-index"
6165-
checksum = "5be00faa2b4950c76fe618c409d2c3ea5a3c9422013e079482d78544bb2d184c"
6164+
checksum = "06d642d8c5ecc083aafe9ceb32809276a304547a3a6eeecceb5d8152598bc71f"
61666165
dependencies = [
61676166
"leb128fmt",
6168-
"wasmparser 0.239.0",
6167+
"wasmparser 0.240.0",
61696168
]
61706169

61716170
[[package]]
61726171
name = "wasm-metadata"
6173-
version = "0.239.0"
6172+
version = "0.240.0"
61746173
source = "registry+https://github.com/rust-lang/crates.io-index"
6175-
checksum = "20b3ec880a9ac69ccd92fbdbcf46ee833071cf09f82bb005b2327c7ae6025ae2"
6174+
checksum = "ee093e1e1ccffa005b9b778f7a10ccfd58e25a20eccad294a1a93168d076befb"
61766175
dependencies = [
61776176
"anyhow",
61786177
"indexmap",
6179-
"wasm-encoder 0.239.0",
6180-
"wasmparser 0.239.0",
6178+
"wasm-encoder 0.240.0",
6179+
"wasmparser 0.240.0",
61816180
]
61826181

61836182
[[package]]
@@ -6202,9 +6201,9 @@ dependencies = [
62026201

62036202
[[package]]
62046203
name = "wasmparser"
6205-
version = "0.239.0"
6204+
version = "0.240.0"
62066205
source = "registry+https://github.com/rust-lang/crates.io-index"
6207-
checksum = "8c9d90bb93e764f6beabf1d02028c70a2156a6583e63ac4218dd07ef733368b0"
6206+
checksum = "b722dcf61e0ea47440b53ff83ccb5df8efec57a69d150e4f24882e4eba7e24a4"
62086207
dependencies = [
62096208
"bitflags",
62106209
"hashbrown",
@@ -6215,22 +6214,22 @@ dependencies = [
62156214

62166215
[[package]]
62176216
name = "wast"
6218-
version = "239.0.0"
6217+
version = "240.0.0"
62196218
source = "registry+https://github.com/rust-lang/crates.io-index"
6220-
checksum = "9139176fe8a2590e0fb174cdcaf373b224cb93c3dde08e4297c1361d2ba1ea5d"
6219+
checksum = "b0efe1c93db4ac562b9733e3dca19ed7fc878dba29aef22245acf84f13da4a19"
62216220
dependencies = [
62226221
"bumpalo",
62236222
"leb128fmt",
62246223
"memchr",
62256224
"unicode-width 0.2.1",
6226-
"wasm-encoder 0.239.0",
6225+
"wasm-encoder 0.240.0",
62276226
]
62286227

62296228
[[package]]
62306229
name = "wat"
6231-
version = "1.239.0"
6230+
version = "1.240.0"
62326231
source = "registry+https://github.com/rust-lang/crates.io-index"
6233-
checksum = "3e1c941927d34709f255558166f8901a2005f8ab4a9650432e9281b7cc6f3b75"
6232+
checksum = "4ec9b6eab7ecd4d639d78515e9ea491c9bacf494aa5eda10823bd35992cf8c1e"
62346233
dependencies = [
62356234
"wast",
62366235
]
@@ -6295,7 +6294,7 @@ dependencies = [
62956294
"windows-collections",
62966295
"windows-core 0.61.2",
62976296
"windows-future",
6298-
"windows-link",
6297+
"windows-link 0.1.3",
62996298
"windows-numerics",
63006299
]
63016300

@@ -6340,7 +6339,7 @@ checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
63406339
dependencies = [
63416340
"windows-implement 0.60.0",
63426341
"windows-interface 0.59.1",
6343-
"windows-link",
6342+
"windows-link 0.1.3",
63446343
"windows-result 0.3.4",
63456344
"windows-strings 0.4.2",
63466345
]
@@ -6352,7 +6351,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
63526351
checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
63536352
dependencies = [
63546353
"windows-core 0.61.2",
6355-
"windows-link",
6354+
"windows-link 0.1.3",
63566355
"windows-threading",
63576356
]
63586357

@@ -6406,14 +6405,20 @@ version = "0.1.3"
64066405
source = "registry+https://github.com/rust-lang/crates.io-index"
64076406
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
64086407

6408+
[[package]]
6409+
name = "windows-link"
6410+
version = "0.2.1"
6411+
source = "registry+https://github.com/rust-lang/crates.io-index"
6412+
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
6413+
64096414
[[package]]
64106415
name = "windows-numerics"
64116416
version = "0.2.0"
64126417
source = "registry+https://github.com/rust-lang/crates.io-index"
64136418
checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
64146419
dependencies = [
64156420
"windows-core 0.61.2",
6416-
"windows-link",
6421+
"windows-link 0.1.3",
64176422
]
64186423

64196424
[[package]]
@@ -6431,7 +6436,7 @@ version = "0.3.4"
64316436
source = "registry+https://github.com/rust-lang/crates.io-index"
64326437
checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
64336438
dependencies = [
6434-
"windows-link",
6439+
"windows-link 0.1.3",
64356440
]
64366441

64376442
[[package]]
@@ -6450,7 +6455,7 @@ version = "0.4.2"
64506455
source = "registry+https://github.com/rust-lang/crates.io-index"
64516456
checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
64526457
dependencies = [
6453-
"windows-link",
6458+
"windows-link 0.1.3",
64546459
]
64556460

64566461
[[package]]
@@ -6480,6 +6485,15 @@ dependencies = [
64806485
"windows-targets 0.53.3",
64816486
]
64826487

6488+
[[package]]
6489+
name = "windows-sys"
6490+
version = "0.61.2"
6491+
source = "registry+https://github.com/rust-lang/crates.io-index"
6492+
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
6493+
dependencies = [
6494+
"windows-link 0.2.1",
6495+
]
6496+
64836497
[[package]]
64846498
name = "windows-targets"
64856499
version = "0.52.6"
@@ -6502,7 +6516,7 @@ version = "0.53.3"
65026516
source = "registry+https://github.com/rust-lang/crates.io-index"
65036517
checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91"
65046518
dependencies = [
6505-
"windows-link",
6519+
"windows-link 0.1.3",
65066520
"windows_aarch64_gnullvm 0.53.0",
65076521
"windows_aarch64_msvc 0.53.0",
65086522
"windows_i686_gnu 0.53.0",
@@ -6519,7 +6533,7 @@ version = "0.1.0"
65196533
source = "registry+https://github.com/rust-lang/crates.io-index"
65206534
checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"
65216535
dependencies = [
6522-
"windows-link",
6536+
"windows-link 0.1.3",
65236537
]
65246538

65256539
[[package]]
@@ -6653,9 +6667,9 @@ dependencies = [
66536667

66546668
[[package]]
66556669
name = "wit-component"
6656-
version = "0.239.0"
6670+
version = "0.240.0"
66576671
source = "registry+https://github.com/rust-lang/crates.io-index"
6658-
checksum = "88a866b19dba2c94d706ec58c92a4c62ab63e482b4c935d2a085ac94caecb136"
6672+
checksum = "7dc5474b078addc5fe8a72736de8da3acfb3ff324c2491133f8b59594afa1a20"
66596673
dependencies = [
66606674
"anyhow",
66616675
"bitflags",
@@ -6664,17 +6678,17 @@ dependencies = [
66646678
"serde",
66656679
"serde_derive",
66666680
"serde_json",
6667-
"wasm-encoder 0.239.0",
6681+
"wasm-encoder 0.240.0",
66686682
"wasm-metadata",
6669-
"wasmparser 0.239.0",
6683+
"wasmparser 0.240.0",
66706684
"wit-parser",
66716685
]
66726686

66736687
[[package]]
66746688
name = "wit-parser"
6675-
version = "0.239.0"
6689+
version = "0.240.0"
66766690
source = "registry+https://github.com/rust-lang/crates.io-index"
6677-
checksum = "55c92c939d667b7bf0c6bf2d1f67196529758f99a2a45a3355cc56964fd5315d"
6691+
checksum = "9875ea3fa272f57cc1fc50f225a7b94021a7878c484b33792bccad0d93223439"
66786692
dependencies = [
66796693
"anyhow",
66806694
"id-arena",
@@ -6685,7 +6699,7 @@ dependencies = [
66856699
"serde_derive",
66866700
"serde_json",
66876701
"unicode-xid",
6688-
"wasmparser 0.239.0",
6702+
"wasmparser 0.240.0",
66896703
]
66906704

66916705
[[package]]

compiler/rustc_arena/src/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ impl<T> TypedArena<T> {
1919
unsafe {
2020
// Clear the last chunk, which is partially filled.
2121
let mut chunks_borrow = self.chunks.borrow_mut();
22-
if let Some(mut last_chunk) = chunks_borrow.last_mut() {
23-
self.clear_last_chunk(&mut last_chunk);
22+
if let Some(last_chunk) = chunks_borrow.last_mut() {
23+
self.clear_last_chunk(last_chunk);
2424
let len = chunks_borrow.len();
2525
// If `T` is ZST, code below has no effect.
2626
for mut chunk in chunks_borrow.drain(..len - 1) {

compiler/rustc_ast/src/token.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,11 +881,11 @@ impl Token {
881881
}
882882

883883
pub fn is_qpath_start(&self) -> bool {
884-
self == &Lt || self == &Shl
884+
matches!(self.kind, Lt | Shl)
885885
}
886886

887887
pub fn is_path_start(&self) -> bool {
888-
self == &PathSep
888+
self.kind == PathSep
889889
|| self.is_qpath_start()
890890
|| matches!(self.is_metavar_seq(), Some(MetaVarKind::Path))
891891
|| self.is_path_segment_keyword()

compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::session_diagnostics::{
66
NakedFunctionIncompatibleAttribute, NullOnExport, NullOnObjcClass, NullOnObjcSelector,
77
ObjcClassExpectedStringLiteral, ObjcSelectorExpectedStringLiteral,
88
};
9+
use crate::target_checking::Policy::AllowSilent;
910

1011
pub(crate) struct OptimizeParser;
1112

@@ -362,6 +363,8 @@ impl<S: Stage> NoArgsAttributeParser<S> for NoMangleParser {
362363
Allow(Target::Static),
363364
Allow(Target::Method(MethodKind::Inherent)),
364365
Allow(Target::Method(MethodKind::TraitImpl)),
366+
AllowSilent(Target::Const), // Handled in the `InvalidNoMangleItems` pass
367+
Error(Target::Closure),
365368
]);
366369
const CREATE: fn(Span) -> AttributeKind = AttributeKind::NoMangle;
367370
}

compiler/rustc_attr_parsing/src/target_checking.rs

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ impl AllowedTargets {
3131
pub(crate) fn is_allowed(&self, target: Target) -> AllowedResult {
3232
match self {
3333
AllowedTargets::AllowList(list) => {
34-
if list.contains(&Policy::Allow(target)) {
34+
if list.contains(&Policy::Allow(target))
35+
|| list.contains(&Policy::AllowSilent(target))
36+
{
3537
AllowedResult::Allowed
3638
} else if list.contains(&Policy::Warn(target)) {
3739
AllowedResult::Warn
@@ -40,7 +42,9 @@ impl AllowedTargets {
4042
}
4143
}
4244
AllowedTargets::AllowListWarnRest(list) => {
43-
if list.contains(&Policy::Allow(target)) {
45+
if list.contains(&Policy::Allow(target))
46+
|| list.contains(&Policy::AllowSilent(target))
47+
{
4448
AllowedResult::Allowed
4549
} else if list.contains(&Policy::Error(target)) {
4650
AllowedResult::Error
@@ -61,17 +65,26 @@ impl AllowedTargets {
6165
.iter()
6266
.filter_map(|target| match target {
6367
Policy::Allow(target) => Some(*target),
68+
Policy::AllowSilent(_) => None, // Not listed in possible targets
6469
Policy::Warn(_) => None,
6570
Policy::Error(_) => None,
6671
})
6772
.collect()
6873
}
6974
}
7075

76+
/// This policy determines what diagnostics should be emitted based on the `Target` of the attribute.
7177
#[derive(Debug, Eq, PartialEq)]
7278
pub(crate) enum Policy {
79+
/// A target that is allowed.
7380
Allow(Target),
81+
/// A target that is allowed and not listed in the possible targets.
82+
/// This is useful if the target is checked elsewhere.
83+
AllowSilent(Target),
84+
/// Emits a FCW on this target.
85+
/// This is useful if the target was previously allowed but should not be.
7486
Warn(Target),
87+
/// Emits an error on this target.
7588
Error(Target),
7689
}
7790

@@ -198,16 +211,20 @@ pub(crate) fn allowed_targets_applied(
198211
filter_targets(&mut allowed_targets, IMPL_LIKE, "impl blocks", target, &mut added_fake_targets);
199212
filter_targets(&mut allowed_targets, ADT_LIKE, "data types", target, &mut added_fake_targets);
200213

214+
let mut target_strings: Vec<_> = added_fake_targets
215+
.iter()
216+
.copied()
217+
.chain(allowed_targets.iter().map(|t| t.plural_name()))
218+
.map(|i| i.to_string())
219+
.collect();
220+
221+
// ensure a consistent order
222+
target_strings.sort();
223+
201224
// If there is now only 1 target left, show that as the only possible target
202-
(
203-
added_fake_targets
204-
.iter()
205-
.copied()
206-
.chain(allowed_targets.iter().map(|t| t.plural_name()))
207-
.map(|i| i.to_string())
208-
.collect(),
209-
allowed_targets.len() + added_fake_targets.len() == 1,
210-
)
225+
let only_target = target_strings.len() == 1;
226+
227+
(target_strings, only_target)
211228
}
212229

213230
fn filter_targets(

0 commit comments

Comments
 (0)