Skip to content

Commit 4d73a00

Browse files
committed
Auto merge of #150726 - JonathanBrouwer:rollup-yseerwy, r=JonathanBrouwer
Rollup of 10 pull requests Successful merges: - #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items) - #149880 (rustc_codegen_llvm: update alignment for double on AIX) - #150122 (Refactor function names of `rustc_ast_lowering`) - #150412 (use PIDFD_GET_INFO ioctl when available) - #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`) - #150695 (MGCA: pretty printing for struct expressions and tuple calls ) - #150698 (Improve comment clarity in candidate_may_shadow) - #150706 (Update wasm-component-ld) - #150707 (Fix ICE when transmute Assume field is invalid) - #150708 (Enable merge queue in new bors) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 74fd751 + 9c9ecb1 commit 4d73a00

File tree

29 files changed

+595
-206
lines changed

29 files changed

+595
-206
lines changed

‎Cargo.lock‎

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6221,9 +6221,9 @@ dependencies = [
62216221

62226222
[[package]]
62236223
name = "wasi-preview1-component-adapter-provider"
6224-
version = "38.0.4"
6224+
version = "40.0.0"
62256225
source = "registry+https://github.com/rust-lang/crates.io-index"
6226-
checksum = "7ec3ef3783e18f2457796ed91b1e6c2adc46f2905f740d1527ab3053fe8e5682"
6226+
checksum = "bb5e2b9858989c3a257de4ca169977f4f79897b64e4f482f188f4fcf8ac557d1"
62276227

62286228
[[package]]
62296229
name = "wasm-bindgen"
@@ -6272,17 +6272,18 @@ dependencies = [
62726272

62736273
[[package]]
62746274
name = "wasm-component-ld"
6275-
version = "0.5.19"
6275+
version = "0.5.20"
62766276
source = "registry+https://github.com/rust-lang/crates.io-index"
6277-
checksum = "4bfc50dd0b883d841bc1dba5ff7020ca52fa7b2c3bb1266d8bf6a09dd032e115"
6277+
checksum = "846d20ed66ae37b7a237e36dfcd2fdc979eae82a46cdb0586f9bba80782fd789"
62786278
dependencies = [
62796279
"anyhow",
62806280
"clap",
6281+
"clap_lex",
62816282
"lexopt",
62826283
"libc",
62836284
"tempfile",
62846285
"wasi-preview1-component-adapter-provider",
6285-
"wasmparser 0.241.2",
6286+
"wasmparser 0.243.0",
62866287
"wat",
62876288
"windows-sys 0.61.2",
62886289
"winsplit",
@@ -6309,24 +6310,24 @@ dependencies = [
63096310

63106311
[[package]]
63116312
name = "wasm-encoder"
6312-
version = "0.241.2"
6313+
version = "0.243.0"
63136314
source = "registry+https://github.com/rust-lang/crates.io-index"
6314-
checksum = "e01164c9dda68301e34fdae536c23ed6fe90ce6d97213ccc171eebbd3d02d6b8"
6315+
checksum = "c55db9c896d70bd9fa535ce83cd4e1f2ec3726b0edd2142079f594fc3be1cb35"
63156316
dependencies = [
63166317
"leb128fmt",
6317-
"wasmparser 0.241.2",
6318+
"wasmparser 0.243.0",
63186319
]
63196320

63206321
[[package]]
63216322
name = "wasm-metadata"
6322-
version = "0.241.2"
6323+
version = "0.243.0"
63236324
source = "registry+https://github.com/rust-lang/crates.io-index"
6324-
checksum = "876fe286f2fa416386deedebe8407e6f19e0b5aeaef3d03161e77a15fa80f167"
6325+
checksum = "eae05bf9579f45a62e8d0a4e3f52eaa8da518883ac5afa482ec8256c329ecd56"
63256326
dependencies = [
63266327
"anyhow",
63276328
"indexmap",
6328-
"wasm-encoder 0.241.2",
6329-
"wasmparser 0.241.2",
6329+
"wasm-encoder 0.243.0",
6330+
"wasmparser 0.243.0",
63306331
]
63316332

63326333
[[package]]
@@ -6351,9 +6352,9 @@ dependencies = [
63516352

63526353
[[package]]
63536354
name = "wasmparser"
6354-
version = "0.241.2"
6355+
version = "0.243.0"
63556356
source = "registry+https://github.com/rust-lang/crates.io-index"
6356-
checksum = "46d90019b1afd4b808c263e428de644f3003691f243387d30d673211ee0cb8e8"
6357+
checksum = "f6d8db401b0528ec316dfbe579e6ab4152d61739cfe076706d2009127970159d"
63576358
dependencies = [
63586359
"bitflags",
63596360
"hashbrown 0.15.5",
@@ -6364,22 +6365,22 @@ dependencies = [
63646365

63656366
[[package]]
63666367
name = "wast"
6367-
version = "241.0.2"
6368+
version = "243.0.0"
63686369
source = "registry+https://github.com/rust-lang/crates.io-index"
6369-
checksum = "63f66e07e2ddf531fef6344dbf94d112df7c2f23ed6ffb10962e711500b8d816"
6370+
checksum = "df21d01c2d91e46cb7a221d79e58a2d210ea02020d57c092e79255cc2999ca7f"
63706371
dependencies = [
63716372
"bumpalo",
63726373
"leb128fmt",
63736374
"memchr",
63746375
"unicode-width 0.2.2",
6375-
"wasm-encoder 0.241.2",
6376+
"wasm-encoder 0.243.0",
63766377
]
63776378

63786379
[[package]]
63796380
name = "wat"
6380-
version = "1.241.2"
6381+
version = "1.243.0"
63816382
source = "registry+https://github.com/rust-lang/crates.io-index"
6382-
checksum = "45f923705c40830af909c5dec2352ec2821202e4a66008194585e1917458a26d"
6383+
checksum = "226a9a91cd80a50449312fef0c75c23478fcecfcc4092bdebe1dc8e760ef521b"
63836384
dependencies = [
63846385
"wast",
63856386
]
@@ -6775,9 +6776,9 @@ dependencies = [
67756776

67766777
[[package]]
67776778
name = "wit-component"
6778-
version = "0.241.2"
6779+
version = "0.243.0"
67796780
source = "registry+https://github.com/rust-lang/crates.io-index"
6780-
checksum = "1fd0c57df25e7ee612d946d3b7646c1ddb2310f8280aa2c17e543b66e0812241"
6781+
checksum = "36f9fc53513e461ce51dcf17a3e331752cb829f1d187069e54af5608fc998fe4"
67816782
dependencies = [
67826783
"anyhow",
67836784
"bitflags",
@@ -6786,17 +6787,17 @@ dependencies = [
67866787
"serde",
67876788
"serde_derive",
67886789
"serde_json",
6789-
"wasm-encoder 0.241.2",
6790+
"wasm-encoder 0.243.0",
67906791
"wasm-metadata",
6791-
"wasmparser 0.241.2",
6792+
"wasmparser 0.243.0",
67926793
"wit-parser",
67936794
]
67946795

67956796
[[package]]
67966797
name = "wit-parser"
6797-
version = "0.241.2"
6798+
version = "0.243.0"
67986799
source = "registry+https://github.com/rust-lang/crates.io-index"
6799-
checksum = "09ef1c6ad67f35c831abd4039c02894de97034100899614d1c44e2268ad01c91"
6800+
checksum = "df983a8608e513d8997f435bb74207bf0933d0e49ca97aa9d8a6157164b9b7fc"
68006801
dependencies = [
68016802
"anyhow",
68026803
"id-arena",
@@ -6807,7 +6808,7 @@ dependencies = [
68076808
"serde_derive",
68086809
"serde_json",
68096810
"unicode-xid",
6810-
"wasmparser 0.241.2",
6811+
"wasmparser 0.243.0",
68116812
]
68126813

68136814
[[package]]

‎compiler/rustc_ast_lowering/src/block.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
9898
// Let statements are allowed to have impl trait in bindings.
9999
let super_ = l.super_.map(|span| self.lower_span(span));
100100
let ty = l.ty.as_ref().map(|t| {
101-
self.lower_ty(t, self.impl_trait_in_bindings_ctxt(ImplTraitPosition::Variable))
101+
self.lower_ty_alloc(t, self.impl_trait_in_bindings_ctxt(ImplTraitPosition::Variable))
102102
});
103103
let init = l.kind.init().map(|init| self.lower_expr(init));
104104
let hir_id = self.lower_node_id(l.id);

‎compiler/rustc_ast_lowering/src/expr.rs‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
158158
}
159159
ExprKind::Cast(expr, ty) => {
160160
let expr = self.lower_expr(expr);
161-
let ty =
162-
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast));
161+
let ty = self
162+
.lower_ty_alloc(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast));
163163
hir::ExprKind::Cast(expr, ty)
164164
}
165165
ExprKind::Type(expr, ty) => {
166166
let expr = self.lower_expr(expr);
167-
let ty =
168-
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast));
167+
let ty = self
168+
.lower_ty_alloc(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast));
169169
hir::ExprKind::Type(expr, ty)
170170
}
171171
ExprKind::AddrOf(k, m, ohs) => {
@@ -335,7 +335,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
335335
}
336336
ExprKind::FormatArgs(fmt) => self.lower_format_args(e.span, fmt),
337337
ExprKind::OffsetOf(container, fields) => hir::ExprKind::OffsetOf(
338-
self.lower_ty(
338+
self.lower_ty_alloc(
339339
container,
340340
ImplTraitContext::Disallowed(ImplTraitPosition::OffsetOf),
341341
),
@@ -371,7 +371,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
371371
*kind,
372372
self.lower_expr(expr),
373373
ty.as_ref().map(|ty| {
374-
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast))
374+
self.lower_ty_alloc(
375+
ty,
376+
ImplTraitContext::Disallowed(ImplTraitPosition::Cast),
377+
)
375378
}),
376379
),
377380

@@ -617,7 +620,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
617620
});
618621

