Skip to content

Commit

Permalink
Auto merge of rust-lang#126056 - matthiaskrgr:rollup-ytwg62v, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#124731 (Add translation support by mdbook-i18n-helpers to bootstrap)
 - rust-lang#125168 (Match ergonomics 2024: align implementation with RFC)
 - rust-lang#125925 (Don't trigger `unsafe_op_in_unsafe_fn` for deprecated safe fns)
 - rust-lang#125987 (When `derive`ing, account for HRTB on `BareFn` fields)
 - rust-lang#126045 (check_expr_struct_fields: taint context with errors if struct definit…)
 - rust-lang#126048 (Fix typos in cargo-specifics.md)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jun 6, 2024
2 parents 003a902 + 51a7002 commit 2b6a342
Show file tree
Hide file tree
Showing 35 changed files with 642 additions and 425 deletions.
148 changes: 143 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05"
dependencies = [
"memchr",
"regex-automata 0.3.9",
"regex-automata 0.3.7",
"serde",
]

Expand Down Expand Up @@ -2206,6 +2206,21 @@ dependencies = [
"vcpkg",
]

[[package]]
name = "line-wrap"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e"

[[package]]
name = "linereader"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d921fea6860357575519aca014c6e22470585accdd543b370c404a8a72d0dd1d"
dependencies = [
"memchr",
]

[[package]]
name = "linkchecker"
version = "0.1.0"
Expand All @@ -2214,6 +2229,12 @@ dependencies = [
"regex",
]

[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"

[[package]]
name = "lint-docs"
version = "0.1.0"
Expand Down Expand Up @@ -2364,6 +2385,25 @@ dependencies = [
"topological-sort",
]

[[package]]
name = "mdbook-i18n-helpers"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1f71f5961d6f3376e1ff3e5989c2e3ecccc3e8a00f3a3acde446847f84852e4"
dependencies = [
"anyhow",
"chrono",
"mdbook",
"polib",
"pulldown-cmark 0.10.3",
"pulldown-cmark-to-cmark",
"regex",
"semver",
"serde_json",
"syntect",
"textwrap",
]

[[package]]
name = "mdbook-trpl-listing"
version = "0.1.0"
Expand Down Expand Up @@ -2650,6 +2690,28 @@ version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"

[[package]]
name = "onig"
version = "6.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f"
dependencies = [
"bitflags 1.3.2",
"libc",
"once_cell",
"onig_sys",
]

[[package]]
name = "onig_sys"
version = "69.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7"
dependencies = [
"cc",
"pkg-config",
]

[[package]]
name = "opener"
version = "0.6.1"
Expand Down Expand Up @@ -2968,6 +3030,29 @@ version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"

[[package]]
name = "plist"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9"
dependencies = [
"base64",
"indexmap",
"line-wrap",
"quick-xml",
"serde",
"time",
]

[[package]]
name = "polib"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b393b155cf9be86249cba1b56cc81be0e6212c66d94ac0d76d37a1761f3bb1b"
dependencies = [
"linereader",
]

[[package]]
name = "polonius-engine"
version = "0.13.0"
Expand Down Expand Up @@ -3126,6 +3211,15 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9e1dcb320d6839f6edb64f7a4a59d39b30480d4d1765b56873f7c858538a5fe"

[[package]]
name = "quick-xml"
version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33"
dependencies = [
"memchr",
]

[[package]]
name = "quine-mc_cluskey"
version = "0.2.4"
Expand Down Expand Up @@ -3261,12 +3355,13 @@ dependencies = [

[[package]]
name = "regex"
version = "1.8.4"
version = "1.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f"
checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata 0.3.7",
"regex-syntax 0.7.5",
]

Expand All @@ -3290,9 +3385,14 @@ dependencies = [

[[package]]
name = "regex-automata"
version = "0.3.9"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9"
checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax 0.7.5",
]

[[package]]
name = "regex-lite"
Expand Down Expand Up @@ -3367,6 +3467,7 @@ dependencies = [
"clap",
"env_logger",
"mdbook",
"mdbook-i18n-helpers",
"mdbook-trpl-listing",
"mdbook-trpl-note",
]
Expand Down Expand Up @@ -5372,6 +5473,28 @@ dependencies = [
"syn 2.0.64",
]

[[package]]
name = "syntect"
version = "5.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1"
dependencies = [
"bincode",
"bitflags 1.3.2",
"flate2",
"fnv",
"once_cell",
"onig",
"plist",
"regex-syntax 0.8.3",
"serde",
"serde_derive",
"serde_json",
"thiserror",
"walkdir",
"yaml-rust",
]

[[package]]
name = "sysinfo"
version = "0.30.12"
Expand Down Expand Up @@ -5497,6 +5620,12 @@ dependencies = [
"std",
]

[[package]]
name = "textwrap"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"

[[package]]
name = "thin-vec"
version = "0.2.13"
Expand Down Expand Up @@ -6476,6 +6605,15 @@ dependencies = [
"lzma-sys",
]

[[package]]
name = "yaml-rust"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
dependencies = [
"linked-hash-map",
]

[[package]]
name = "yansi-term"
version = "0.1.2"
Expand Down
12 changes: 11 additions & 1 deletion compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,15 @@ fn find_type_parameters(

impl<'a, 'b> visit::Visitor<'a> for Visitor<'a, 'b> {
fn visit_ty(&mut self, ty: &'a ast::Ty) {
let stack_len = self.bound_generic_params_stack.len();
if let ast::TyKind::BareFn(bare_fn) = &ty.kind
&& !bare_fn.generic_params.is_empty()
{
// Given a field `x: for<'a> fn(T::SomeType<'a>)`, we wan't to account for `'a` so
// that we generate `where for<'a> T::SomeType<'a>: ::core::clone::Clone`. #122622
self.bound_generic_params_stack.extend(bare_fn.generic_params.iter().cloned());
}

if let ast::TyKind::Path(_, path) = &ty.kind
&& let Some(segment) = path.segments.first()
&& self.ty_param_names.contains(&segment.ident.name)
Expand All @@ -422,7 +431,8 @@ fn find_type_parameters(
});
}

visit::walk_ty(self, ty)
visit::walk_ty(self, ty);
self.bound_generic_params_stack.truncate(stack_len);
}

