Skip to content

Commit c48c2e9

Browse files
committed
Auto merge of #126053 - matthiaskrgr:rollup-bky19ty, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #124731 (Add translation support by mdbook-i18n-helpers to bootstrap) - #125168 (Match ergonomics 2024: align implementation with RFC) - #125925 (Don't trigger `unsafe_op_in_unsafe_fn` for deprecated safe fns) - #125966 (Implement `os_string_pathbuf_leak`) - #125987 (When `derive`ing, account for HRTB on `BareFn` fields) - #126045 (check_expr_struct_fields: taint context with errors if struct definit…) - #126048 (Fix typos in cargo-specifics.md) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 72fdf91 + 563a419 commit c48c2e9

Some content is hidden

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

42 files changed

+709
-425
lines changed

Cargo.lock

+143-5
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
372372
checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05"
373373
dependencies = [
374374
"memchr",
375-
"regex-automata 0.3.9",
375+
"regex-automata 0.3.7",
376376
"serde",
377377
]
378378

@@ -2206,6 +2206,21 @@ dependencies = [
22062206
"vcpkg",
22072207
]
22082208

2209+
[[package]]
2210+
name = "line-wrap"
2211+
version = "0.2.0"
2212+
source = "registry+https://github.com/rust-lang/crates.io-index"
2213+
checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e"
2214+
2215+
[[package]]
2216+
name = "linereader"
2217+
version = "0.4.0"
2218+
source = "registry+https://github.com/rust-lang/crates.io-index"
2219+
checksum = "d921fea6860357575519aca014c6e22470585accdd543b370c404a8a72d0dd1d"
2220+
dependencies = [
2221+
"memchr",
2222+
]
2223+
22092224
[[package]]
22102225
name = "linkchecker"
22112226
version = "0.1.0"
@@ -2214,6 +2229,12 @@ dependencies = [
22142229
"regex",
22152230
]
22162231

2232+
[[package]]
2233+
name = "linked-hash-map"
2234+
version = "0.5.6"
2235+
source = "registry+https://github.com/rust-lang/crates.io-index"
2236+
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
2237+
22172238
[[package]]
22182239
name = "lint-docs"
22192240
version = "0.1.0"
@@ -2364,6 +2385,25 @@ dependencies = [
23642385
"topological-sort",
23652386
]
23662387

2388+
[[package]]
2389+
name = "mdbook-i18n-helpers"
2390+
version = "0.3.3"
2391+
source = "registry+https://github.com/rust-lang/crates.io-index"
2392+
checksum = "f1f71f5961d6f3376e1ff3e5989c2e3ecccc3e8a00f3a3acde446847f84852e4"
2393+
dependencies = [
2394+
"anyhow",
2395+
"chrono",
2396+
"mdbook",
2397+
"polib",
2398+
"pulldown-cmark 0.10.3",
2399+
"pulldown-cmark-to-cmark",
2400+
"regex",
2401+
"semver",
2402+
"serde_json",
2403+
"syntect",
2404+
"textwrap",
2405+
]
2406+
23672407
[[package]]
23682408
name = "mdbook-trpl-listing"
23692409
version = "0.1.0"
@@ -2650,6 +2690,28 @@ version = "1.19.0"
26502690
source = "registry+https://github.com/rust-lang/crates.io-index"
26512691
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
26522692

2693+
[[package]]
2694+
name = "onig"
2695+
version = "6.4.0"
2696+
source = "registry+https://github.com/rust-lang/crates.io-index"
2697+
checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f"
2698+
dependencies = [
2699+
"bitflags 1.3.2",
2700+
"libc",
2701+
"once_cell",
2702+
"onig_sys",
2703+
]
2704+
2705+
[[package]]
2706+
name = "onig_sys"
2707+
version = "69.8.1"
2708+
source = "registry+https://github.com/rust-lang/crates.io-index"
2709+
checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7"
2710+
dependencies = [
2711+
"cc",
2712+
"pkg-config",
2713+
]
2714+
26532715
[[package]]
26542716
name = "opener"
26552717
version = "0.6.1"
@@ -2968,6 +3030,29 @@ version = "0.3.30"
29683030
source = "registry+https://github.com/rust-lang/crates.io-index"
29693031
checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
29703032

