Skip to content

Commit 4be9dc1

Browse files
committed
Auto merge of #156213 - jhpratt:rollup-CkSSHhL, r=jhpratt
Rollup of 12 pull requests Successful merges: - #155341 (generic_const_args: allow paths to non type consts) - #156062 (Added command-line argument support for `wasm32-wali-linux-musl`) - #156159 ([AIX] add -bdbg:namedsects:ss link arg) - #156174 (Wasm: remove implicit `__heap_base`/`__data_end` exports) - #156186 (fix: remap ci-llvm debug paths via `-ffile-prefix-map`) - #156193 (port `rustc_ast*` crates from `box_` to `deref_patterns`) - #156201 (Don't run ui-fulldeps tests twice in stage 1) - #155808 (Always use `ConstFn` context for `const` closures) - #156105 (interpret: correctly deal with repr(transparent) enums) - #156148 (Use `all_impls` instead of handrolling it) - #156156 (Adjust getMCSubtargetInfo signature for LLVM 23+) - #156205 (move generalization test)
2 parents e95e732 + 7474905 commit 4be9dc1

69 files changed

Lines changed: 808 additions & 208 deletions

File tree

Some content is hidden

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

compiler/rustc_ast/src/ast.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4087,18 +4087,18 @@ impl ItemKind {
40874087
pub fn ident(&self) -> Option<Ident> {
40884088
match *self {
40894089
ItemKind::ExternCrate(_, ident)
4090-
| ItemKind::Static(box StaticItem { ident, .. })
4091-
| ItemKind::Const(box ConstItem { ident, .. })
4092-
| ItemKind::Fn(box Fn { ident, .. })
4090+
| ItemKind::Static(StaticItem { ident, .. })
4091+
| ItemKind::Const(ConstItem { ident, .. })
4092+
| ItemKind::Fn(Fn { ident, .. })
40934093
| ItemKind::Mod(_, ident, _)
4094-
| ItemKind::TyAlias(box TyAlias { ident, .. })
4094+
| ItemKind::TyAlias(TyAlias { ident, .. })
40954095
| ItemKind::Enum(ident, ..)
40964096
| ItemKind::Struct(ident, ..)
40974097
| ItemKind::Union(ident, ..)
4098-
| ItemKind::Trait(box Trait { ident, .. })
4099-
| ItemKind::TraitAlias(box TraitAlias { ident, .. })
4098+
| ItemKind::Trait(Trait { ident, .. })
4099+
| ItemKind::TraitAlias(TraitAlias { ident, .. })
41004100
| ItemKind::MacroDef(ident, _)
4101-
| ItemKind::Delegation(box Delegation { ident, .. }) => Some(ident),
4101+
| ItemKind::Delegation(Delegation { ident, .. }) => Some(ident),
41024102

41034103
ItemKind::ConstBlock(_) => Some(ConstBlockItem::IDENT),
41044104

@@ -4149,14 +4149,14 @@ impl ItemKind {
41494149

41504150
pub fn generics(&self) -> Option<&Generics> {
41514151
match self {
4152-
Self::Fn(box Fn { generics, .. })
4153-
| Self::TyAlias(box TyAlias { generics, .. })
4154-
| Self::Const(box ConstItem { generics, .. })
4152+
Self::Fn(Fn { generics, .. })
4153+
| Self::TyAlias(TyAlias { generics, .. })
4154+
| Self::Const(ConstItem { generics, .. })
41554155
| Self::Enum(_, generics, _)
41564156
| Self::Struct(_, generics, _)
41574157
| Self::Union(_, generics, _)
4158-
| Self::Trait(box Trait { generics, .. })
4159-
| Self::TraitAlias(box TraitAlias { generics, .. })
4158+
| Self::Trait(Trait { generics, .. })
4159+
| Self::TraitAlias(TraitAlias { generics, .. })
41604160
| Self::Impl(Impl { generics, .. }) => Some(generics),
41614161

41624162
Self::ExternCrate(..)
@@ -4205,20 +4205,20 @@ pub enum AssocItemKind {
42054205
impl AssocItemKind {
42064206
pub fn ident(&self) -> Option<Ident> {
42074207
match *self {
4208-
AssocItemKind::Const(box ConstItem { ident, .. })
4209-
| AssocItemKind::Fn(box Fn { ident, .. })
4210-
| AssocItemKind::Type(box TyAlias { ident, .. })
4211-
| AssocItemKind::Delegation(box Delegation { ident, .. }) => Some(ident),
4208+
AssocItemKind::Const(ConstItem { ident, .. })
4209+
| AssocItemKind::Fn(Fn { ident, .. })
4210+
| AssocItemKind::Type(TyAlias { ident, .. })
4211+
| AssocItemKind::Delegation(Delegation { ident, .. }) => Some(ident),
42124212

42134213
AssocItemKind::MacCall(_) | AssocItemKind::DelegationMac(_) => None,
42144214
}
42154215
}
42164216

42174217
pub fn defaultness(&self) -> Defaultness {
42184218
match *self {
4219-
Self::Const(box ConstItem { defaultness, .. })
4220-
| Self::Fn(box Fn { defaultness, .. })
4221-
| Self::Type(box TyAlias { defaultness, .. }) => defaultness,
4219+
Self::Const(ConstItem { defaultness, .. })
4220+
| Self::Fn(Fn { defaultness, .. })
4221+
| Self::Type(TyAlias { defaultness, .. }) => defaultness,
42224222
Self::MacCall(..) | Self::Delegation(..) | Self::DelegationMac(..) => {
42234223
Defaultness::Implicit
42244224
}
@@ -4271,9 +4271,9 @@ pub enum ForeignItemKind {
42714271
impl ForeignItemKind {
42724272
pub fn ident(&self) -> Option<Ident> {
42734273
match *self {
4274-
ForeignItemKind::Static(box StaticItem { ident, .. })
4275-
| ForeignItemKind::Fn(box Fn { ident, .. })
4276-
| ForeignItemKind::TyAlias(box TyAlias { ident, .. }) => Some(ident),
4274+
ForeignItemKind::Static(StaticItem { ident, .. })
4275+
| ForeignItemKind::Fn(Fn { ident, .. })
4276+
| ForeignItemKind::TyAlias(TyAlias { ident, .. }) => Some(ident),
42774277

42784278
ForeignItemKind::MacCall(_) => None,
42794279
}

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// tidy-alphabetical-start
88
#![doc(test(attr(deny(warnings), allow(internal_features))))]
99
#![feature(associated_type_defaults)]
10-
#![feature(box_patterns)]
10+
#![feature(deref_patterns)]
1111
#![feature(iter_order_by)]
1212
#![feature(macro_metavar_expr)]
1313
#![recursion_limit = "256"]

compiler/rustc_ast/src/util/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub fn contains_exterior_struct_lit(value: &ast::Expr) -> bool {
210210
contains_exterior_struct_lit(x)
211211
}
212212

213-
ast::ExprKind::MethodCall(box ast::MethodCall { receiver, .. }) => {
213+
ast::ExprKind::MethodCall(ast::MethodCall { receiver, .. }) => {
214214
// X { y: 1 }.bar(...)
215215
contains_exterior_struct_lit(receiver)
216216
}

compiler/rustc_ast/src/visit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ macro_rules! common_visitor_and_walkers {
851851
visit_visitable!($($mut)? vis, impl_),
852852
ItemKind::Trait(trait_) =>
853853
visit_visitable!($($mut)? vis, trait_),
854-
ItemKind::TraitAlias(box TraitAlias { constness, ident, generics, bounds}) => {
854+
ItemKind::TraitAlias(TraitAlias { constness, ident, generics, bounds}) => {
855855
visit_visitable!($($mut)? vis, constness, ident, generics);
856856
visit_visitable_with!($($mut)? vis, bounds, BoundKind::Bound)
857857
}
@@ -949,7 +949,7 @@ macro_rules! common_visitor_and_walkers {
949949
impl_walkable!(|&$($mut)? $($lt)? self: Impl, vis: &mut V| {
950950
let Impl { generics, of_trait, self_ty, items, constness: _ } = self;
951951
try_visit!(vis.visit_generics(generics));
952-
if let Some(box of_trait) = of_trait {
952+
if let Some(of_trait) = of_trait {
953953
let TraitImplHeader { defaultness, safety, polarity, trait_ref } = of_trait;
954954
visit_visitable!($($mut)? vis, defaultness, safety, polarity, trait_ref);
955955
}
@@ -1004,7 +1004,7 @@ macro_rules! common_visitor_and_walkers {
10041004
visit_visitable!($($mut)? vis, block, opt_label, span),
10051005
ExprKind::Match(subexpression, arms, kind) =>
10061006
visit_visitable!($($mut)? vis, subexpression, arms, kind),
1007-
ExprKind::Closure(box Closure {
1007+
ExprKind::Closure(Closure {
10081008
binder,
10091009
capture_clause,
10101010
coroutine_kind,

compiler/rustc_ast_lowering/src/delegation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
626626
);
627627

628628
let callee_path = this.arena.alloc(this.mk_expr(hir::ExprKind::Path(path), span));
629-
let args = if let Some(box block) = delegation.body.as_ref() {
629+
let args = if let Some(block) = delegation.body.as_ref() {
630630
this.arena.alloc_slice(&[this.lower_target_expr(block)])
631631
} else {
632632
&mut []

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
118118
hir::ExprKind::Call(f, self.lower_exprs(args))
119119
}
120120
}
121-
ExprKind::MethodCall(box MethodCall { seg, receiver, args, span }) => {
121+
ExprKind::MethodCall(MethodCall { seg, receiver, args, span }) => {
122122
let hir_seg = self.arena.alloc(self.lower_path_segment(
123123
e.span,
124124
seg,
@@ -212,7 +212,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
212212
),
213213
ExprKind::Await(expr, await_kw_span) => self.lower_expr_await(*await_kw_span, expr),
214214
ExprKind::Use(expr, use_kw_span) => self.lower_expr_use(*use_kw_span, expr),
215-
ExprKind::Closure(box Closure {
215+
ExprKind::Closure(Closure {
216216
binder,
217217
capture_clause,
218218
constness,

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
211211
i: &ItemKind,
212212
) -> Vec<hir::Attribute> {
213213
match i {
214-
ItemKind::Fn(box Fn { eii_impls, .. })
215-
| ItemKind::Static(box StaticItem { eii_impls, .. })
214+
ItemKind::Fn(Fn { eii_impls, .. }) | ItemKind::Static(StaticItem { eii_impls, .. })
216215
if eii_impls.is_empty() =>
217216
{
218217
Vec::new()
219218
}
220-
ItemKind::Fn(box Fn { eii_impls, .. })
221-
| ItemKind::Static(box StaticItem { eii_impls, .. }) => {
219+
ItemKind::Fn(Fn { eii_impls, .. }) | ItemKind::Static(StaticItem { eii_impls, .. }) => {
222220
vec![hir::Attribute::Parsed(AttributeKind::EiiImpls(
223221
eii_impls.iter().map(|i| self.lower_eii_impl(i)).collect(),
224222
))]
@@ -298,7 +296,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
298296

299297
self.lower_use_tree(use_tree, &prefix, id, vis_span, attrs)
300298
}
301-
ItemKind::Static(box ast::StaticItem {
299+
ItemKind::Static(ast::StaticItem {
302300
ident,
303301
ty,
304302
safety: _,
@@ -314,7 +312,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
314312
self.lower_define_opaque(hir_id, define_opaque);
315313
hir::ItemKind::Static(*m, ident, ty, body_id)
316314
}
317-
ItemKind::Const(box ConstItem {
315+
ItemKind::Const(ConstItem {
318316
defaultness: _,
319317
ident,
320318
generics,
@@ -352,7 +350,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
352350
self.record_body(&[], body)
353351
}),
354352
),
355-
ItemKind::Fn(box Fn {
353+
ItemKind::Fn(Fn {
356354
sig: FnSig { decl, header, span: fn_sig_span },
357355
ident,
358356
generics,
@@ -419,7 +417,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
419417
self.lower_body(|this| (&[], this.expr(span, hir::ExprKind::InlineAsm(asm))));
420418
hir::ItemKind::GlobalAsm { asm, fake_body }
421419
}
422-
ItemKind::TyAlias(box TyAlias { ident, generics, after_where_clause, ty, .. }) => {
420+
ItemKind::TyAlias(TyAlias { ident, generics, after_where_clause, ty, .. }) => {
423421
// We lower
424422
//
425423
// type Foo = impl Trait
@@ -539,7 +537,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
539537
constness,
540538
})
541539
}
542-
ItemKind::Trait(box Trait {
540+
ItemKind::Trait(Trait {
543541
impl_restriction,
544542
constness,
545543
is_auto,
@@ -580,7 +578,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
580578
items,
581579
}
582580
}
583-
ItemKind::TraitAlias(box TraitAlias { constness, ident, generics, bounds }) => {
581+
ItemKind::TraitAlias(TraitAlias { constness, ident, generics, bounds }) => {
584582
let constness = self.lower_constness(*constness);
585583
let ident = self.lower_ident(*ident);
586584
let (generics, bounds) = self.lower_generics(
@@ -615,7 +613,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
615613
});
616614
hir::ItemKind::Macro(ident, macro_def, macro_kinds)
617615
}
618-
ItemKind::Delegation(box delegation) => {
616+
ItemKind::Delegation(delegation) => {
619617
let delegation_results = self.lower_delegation(delegation, id);
620618
hir::ItemKind::Fn {
621619
sig: delegation_results.sig,
@@ -794,7 +792,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
794792
let attrs =
795793
self.lower_attrs(hir_id, &i.attrs, i.span, Target::from_foreign_item_kind(&i.kind));
796794
let (ident, kind) = match &i.kind {
797-
ForeignItemKind::Fn(box Fn { sig, ident, generics, define_opaque, .. }) => {
795+
ForeignItemKind::Fn(Fn { sig, ident, generics, define_opaque, .. }) => {
798796
let fdec = &sig.decl;
799797
let itctx = ImplTraitContext::Universal;
800798
let (generics, (decl, fn_args)) =
@@ -822,7 +820,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
822820
),
823821
)
824822
}
825-
ForeignItemKind::Static(box StaticItem {
823+
ForeignItemKind::Static(StaticItem {
826824
ident,
827825
ty,
828826
mutability,
@@ -839,9 +837,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
839837
}
840838
(ident, hir::ForeignItemKind::Static(ty, *mutability, safety))
841839
}
842-
ForeignItemKind::TyAlias(box TyAlias { ident, .. }) => {
843-
(ident, hir::ForeignItemKind::Type)
844-
}
840+
ForeignItemKind::TyAlias(TyAlias { ident, .. }) => (ident, hir::ForeignItemKind::Type),
845841
ForeignItemKind::MacCall(_) => panic!("macro shouldn't exist here"),
846842
};
847843

@@ -980,7 +976,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
980976
let trait_item_def_id = hir_id.expect_owner();
981977

982978
let (ident, generics, kind, has_value) = match &i.kind {
983-
AssocItemKind::Const(box ConstItem {
979+
AssocItemKind::Const(ConstItem {
984980
ident,
985981
generics,
986982
ty,
@@ -1020,9 +1016,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10201016

10211017
(*ident, generics, kind, rhs_kind.has_expr())
10221018
}
1023-
AssocItemKind::Fn(box Fn {
1024-
sig, ident, generics, body: None, define_opaque, ..
1025-
}) => {
1019+
AssocItemKind::Fn(Fn { sig, ident, generics, body: None, define_opaque, .. }) => {
10261020
// FIXME(contracts): Deny contract here since it won't apply to
10271021
// any impl method or callees.
10281022
let idents = self.lower_fn_params_to_idents(&sig.decl);
@@ -1047,7 +1041,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10471041
false,
10481042
)
10491043
}
1050-
AssocItemKind::Fn(box Fn {
1044+
AssocItemKind::Fn(Fn {
10511045
sig,
10521046
ident,
10531047
generics,
@@ -1082,7 +1076,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10821076
true,
10831077
)
10841078
}
1085-
AssocItemKind::Type(box TyAlias {
1079+
AssocItemKind::Type(TyAlias {
10861080
ident,
10871081
generics,
10881082
after_where_clause,
@@ -1115,7 +1109,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
11151109
);
11161110
(*ident, generics, kind, ty.is_some())
11171111
}
1118-
AssocItemKind::Delegation(box delegation) => {
1112+
AssocItemKind::Delegation(delegation) => {
11191113
let delegation_results = self.lower_delegation(delegation, i.id);
11201114
let item_kind = hir::TraitItemKind::Fn(
11211115
delegation_results.sig,
@@ -1216,7 +1210,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12161210
);
12171211

12181212
let (ident, (generics, kind)) = match &i.kind {
1219-
AssocItemKind::Const(box ConstItem {
1213+
AssocItemKind::Const(ConstItem {
12201214
ident,
12211215
generics,
12221216
ty,
@@ -1240,14 +1234,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
12401234
},
12411235
),
12421236
),
1243-
AssocItemKind::Fn(box Fn {
1244-
sig,
1245-
ident,
1246-
generics,
1247-
body,
1248-
contract,
1249-
define_opaque,
1250-
..
1237+
AssocItemKind::Fn(Fn {
1238+
sig, ident, generics, body, contract, define_opaque, ..
12511239
}) => {
12521240
let body_id = self.lower_maybe_coroutine_body(
12531241
sig.span,
@@ -1271,9 +1259,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12711259

12721260
(*ident, (generics, hir::ImplItemKind::Fn(sig, body_id)))
12731261
}
1274-
AssocItemKind::Type(box TyAlias {
1275-
ident, generics, after_where_clause, ty, ..
1276-
}) => {
1262+
AssocItemKind::Type(TyAlias { ident, generics, after_where_clause, ty, .. }) => {
12771263
let mut generics = generics.clone();
12781264
add_ty_alias_where_clause(&mut generics, after_where_clause, false);
12791265
(
@@ -1307,7 +1293,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
13071293
),
13081294
)
13091295
}
1310-
AssocItemKind::Delegation(box delegation) => {
1296+
AssocItemKind::Delegation(delegation) => {
13111297
let delegation_results = self.lower_delegation(delegation, i.id);
13121298
(
13131299
delegation.ident,

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
//! in the HIR, especially for multiple identifiers.
3232
3333
// tidy-alphabetical-start
34-
#![feature(box_patterns)]
34+
#![feature(deref_patterns)]
3535
#![recursion_limit = "256"]
3636
// tidy-alphabetical-end
3737

0 commit comments

Comments
 (0)