// Place bound generic params on a stack, to extract them when a type is encountered.
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_feature/src/removed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ declare_features! (
/// Allows the use of type alias impl trait in function return positions
(removed, min_type_alias_impl_trait, "1.56.0", Some(63063),
Some("removed in favor of full type_alias_impl_trait")),
/// Make `mut` not reset the binding mode on edition >= 2024.
(removed, mut_preserve_binding_mode_2024, "1.79.0", Some(123076), Some("superseded by `ref_pat_eat_one_layer_2024`")),
(removed, needs_allocator, "1.4.0", Some(27389),
Some("subsumed by `#![feature(allocator_internals)]`")),
/// Allows use of unary negate on unsigned integers, e.g., -e for e: u8
Expand Down Expand Up @@ -181,6 +183,7 @@ declare_features! (
(removed, pushpop_unsafe, "1.2.0", None, None),
(removed, quad_precision_float, "1.0.0", None, None),
(removed, quote, "1.33.0", Some(29601), None),
(removed, ref_pat_everywhere, "1.79.0", Some(123076), Some("superseded by `ref_pat_eat_one_layer_2024")),
(removed, reflect, "1.0.0", Some(27749), None),
/// Allows using the `#[register_attr]` attribute.
(removed, register_attr, "1.65.0", Some(66080),
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,6 @@ declare_features! (
(unstable, more_qualified_paths, "1.54.0", Some(86935)),
/// Allows the `#[must_not_suspend]` attribute.
(unstable, must_not_suspend, "1.57.0", Some(83310)),
/// Make `mut` not reset the binding mode on edition >= 2024.
(incomplete, mut_preserve_binding_mode_2024, "1.79.0", Some(123076)),
/// Allows `mut ref` and `mut ref mut` identifier patterns.
(incomplete, mut_ref, "1.79.0", Some(123076)),
/// Allows using `#[naked]` on functions.
Expand Down Expand Up @@ -573,8 +571,6 @@ declare_features! (
(unstable, raw_ref_op, "1.41.0", Some(64490)),
/// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024.
(incomplete, ref_pat_eat_one_layer_2024, "1.79.0", Some(123076)),
/// Allows `&` and `&mut` patterns to consume match-ergonomics-inserted references.
(incomplete, ref_pat_everywhere, "1.79.0", Some(123076)),
/// Allows using the `#[register_tool]` attribute.
(unstable, register_tool, "1.41.0", Some(66079)),
/// Allows the `#[repr(i128)]` attribute for enums.
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_hir_typeck/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1671,6 +1671,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

let mut error_happened = false;

if variant.fields.len() != remaining_fields.len() {
// Some field is defined more than once. Make sure we don't try to
// instantiate this struct in static/const context.
let guar =
self.dcx().span_delayed_bug(expr.span, "struct fields have non-unique names");
self.set_tainted_by_errors(guar);
error_happened = true;
}

// Type-check each field.
for (idx, field) in hir_fields.iter().enumerate() {
let ident = tcx.adjust_ident(field.ident, variant.def_id);
Expand Down
Loading

0 comments on commit 2b6a342

Please sign in to comment.