3033+
[[package]]
3034+
name = "plist"
3035+
version = "1.6.1"
3036+
source = "registry+https://github.com/rust-lang/crates.io-index"
3037+
checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9"
3038+
dependencies = [
3039+
"base64",
3040+
"indexmap",
3041+
"line-wrap",
3042+
"quick-xml",
3043+
"serde",
3044+
"time",
3045+
]
3046+
3047+
[[package]]
3048+
name = "polib"
3049+
version = "0.2.0"
3050+
source = "registry+https://github.com/rust-lang/crates.io-index"
3051+
checksum = "6b393b155cf9be86249cba1b56cc81be0e6212c66d94ac0d76d37a1761f3bb1b"
3052+
dependencies = [
3053+
"linereader",
3054+
]
3055+
29713056
[[package]]
29723057
name = "polonius-engine"
29733058
version = "0.13.0"
@@ -3126,6 +3211,15 @@ version = "0.4.1"
31263211
source = "registry+https://github.com/rust-lang/crates.io-index"
31273212
checksum = "e9e1dcb320d6839f6edb64f7a4a59d39b30480d4d1765b56873f7c858538a5fe"
31283213

3214+
[[package]]
3215+
name = "quick-xml"
3216+
version = "0.31.0"
3217+
source = "registry+https://github.com/rust-lang/crates.io-index"
3218+
checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33"
3219+
dependencies = [
3220+
"memchr",
3221+
]
3222+
31293223
[[package]]
31303224
name = "quine-mc_cluskey"
31313225
version = "0.2.4"
@@ -3261,12 +3355,13 @@ dependencies = [
32613355

32623356
[[package]]
32633357
name = "regex"
3264-
version = "1.8.4"
3358+
version = "1.9.4"
32653359
source = "registry+https://github.com/rust-lang/crates.io-index"
3266-
checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f"
3360+
checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29"
32673361
dependencies = [
32683362
"aho-corasick",
32693363
"memchr",
3364+
"regex-automata 0.3.7",
32703365
"regex-syntax 0.7.5",
32713366
]
32723367

@@ -3290,9 +3385,14 @@ dependencies = [
32903385

32913386
[[package]]
32923387
name = "regex-automata"
3293-
version = "0.3.9"
3388+
version = "0.3.7"
32943389
source = "registry+https://github.com/rust-lang/crates.io-index"
3295-
checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9"
3390+
checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629"
3391+
dependencies = [
3392+
"aho-corasick",
3393+
"memchr",
3394+
"regex-syntax 0.7.5",
3395+
]
32963396

32973397
[[package]]
32983398
name = "regex-lite"
@@ -3367,6 +3467,7 @@ dependencies = [
33673467
"clap",
33683468
"env_logger",
33693469
"mdbook",
3470+
"mdbook-i18n-helpers",
33703471
"mdbook-trpl-listing",
33713472
"mdbook-trpl-note",
33723473
]
@@ -5372,6 +5473,28 @@ dependencies = [
53725473
"syn 2.0.64",
53735474
]
53745475

5476+
[[package]]
5477+
name = "syntect"
5478+
version = "5.2.0"
5479+
source = "registry+https://github.com/rust-lang/crates.io-index"
5480+
checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1"
5481+
dependencies = [
5482+
"bincode",
5483+
"bitflags 1.3.2",
5484+
"flate2",
5485+
"fnv",
5486+
"once_cell",
5487+
"onig",
5488+
"plist",
5489+
"regex-syntax 0.8.3",
5490+
"serde",
5491+
"serde_derive",
5492+
"serde_json",
5493+
"thiserror",
5494+
"walkdir",
5495+
"yaml-rust",
5496+
]
5497+
53755498
[[package]]
53765499
name = "sysinfo"
53775500
version = "0.30.12"
@@ -5497,6 +5620,12 @@ dependencies = [
54975620
"std",
54985621
]
54995622

5623+
[[package]]
5624+
name = "textwrap"
5625+
version = "0.16.1"
5626+
source = "registry+https://github.com/rust-lang/crates.io-index"
5627+
checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
5628+
55005629
[[package]]
55015630
name = "thin-vec"
55025631
version = "0.2.13"
@@ -6476,6 +6605,15 @@ dependencies = [
64766605
"lzma-sys",
64776606
]
64786607

6608+
[[package]]
6609+
name = "yaml-rust"
6610+
version = "0.4.5"
6611+
source = "registry+https://github.com/rust-lang/crates.io-index"
6612+
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
6613+
dependencies = [
6614+
"linked-hash-map",
6615+
]
6616+
64796617
[[package]]
64806618
name = "yansi-term"
64816619
version = "0.1.2"

compiler/rustc_builtin_macros/src/deriving/generic/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,15 @@ fn find_type_parameters(
412412

413413
impl<'a, 'b> visit::Visitor<'a> for Visitor<'a, 'b> {
414414
fn visit_ty(&mut self, ty: &'a ast::Ty) {
415+
let stack_len = self.bound_generic_params_stack.len();
416+
if let ast::TyKind::BareFn(bare_fn) = &ty.kind
417+
&& !bare_fn.generic_params.is_empty()
418+
{
419+
// Given a field `x: for<'a> fn(T::SomeType<'a>)`, we wan't to account for `'a` so
420+
// that we generate `where for<'a> T::SomeType<'a>: ::core::clone::Clone`. #122622
421+
self.bound_generic_params_stack.extend(bare_fn.generic_params.iter().cloned());
422+
}
423+
415424
if let ast::TyKind::Path(_, path) = &ty.kind
416425
&& let Some(segment) = path.segments.first()
417426
&& self.ty_param_names.contains(&segment.ident.name)
@@ -422,7 +431,8 @@ fn find_type_parameters(
422431
});
423432
}
424433

425-
visit::walk_ty(self, ty)
434+
visit::walk_ty(self, ty);
435+
self.bound_generic_params_stack.truncate(stack_len);
426436
}
427437

428438
// Place bound generic params on a stack, to extract them when a type is encountered.

compiler/rustc_feature/src/removed.rs

+3
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ declare_features! (
128128
/// Allows the use of type alias impl trait in function return positions
129129
(removed, min_type_alias_impl_trait, "1.56.0", Some(63063),
130130
Some("removed in favor of full type_alias_impl_trait")),
131+
/// Make `mut` not reset the binding mode on edition >= 2024.
132+
(removed, mut_preserve_binding_mode_2024, "1.79.0", Some(123076), Some("superseded by `ref_pat_eat_one_layer_2024`")),
131133
(removed, needs_allocator, "1.4.0", Some(27389),
132134
Some("subsumed by `#![feature(allocator_internals)]`")),
133135
/// Allows use of unary negate on unsigned integers, e.g., -e for e: u8
@@ -181,6 +183,7 @@ declare_features! (
181183
(removed, pushpop_unsafe, "1.2.0", None, None),
182184
(removed, quad_precision_float, "1.0.0", None, None),
183185
(removed, quote, "1.33.0", Some(29601), None),
186+
(removed, ref_pat_everywhere, "1.79.0", Some(123076), Some("superseded by `ref_pat_eat_one_layer_2024")),
184187
(removed, reflect, "1.0.0", Some(27749), None),
185188
/// Allows using the `#[register_attr]` attribute.
186189
(removed, register_attr, "1.65.0", Some(66080),

compiler/rustc_feature/src/unstable.rs

-4
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,6 @@ declare_features! (
529529
(unstable, more_qualified_paths, "1.54.0", Some(86935)),
530530
/// Allows the `#[must_not_suspend]` attribute.
531531
(unstable, must_not_suspend, "1.57.0", Some(83310)),
532-
/// Make `mut` not reset the binding mode on edition >= 2024.
533-
(incomplete, mut_preserve_binding_mode_2024, "1.79.0", Some(123076)),
534532
/// Allows `mut ref` and `mut ref mut` identifier patterns.
535533
(incomplete, mut_ref, "1.79.0", Some(123076)),
536534
/// Allows using `#[naked]` on functions.
@@ -573,8 +571,6 @@ declare_features! (
573571
(unstable, raw_ref_op, "1.41.0", Some(64490)),
574572
/// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024.
575573
(incomplete, ref_pat_eat_one_layer_2024, "1.79.0", Some(123076)),
576-
/// Allows `&` and `&mut` patterns to consume match-ergonomics-inserted references.
577-
(incomplete, ref_pat_everywhere, "1.79.0", Some(123076)),
578574
/// Allows using the `#[register_tool]` attribute.
579575
(unstable, register_tool, "1.41.0", Some(66079)),
580576
/// Allows the `#[repr(i128)]` attribute for enums.

compiler/rustc_hir_typeck/src/expr.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16711671

16721672
let mut error_happened = false;
16731673

1674+
if variant.fields.len() != remaining_fields.len() {
1675+
// Some field is defined more than once. Make sure we don't try to
1676+
// instantiate this struct in static/const context.
1677+
let guar =
1678+
self.dcx().span_delayed_bug(expr.span, "struct fields have non-unique names");
1679+
self.set_tainted_by_errors(guar);
1680+
error_happened = true;
1681+
}
1682+
16741683
// Type-check each field.
16751684
for (idx, field) in hir_fields.iter().enumerate() {
16761685
let ident = tcx.adjust_ident(field.ident, variant.def_id);

0 commit comments

Comments
 (0)