619622
if let Some(ty) = opt_ty {
620-
let ty = self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Path));
623+
let ty = self.lower_ty_alloc(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Path));
621624
let block_expr = self.arena.alloc(self.expr_block(whole_block));
622625
hir::ExprKind::Type(block_expr, ty)
623626
} else {

‎compiler/rustc_ast_lowering/src/item.rs‎

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
264264
define_opaque,
265265
}) => {
266266
let ident = self.lower_ident(*ident);
267-
let ty =
268-
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::StaticTy));
267+
let ty = self
268+
.lower_ty_alloc(ty, ImplTraitContext::Disallowed(ImplTraitPosition::StaticTy));
269269
let body_id = self.lower_const_body(span, e.as_deref());
270270
self.lower_define_opaque(hir_id, define_opaque);
271271
hir::ItemKind::Static(*m, ident, ty, body_id)
@@ -279,8 +279,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
279279
id,
280280
ImplTraitContext::Disallowed(ImplTraitPosition::Generic),
281281
|this| {
282-
let ty = this
283-
.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy));
282+
let ty = this.lower_ty_alloc(
283+
ty,
284+
ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy),
285+
);
284286
let rhs = this.lower_const_item_rhs(attrs, rhs.as_ref(), span);
285287
(ty, rhs)
286288
},
@@ -379,7 +381,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
379381
);
380382
this.arena.alloc(this.ty(span, hir::TyKind::Err(guar)))
381383
}
382-
Some(ty) => this.lower_ty(
384+
Some(ty) => this.lower_ty_alloc(
383385
ty,
384386
ImplTraitContext::OpaqueTy {
385387
origin: hir::OpaqueTyOrigin::TyAlias {
@@ -453,7 +455,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
453455
.as_deref()
454456
.map(|of_trait| this.lower_trait_impl_header(of_trait));
455457

456-
let lowered_ty = this.lower_ty(
458+
let lowered_ty = this.lower_ty_alloc(
457459
ty,
458460
ImplTraitContext::Disallowed(ImplTraitPosition::ImplSelf),
459461
);
@@ -758,8 +760,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
758760
safety,
759761
define_opaque,
760762
}) => {
761-
let ty =
762-
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::StaticTy));
763+
let ty = self
764+
.lower_ty_alloc(ty, ImplTraitContext::Disallowed(ImplTraitPosition::StaticTy));
763765
let safety = self.lower_safety(*safety, hir::Safety::Unsafe);
764766
if define_opaque.is_some() {
765767
self.dcx().span_err(i.span, "foreign statics cannot define opaque types");
@@ -870,7 +872,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
870872
&mut self,
871873
(index, f): (usize, &FieldDef),
872874
) -> hir::FieldDef<'hir> {
873-
let ty = self.lower_ty(&f.ty, ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy));
875+
let ty =
876+
self.lower_ty_alloc(&f.ty, ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy));
874877
let hir_id = self.lower_node_id(f.id);
875878
self.lower_attrs(hir_id, &f.attrs, f.span, Target::Field);
876879
hir::FieldDef {
@@ -908,8 +911,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
908911
i.id,
909912
ImplTraitContext::Disallowed(ImplTraitPosition::Generic),
910913
|this| {
911-
let ty = this
912-
.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy));
914+
let ty = this.lower_ty_alloc(
915+
ty,
916+
ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy),
917+
);
913918
let rhs = rhs
914919
.as_ref()
915920
.map(|rhs| this.lower_const_item_rhs(attrs, Some(rhs), i.span));
@@ -1008,7 +1013,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10081013
ImplTraitContext::Disallowed(ImplTraitPosition::Generic),
10091014
|this| {
10101015
let ty = ty.as_ref().map(|x| {
1011-
this.lower_ty(
1016+
this.lower_ty_alloc(
10121017
x,
10131018
ImplTraitContext::Disallowed(ImplTraitPosition::AssocTy),
10141019
)
@@ -1120,8 +1125,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
11201125
i.id,
11211126
ImplTraitContext::Disallowed(ImplTraitPosition::Generic),
11221127
|this| {
1123-
let ty = this
1124-
.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy));
1128+
let ty = this.lower_ty_alloc(
1129+
ty,
1130+
ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy),
1131+
);
11251132
this.lower_define_opaque(hir_id, &define_opaque);
11261133
let rhs = this.lower_const_item_rhs(attrs, rhs.as_ref(), i.span);
11271134
hir::ImplItemKind::Const(ty, rhs)
@@ -1180,7 +1187,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
11801187
hir::ImplItemKind::Type(ty)
11811188
}
11821189
Some(ty) => {
1183-
let ty = this.lower_ty(
1190+
let ty = this.lower_ty_alloc(
11841191
ty,
11851192
ImplTraitContext::OpaqueTy {
11861193
origin: hir::OpaqueTyOrigin::TyAlias {
@@ -1916,7 +1923,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
19161923
bound_generic_params,
19171924
hir::GenericParamSource::Binder,
19181925
),
1919-
bounded_ty: self.lower_ty(
1926+
bounded_ty: self.lower_ty_alloc(
19201927
bounded_ty,
19211928
ImplTraitContext::Disallowed(ImplTraitPosition::Bound),
19221929
),
@@ -1945,10 +1952,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
19451952
}
19461953
WherePredicateKind::EqPredicate(WhereEqPredicate { lhs_ty, rhs_ty }) => {
19471954
hir::WherePredicateKind::EqPredicate(hir::WhereEqPredicate {
1948-
lhs_ty: self
1949-
.lower_ty(lhs_ty, ImplTraitContext::Disallowed(ImplTraitPosition::Bound)),
1950-
rhs_ty: self
1951-
.lower_ty(rhs_ty, ImplTraitContext::Disallowed(ImplTraitPosition::Bound)),
1955+
lhs_ty: self.lower_ty_alloc(
1956+
lhs_ty,
1957+
ImplTraitContext::Disallowed(ImplTraitPosition::Bound),
1958+
),
1959+
rhs_ty: self.lower_ty_alloc(
1960+
rhs_ty,
1961+
ImplTraitContext::Disallowed(ImplTraitPosition::Bound),
1962+
),
19521963
})
19531964
}
19541965
});

0 commit comments

Comments
 (0)