Skip to content

Commit 3762395

Browse files
committed
Auto merge of #147609 - matthiaskrgr:rollup-6bdj1vr, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #147168 (Don't unconditionally build alloc for `no-std` targets) - #147178 ([DebugInfo] Improve formatting of MSVC enum struct variants) - #147495 (Update wasm-component-ld to 0.5.18) - #147576 (Fix ICE on offsetted ZST pointer) - #147592 (Add tidy to the target of ./x check) - #147597 (Add a regression test for #72207) - #147604 (Some clippy cleanups in compiler) r? `@ghost` `@rustbot` modify labels: rollup
2 parents ff6dc92 + 6bf850b commit 3762395

File tree

26 files changed

+205
-109
lines changed

26 files changed

+205
-109
lines changed

Cargo.lock

Lines changed: 51 additions & 36 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]]
@@ -6058,9 +6058,9 @@ dependencies = [
60586058

60596059
[[package]]
60606060
name = "wasi-preview1-component-adapter-provider"
6061-
version = "36.0.1"
6061+
version = "37.0.2"
60626062
source = "registry+https://github.com/rust-lang/crates.io-index"
6063-
checksum = "20689c88791776219f78c2529700d15e6a9bd57a27858c62e9ef8487956b571c"
6063+
checksum = "8d0fcd636ad2b29a7c0490799a23ad61d1c8dedfafdb970447fddd0549502b60"
60646064

60656065
[[package]]
60666066
name = "wasm-bindgen"
@@ -6122,19 +6122,19 @@ dependencies = [
61226122

61236123
[[package]]
61246124
name = "wasm-component-ld"
6125-
version = "0.5.17"
6125+
version = "0.5.18"
61266126
source = "registry+https://github.com/rust-lang/crates.io-index"
6127-
checksum = "1c9208f87cac2332fd80dcf36d54e9163d3446e28301e0c6e424984425738984"
6127+
checksum = "11f565dfcfd9aabb10d865b608a92ce1f93051aeb56f4c89550ed9cd97d8ce0e"
61286128
dependencies = [
61296129
"anyhow",
61306130
"clap",
61316131
"lexopt",
61326132
"libc",
61336133
"tempfile",
61346134
"wasi-preview1-component-adapter-provider",
6135-
"wasmparser 0.239.0",
6135+
"wasmparser 0.240.0",
61366136
"wat",
6137-
"windows-sys 0.60.2",
6137+
"windows-sys 0.61.2",
61386138
"winsplit",
61396139
"wit-component",
61406140
"wit-parser",
@@ -6159,24 +6159,24 @@ dependencies = [
61596159

61606160
[[package]]
61616161
name = "wasm-encoder"
6162-
version = "0.239.0"
6162+
version = "0.240.0"
61636163
source = "registry+https://github.com/rust-lang/crates.io-index"
6164-
checksum = "5be00faa2b4950c76fe618c409d2c3ea5a3c9422013e079482d78544bb2d184c"
6164+
checksum = "06d642d8c5ecc083aafe9ceb32809276a304547a3a6eeecceb5d8152598bc71f"
61656165
dependencies = [
61666166
"leb128fmt",
6167-
"wasmparser 0.239.0",
6167+
"wasmparser 0.240.0",
61686168
]
61696169

61706170
[[package]]
61716171
name = "wasm-metadata"
6172-
version = "0.239.0"
6172+
version = "0.240.0"
61736173
source = "registry+https://github.com/rust-lang/crates.io-index"
6174-
checksum = "20b3ec880a9ac69ccd92fbdbcf46ee833071cf09f82bb005b2327c7ae6025ae2"
6174+
checksum = "ee093e1e1ccffa005b9b778f7a10ccfd58e25a20eccad294a1a93168d076befb"
61756175
dependencies = [
61766176
"anyhow",
61776177
"indexmap",
6178-
"wasm-encoder 0.239.0",
6179-
"wasmparser 0.239.0",
6178+
"wasm-encoder 0.240.0",
6179+
"wasmparser 0.240.0",
61806180
]
61816181

61826182
[[package]]
@@ -6201,9 +6201,9 @@ dependencies = [
62016201

62026202
[[package]]
62036203
name = "wasmparser"
6204-
version = "0.239.0"
6204+
version = "0.240.0"
62056205
source = "registry+https://github.com/rust-lang/crates.io-index"
6206-
checksum = "8c9d90bb93e764f6beabf1d02028c70a2156a6583e63ac4218dd07ef733368b0"
6206+
checksum = "b722dcf61e0ea47440b53ff83ccb5df8efec57a69d150e4f24882e4eba7e24a4"
62076207
dependencies = [
62086208
"bitflags",
62096209
"hashbrown",
@@ -6214,22 +6214,22 @@ dependencies = [
62146214

62156215
[[package]]
62166216
name = "wast"
6217-
version = "239.0.0"
6217+
version = "240.0.0"
62186218
source = "registry+https://github.com/rust-lang/crates.io-index"
6219-
checksum = "9139176fe8a2590e0fb174cdcaf373b224cb93c3dde08e4297c1361d2ba1ea5d"
6219+
checksum = "b0efe1c93db4ac562b9733e3dca19ed7fc878dba29aef22245acf84f13da4a19"
62206220
dependencies = [
62216221
"bumpalo",
62226222
"leb128fmt",
62236223
"memchr",
62246224
"unicode-width 0.2.1",
6225-
"wasm-encoder 0.239.0",
6225+
"wasm-encoder 0.240.0",
62266226
]
62276227

62286228
[[package]]
62296229
name = "wat"
6230-
version = "1.239.0"
6230+
version = "1.240.0"
62316231
source = "registry+https://github.com/rust-lang/crates.io-index"
6232-
checksum = "3e1c941927d34709f255558166f8901a2005f8ab4a9650432e9281b7cc6f3b75"
6232+
checksum = "4ec9b6eab7ecd4d639d78515e9ea491c9bacf494aa5eda10823bd35992cf8c1e"
62336233
dependencies = [
62346234
"wast",
62356235
]
@@ -6294,7 +6294,7 @@ dependencies = [
62946294
"windows-collections",
62956295
"windows-core 0.61.2",
62966296
"windows-future",
6297-
"windows-link",
6297+
"windows-link 0.1.3",
62986298
"windows-numerics",
62996299
]
63006300

@@ -6339,7 +6339,7 @@ checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
63396339
dependencies = [
63406340
"windows-implement 0.60.0",
63416341
"windows-interface 0.59.1",
6342-
"windows-link",
6342+
"windows-link 0.1.3",
63436343
"windows-result 0.3.4",
63446344
"windows-strings 0.4.2",
63456345
]
@@ -6351,7 +6351,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
63516351
checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
63526352
dependencies = [
63536353
"windows-core 0.61.2",
6354-
"windows-link",
6354+
"windows-link 0.1.3",
63556355
"windows-threading",
63566356
]
63576357

@@ -6405,14 +6405,20 @@ version = "0.1.3"
64056405
source = "registry+https://github.com/rust-lang/crates.io-index"
64066406
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
64076407

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+
64086414
[[package]]
64096415
name = "windows-numerics"
64106416
version = "0.2.0"
64116417
source = "registry+https://github.com/rust-lang/crates.io-index"
64126418
checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
64136419
dependencies = [
64146420
"windows-core 0.61.2",
6415-
"windows-link",
6421+
"windows-link 0.1.3",
64166422
]
64176423

64186424
[[package]]
@@ -6430,7 +6436,7 @@ version = "0.3.4"
64306436
source = "registry+https://github.com/rust-lang/crates.io-index"
64316437
checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
64326438
dependencies = [
6433-
"windows-link",
6439+
"windows-link 0.1.3",
64346440
]
64356441

64366442
[[package]]
@@ -6449,7 +6455,7 @@ version = "0.4.2"
64496455
source = "registry+https://github.com/rust-lang/crates.io-index"
64506456
checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
64516457
dependencies = [
6452-
"windows-link",
6458+
"windows-link 0.1.3",
64536459
]
64546460

64556461
[[package]]
@@ -6479,6 +6485,15 @@ dependencies = [
64796485
"windows-targets 0.53.3",
64806486
]
64816487

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+
64826497
[[package]]
64836498
name = "windows-targets"
64846499
version = "0.52.6"
@@ -6501,7 +6516,7 @@ version = "0.53.3"
65016516
source = "registry+https://github.com/rust-lang/crates.io-index"
65026517
checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91"
65036518
dependencies = [
6504-
"windows-link",
6519+
"windows-link 0.1.3",
65056520
"windows_aarch64_gnullvm 0.53.0",
65066521
"windows_aarch64_msvc 0.53.0",
65076522
"windows_i686_gnu 0.53.0",
@@ -6518,7 +6533,7 @@ version = "0.1.0"
65186533
source = "registry+https://github.com/rust-lang/crates.io-index"
65196534
checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"
65206535
dependencies = [
6521-
"windows-link",
6536+
"windows-link 0.1.3",
65226537
]
65236538

65246539
[[package]]
@@ -6652,9 +6667,9 @@ dependencies = [
66526667

66536668
[[package]]
66546669
name = "wit-component"
6655-
version = "0.239.0"
6670+
version = "0.240.0"
66566671
source = "registry+https://github.com/rust-lang/crates.io-index"
6657-
checksum = "88a866b19dba2c94d706ec58c92a4c62ab63e482b4c935d2a085ac94caecb136"
6672+
checksum = "7dc5474b078addc5fe8a72736de8da3acfb3ff324c2491133f8b59594afa1a20"
66586673
dependencies = [
66596674
"anyhow",
66606675
"bitflags",
@@ -6663,17 +6678,17 @@ dependencies = [
66636678
"serde",
66646679
"serde_derive",
66656680
"serde_json",
6666-
"wasm-encoder 0.239.0",
6681+
"wasm-encoder 0.240.0",
66676682
"wasm-metadata",
6668-
"wasmparser 0.239.0",
6683+
"wasmparser 0.240.0",
66696684
"wit-parser",
66706685
]
66716686

66726687
[[package]]
66736688
name = "wit-parser"
6674-
version = "0.239.0"
6689+
version = "0.240.0"
66756690
source = "registry+https://github.com/rust-lang/crates.io-index"
6676-
checksum = "55c92c939d667b7bf0c6bf2d1f67196529758f99a2a45a3355cc56964fd5315d"
6691+
checksum = "9875ea3fa272f57cc1fc50f225a7b94021a7878c484b33792bccad0d93223439"
66776692
dependencies = [
66786693
"anyhow",
66796694
"id-arena",
@@ -6684,7 +6699,7 @@ dependencies = [
66846699
"serde_derive",
66856700
"serde_json",
66866701
"unicode-xid",
6687-
"wasmparser 0.239.0",
6702+
"wasmparser 0.240.0",
66886703
]
66896704

66906705
[[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_codegen_cranelift/src/constant.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ pub(crate) fn codegen_const_value<'tcx>(
138138
let base_addr = match fx.tcx.global_alloc(alloc_id) {
139139
GlobalAlloc::Memory(alloc) => {
140140
if alloc.inner().len() == 0 {
141-
assert_eq!(offset, Size::ZERO);
142-
fx.bcx.ins().iconst(fx.pointer_type, alloc.inner().align.bytes() as i64)
141+
fx.bcx.ins().iconst(
142+
fx.pointer_type,
143+
alloc.inner().align.bytes().wrapping_add(offset.bytes()) as i64,
144+
)
143145
} else {
144146
let data_id = data_id_for_alloc_id(
145147
&mut fx.constants_cx,

compiler/rustc_codegen_gcc/src/common.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ impl<'gcc, 'tcx> ConstCodegenMethods for CodegenCx<'gcc, 'tcx> {
247247
// This avoids generating a zero-sized constant value and actually needing a
248248
// real address at runtime.
249249
if alloc.inner().len() == 0 {
250-
assert_eq!(offset.bytes(), 0);
251-
let val = self.const_usize(alloc.inner().align.bytes());
250+
let val = self.const_usize(
251+
alloc.inner().align.bytes().wrapping_add(offset.bytes()),
252+
);
252253
return if matches!(layout.primitive(), Pointer(_)) {
253254
self.context.new_cast(None, val, ty)
254255
} else {

compiler/rustc_codegen_llvm/src/common.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ impl<'ll, 'tcx> ConstCodegenMethods for CodegenCx<'ll, 'tcx> {
281281
// This avoids generating a zero-sized constant value and actually needing a
282282
// real address at runtime.
283283
if alloc.inner().len() == 0 {
284-
assert_eq!(offset.bytes(), 0);
285-
let llval = self.const_usize(alloc.inner().align.bytes());
284+
let llval = self.const_usize(
285+
alloc.inner().align.bytes().wrapping_add(offset.bytes()),
286+
);
286287
return if matches!(layout.primitive(), Pointer(_)) {
287288
unsafe { llvm::LLVMConstIntToPtr(llval, llty) }
288289
} else {

compiler/rustc_fluent_macro/src/fluent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::Tok
265265
Level::Error,
266266
format!("referenced message `{mref}` does not exist (in message `{name}`)"),
267267
)
268-
.help(&format!("you may have meant to use a variable reference (`{{${mref}}}`)"))
268+
.help(format!("you may have meant to use a variable reference (`{{${mref}}}`)"))
269269
.emit();
270270
}
271271
}

compiler/rustc_graphviz/src/tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ impl NodeLabels<&'static str> {
6363
}
6464

6565
fn len(&self) -> usize {
66-
match self {
67-
&UnlabelledNodes(len) => len,
68-
&AllNodesLabelled(ref lbls) => lbls.len(),
69-
&SomeNodesLabelled(ref lbls) => lbls.len(),
66+
match *self {
67+
UnlabelledNodes(len) => len,
68+
AllNodesLabelled(ref lbls) => lbls.len(),
69+
SomeNodesLabelled(ref lbls) => lbls.len(),
7070
}
7171
}
7272
}

compiler/rustc_hashes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl FromStableHash for Hash64 {
5454
type Hash = StableHasherHash;
5555

5656
#[inline]
57-
fn from(StableHasherHash([_0, __1]): Self::Hash) -> Self {
57+
fn from(StableHasherHash([_0, _]): Self::Hash) -> Self {
5858
Self { inner: _0 }
5959
}
6060
}

compiler/rustc_llvm/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ fn main() {
197197

198198
// Include path contains host directory, replace it with target
199199
if is_crossed && flag.starts_with("-I") {
200-
cfg.flag(&flag.replace(&host, &target));
200+
cfg.flag(flag.replace(&host, &target));
201201
continue;
202202
}
203203

compiler/rustc_log/src/lib.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl LoggerConfig {
7373

7474
/// Initialize the logger with the given values for the filter, coloring, and other options env variables.
7575
pub fn init_logger(cfg: LoggerConfig) -> Result<(), Error> {
76-
init_logger_with_additional_layer(cfg, || Registry::default())
76+
init_logger_with_additional_layer(cfg, Registry::default)
7777
}
7878

7979
/// Trait alias for the complex return type of `build_subscriber` in
@@ -145,14 +145,11 @@ where
145145
.with_thread_ids(verbose_thread_ids)
146146
.with_thread_names(verbose_thread_ids);
147147

148-
match cfg.wraptree {
149-
Ok(v) => match v.parse::<usize>() {
150-
Ok(v) => {
151-
layer = layer.with_wraparound(v);
152-
}
148+
if let Ok(v) = cfg.wraptree {
149+
match v.parse::<usize>() {
150+
Ok(v) => layer = layer.with_wraparound(v),
153151
Err(_) => return Err(Error::InvalidWraptree(v)),
154-
},
155-
Err(_) => {} // no wraptree
152+
}
156153
}
157154

158155
let subscriber = build_subscriber().with(layer.with_filter(filter));

0 commit comments

Comments
 (0)