Skip to content

Commit 4cb3e3f

Browse files
authored
Merge branch 'master' into ad-intrinsic
2 parents b7d7b73 + ec7c026 commit 4cb3e3f

File tree

909 files changed

+14088
-9658
lines changed

Some content is hidden

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

909 files changed

+14088
-9658
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ Sam Radhakrishnan <[email protected]>
597597
Samuel Tardieu <[email protected]>
598598
Santiago Pastorino <[email protected]>
599599
Santiago Pastorino <[email protected]> <[email protected]>
600+
Sasha Pourcelot <[email protected]> Sasha <[email protected]>
600601
Scott McMurray <[email protected]>
601602
602603
Scott Olson <[email protected]> Scott Olson <[email protected]>

Cargo.lock

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,9 @@ dependencies = [
518518

519519
[[package]]
520520
name = "clap"
521-
version = "4.5.41"
521+
version = "4.5.42"
522522
source = "registry+https://github.com/rust-lang/crates.io-index"
523-
checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9"
523+
checksum = "ed87a9d530bb41a67537289bafcac159cb3ee28460e0a4571123d2a778a6a882"
524524
dependencies = [
525525
"clap_builder",
526526
"clap_derive",
@@ -538,9 +538,9 @@ dependencies = [
538538

539539
[[package]]
540540
name = "clap_builder"
541-
version = "4.5.41"
541+
version = "4.5.42"
542542
source = "registry+https://github.com/rust-lang/crates.io-index"
543-
checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d"
543+
checksum = "64f4f3f3c77c94aff3c7e9aac9a2ca1974a5adf392a8bb751e827d6d127ab966"
544544
dependencies = [
545545
"anstream",
546546
"anstyle",
@@ -1171,7 +1171,7 @@ checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"
11711171
dependencies = [
11721172
"libc",
11731173
"option-ext",
1174-
"redox_users 0.5.0",
1174+
"redox_users 0.5.2",
11751175
"windows-sys 0.60.2",
11761176
]
11771177

@@ -2094,9 +2094,9 @@ dependencies = [
20942094

20952095
[[package]]
20962096
name = "jsonpath-rust"
2097-
version = "1.0.3"
2097+
version = "1.0.4"
20982098
source = "registry+https://github.com/rust-lang/crates.io-index"
2099-
checksum = "7d057f8fd19e20c3f14d3663983397155739b6bc1148dc5cd4c4a1a5b3130eb0"
2099+
checksum = "633a7320c4bb672863a3782e89b9094ad70285e097ff6832cddd0ec615beadfa"
21002100
dependencies = [
21012101
"pest",
21022102
"pest_derive",
@@ -2190,7 +2190,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
21902190
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
21912191
dependencies = [
21922192
"cfg-if",
2193-
"windows-targets 0.53.2",
2193+
"windows-targets 0.53.3",
21942194
]
21952195

21962196
[[package]]
@@ -2201,9 +2201,9 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
22012201

22022202
[[package]]
22032203
name = "libredox"
2204-
version = "0.1.6"
2204+
version = "0.1.9"
22052205
source = "registry+https://github.com/rust-lang/crates.io-index"
2206-
checksum = "4488594b9328dee448adb906d8b126d9b7deb7cf5c22161ee591610bb1be83c0"
2206+
checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3"
22072207
dependencies = [
22082208
"bitflags",
22092209
"libc",
@@ -2643,17 +2643,17 @@ dependencies = [
26432643

26442644
[[package]]
26452645
name = "object"
2646-
version = "0.37.1"
2646+
version = "0.37.2"
26472647
source = "registry+https://github.com/rust-lang/crates.io-index"
2648-
checksum = "03fd943161069e1768b4b3d050890ba48730e590f57e56d4aa04e7e090e61b4a"
2648+
checksum = "b3e3d0a7419f081f4a808147e845310313a39f322d7ae1f996b7f001d6cbed04"
26492649
dependencies = [
26502650
"crc32fast",
26512651
"flate2",
26522652
"hashbrown",
26532653
"indexmap",
26542654
"memchr",
26552655
"ruzstd 0.8.1",
2656-
"wasmparser 0.234.0",
2656+
"wasmparser 0.236.0",
26572657
]
26582658

26592659
[[package]]
@@ -3167,9 +3167,9 @@ dependencies = [
31673167

31683168
[[package]]
31693169
name = "redox_syscall"
3170-
version = "0.5.16"
3170+
version = "0.5.17"
31713171
source = "registry+https://github.com/rust-lang/crates.io-index"
3172-
checksum = "7251471db004e509f4e75a62cca9435365b5ec7bcdff530d612ac7c87c44a792"
3172+
checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77"
31733173
dependencies = [
31743174
"bitflags",
31753175
]
@@ -3187,9 +3187,9 @@ dependencies = [
31873187

31883188
[[package]]
31893189
name = "redox_users"
3190-
version = "0.5.0"
3190+
version = "0.5.2"
31913191
source = "registry+https://github.com/rust-lang/crates.io-index"
3192-
checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b"
3192+
checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac"
31933193
dependencies = [
31943194
"getrandom 0.2.16",
31953195
"libredox",
@@ -3279,7 +3279,7 @@ dependencies = [
32793279
"build_helper",
32803280
"gimli 0.32.0",
32813281
"libc",
3282-
"object 0.37.1",
3282+
"object 0.37.2",
32833283
"regex",
32843284
"serde_json",
32853285
"similar",
@@ -3301,9 +3301,9 @@ dependencies = [
33013301

33023302
[[package]]
33033303
name = "rustc-demangle"
3304-
version = "0.1.25"
3304+
version = "0.1.26"
33053305
source = "registry+https://github.com/rust-lang/crates.io-index"
3306-
checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f"
3306+
checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace"
33073307

33083308
[[package]]
33093309
name = "rustc-hash"
@@ -3569,7 +3569,7 @@ dependencies = [
35693569
"itertools",
35703570
"libc",
35713571
"measureme",
3572-
"object 0.37.1",
3572+
"object 0.37.2",
35733573
"rustc-demangle",
35743574
"rustc_abi",
35753575
"rustc_ast",
@@ -3607,7 +3607,7 @@ dependencies = [
36073607
"cc",
36083608
"itertools",
36093609
"libc",
3610-
"object 0.37.1",
3610+
"object 0.37.2",
36113611
"pathdiff",
36123612
"regex",
36133613
"rustc_abi",
@@ -4517,6 +4517,7 @@ name = "rustc_resolve"
45174517
version = "0.0.0"
45184518
dependencies = [
45194519
"bitflags",
4520+
"indexmap",
45204521
"itertools",
45214522
"pulldown-cmark",
45224523
"rustc_arena",
@@ -4640,7 +4641,7 @@ name = "rustc_target"
46404641
version = "0.0.0"
46414642
dependencies = [
46424643
"bitflags",
4643-
"object 0.37.1",
4644+
"object 0.37.2",
46444645
"rustc_abi",
46454646
"rustc_data_structures",
46464647
"rustc_fs_util",
@@ -5037,9 +5038,9 @@ dependencies = [
50375038

50385039
[[package]]
50395040
name = "serde_json"
5040-
version = "1.0.141"
5041+
version = "1.0.142"
50415042
source = "registry+https://github.com/rust-lang/crates.io-index"
5042-
checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3"
5043+
checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7"
50435044
dependencies = [
50445045
"itoa",
50455046
"memchr",
@@ -6097,12 +6098,12 @@ dependencies = [
60976098

60986099
[[package]]
60996100
name = "wasm-encoder"
6100-
version = "0.235.0"
6101+
version = "0.236.0"
61016102
source = "registry+https://github.com/rust-lang/crates.io-index"
6102-
checksum = "b3bc393c395cb621367ff02d854179882b9a351b4e0c93d1397e6090b53a5c2a"
6103+
checksum = "3108979166ab0d3c7262d2e16a2190ffe784b2a5beb963edef154b5e8e07680b"
61036104
dependencies = [
61046105
"leb128fmt",
6105-
"wasmparser 0.235.0",
6106+
"wasmparser 0.236.0",
61066107
]
61076108

61086109
[[package]]
@@ -6142,9 +6143,9 @@ dependencies = [
61426143

61436144
[[package]]
61446145
name = "wasmparser"
6145-
version = "0.235.0"
6146+
version = "0.236.0"
61466147
source = "registry+https://github.com/rust-lang/crates.io-index"
6147-
checksum = "161296c618fa2d63f6ed5fffd1112937e803cb9ec71b32b01a76321555660917"
6148+
checksum = "16d1eee846a705f6f3cb9d7b9f79b54583810f1fb57a1e3aea76d1742db2e3d2"
61486149
dependencies = [
61496150
"bitflags",
61506151
"indexmap",
@@ -6153,22 +6154,22 @@ dependencies = [
61536154

61546155
[[package]]
61556156
name = "wast"
6156-
version = "235.0.0"
6157+
version = "236.0.0"
61576158
source = "registry+https://github.com/rust-lang/crates.io-index"
6158-
checksum = "1eda4293f626c99021bb3a6fbe4fbbe90c0e31a5ace89b5f620af8925de72e13"
6159+
checksum = "11d6b6faeab519ba6fbf9b26add41617ca6f5553f99ebc33d876e591d2f4f3c6"
61596160
dependencies = [
61606161
"bumpalo",
61616162
"leb128fmt",
61626163
"memchr",
61636164
"unicode-width 0.2.1",
6164-
"wasm-encoder 0.235.0",
6165+
"wasm-encoder 0.236.0",
61656166
]
61666167

61676168
[[package]]
61686169
name = "wat"
6169-
version = "1.235.0"
6170+
version = "1.236.0"
61706171
source = "registry+https://github.com/rust-lang/crates.io-index"
6171-
checksum = "e777e0327115793cb96ab220b98f85327ec3d11f34ec9e8d723264522ef206aa"
6172+
checksum = "cc31704322400f461f7f31a5f9190d5488aaeafb63ae69ad2b5888d2704dcb08"
61726173
dependencies = [
61736174
"wast",
61746175
]
@@ -6424,7 +6425,7 @@ version = "0.60.2"
64246425
source = "registry+https://github.com/rust-lang/crates.io-index"
64256426
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
64266427
dependencies = [
6427-
"windows-targets 0.53.2",
6428+
"windows-targets 0.53.3",
64286429
]
64296430

64306431
[[package]]
@@ -6460,10 +6461,11 @@ dependencies = [
64606461

64616462
[[package]]
64626463
name = "windows-targets"
6463-
version = "0.53.2"
6464+
version = "0.53.3"
64646465
source = "registry+https://github.com/rust-lang/crates.io-index"
6465-
checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef"
6466+
checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91"
64666467
dependencies = [
6468+
"windows-link",
64676469
"windows_aarch64_gnullvm 0.53.0",
64686470
"windows_aarch64_msvc 0.53.0",
64696471
"windows_i686_gnu 0.53.0",

compiler/rustc_ast_lowering/src/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
311311
);
312312

313313
self.with_parent(const_arg.hir_id, |this| {
314-
intravisit::walk_ambig_const_arg(this, const_arg);
314+
intravisit::walk_const_arg(this, const_arg);
315315
});
316316
}
317317

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
675675
let bodies = SortedMap::from_presorted_elements(bodies);
676676

677677
// Don't hash unless necessary, because it's expensive.
678-
let (opt_hash_including_bodies, attrs_hash, delayed_lints_hash) =
678+
let rustc_middle::hir::Hashes { opt_hash_including_bodies, attrs_hash, delayed_lints_hash } =
679679
self.tcx.hash_owner_nodes(node, &bodies, &attrs, &delayed_lints, define_opaque);
680680
let num_nodes = self.item_local_id_counter.as_usize();
681681
let (nodes, parenting) = index::index_hir(self.tcx, node, &bodies, num_nodes);

compiler/rustc_ast_passes/messages.ftl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ ast_passes_tilde_const_disallowed = `[const]` is not allowed here
241241
.trait_assoc_ty = associated types in non-`const` traits cannot have `[const]` trait bounds
242242
.trait_impl_assoc_ty = associated types in non-const impls cannot have `[const]` trait bounds
243243
.inherent_assoc_ty = inherent associated types cannot have `[const]` trait bounds
244+
.struct = structs cannot have `[const]` trait bounds
245+
.enum = enums cannot have `[const]` trait bounds
246+
.union = unions cannot have `[const]` trait bounds
247+
.anon_const = anonymous constants cannot have `[const]` trait bounds
244248
.object = trait objects cannot have `[const]` trait bounds
245249
.item = this item cannot have `[const]` trait bounds
246250

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,9 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
11241124
);
11251125
}
11261126
}
1127-
visit::walk_item(self, item)
1127+
self.with_tilde_const(Some(TildeConstReason::Enum { span: item.span }), |this| {
1128+
visit::walk_item(this, item)
1129+
});
11281130
}
11291131
ItemKind::Trait(box Trait {
11301132
constness,
@@ -1175,26 +1177,32 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
11751177
}
11761178
visit::walk_item(self, item)
11771179
}
1178-
ItemKind::Struct(ident, generics, vdata) => match vdata {
1179-
VariantData::Struct { fields, .. } => {
1180-
self.visit_attrs_vis_ident(&item.attrs, &item.vis, ident);
1181-
self.visit_generics(generics);
1182-
walk_list!(self, visit_field_def, fields);
1183-
}
1184-
_ => visit::walk_item(self, item),
1185-
},
1180+
ItemKind::Struct(ident, generics, vdata) => {
1181+
self.with_tilde_const(Some(TildeConstReason::Struct { span: item.span }), |this| {
1182+
match vdata {
1183+
VariantData::Struct { fields, .. } => {
1184+
this.visit_attrs_vis_ident(&item.attrs, &item.vis, ident);
1185+
this.visit_generics(generics);
1186+
walk_list!(this, visit_field_def, fields);
1187+
}
1188+
_ => visit::walk_item(this, item),
1189+
}
1190+
})
1191+
}
11861192
ItemKind::Union(ident, generics, vdata) => {
11871193
if vdata.fields().is_empty() {
11881194
self.dcx().emit_err(errors::FieldlessUnion { span: item.span });
11891195
}
1190-
match vdata {
1191-
VariantData::Struct { fields, .. } => {
1192-
self.visit_attrs_vis_ident(&item.attrs, &item.vis, ident);
1193-
self.visit_generics(generics);
1194-
walk_list!(self, visit_field_def, fields);
1196+
self.with_tilde_const(Some(TildeConstReason::Union { span: item.span }), |this| {
1197+
match vdata {
1198+
VariantData::Struct { fields, .. } => {
1199+
this.visit_attrs_vis_ident(&item.attrs, &item.vis, ident);
1200+
this.visit_generics(generics);
1201+
walk_list!(this, visit_field_def, fields);
1202+
}
1203+
_ => visit::walk_item(this, item),
11951204
}
1196-
_ => visit::walk_item(self, item),
1197-
}
1205+
});
11981206
}
11991207
ItemKind::Const(box ConstItem { defaultness, expr, .. }) => {
12001208
self.check_defaultness(item.span, *defaultness);
@@ -1623,6 +1631,13 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
16231631
_ => self.with_in_trait_impl(None, |this| visit::walk_assoc_item(this, item, ctxt)),
16241632
}
16251633
}
1634+
1635+
fn visit_anon_const(&mut self, anon_const: &'a AnonConst) {
1636+
self.with_tilde_const(
1637+
Some(TildeConstReason::AnonConst { span: anon_const.value.span }),
1638+
|this| visit::walk_anon_const(this, anon_const),
1639+
)
1640+
}
16261641
}
16271642

16281643
/// When encountering an equality constraint in a `where` clause, emit an error. If the code seems

compiler/rustc_ast_passes/src/errors.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,26 @@ pub(crate) enum TildeConstReason {
623623
#[primary_span]
624624
span: Span,
625625
},
626+
#[note(ast_passes_struct)]
627+
Struct {
628+
#[primary_span]
629+
span: Span,
630+
},
631+
#[note(ast_passes_enum)]
632+
Enum {
633+
#[primary_span]
634+
span: Span,
635+
},
636+
#[note(ast_passes_union)]
637+
Union {
638+
#[primary_span]
639+
span: Span,
640+
},
641+
#[note(ast_passes_anon_const)]
642+
AnonConst {
643+
#[primary_span]
644+
span: Span,
645+
},
626646
#[note(ast_passes_object)]
627647
TraitObject,
628648
#[note(ast_passes_item)]

0 commit comments

Comments
 (0)