Skip to content

Commit 41f2b6b

Browse files
committed
Auto merge of rust-lang#145978 - Zalathar:rollup-0dzk72g, r=Zalathar
Rollup of 9 pull requests Successful merges: - rust-lang#143713 (Add a mailmap entry for gnzlbg) - rust-lang#144275 (implement Sum and Product for Saturating(u*)) - rust-lang#144354 (fix(std): Fix undefined reference to __my_thread_exit on QNX 8.0) - rust-lang#145387 (Remove TmpLayout in layout_of_enum) - rust-lang#145793 (std library: use execinfo library also on NetBSD.) - rust-lang#145884 (Test `instrument-mcount` codegen) - rust-lang#145947 (Add more to the `[workspace.dependencies]` section in the top-level `Cargo.toml`) - rust-lang#145972 (fix `core::marker::Destruct` doc) - rust-lang#145977 (tests: Ignore basic-stepping.rs on riscv64) r? `@ghost` `@rustbot` modify labels: rollup
2 parents ef8d1d6 + 31eafaf commit 41f2b6b

File tree

57 files changed

+231
-118
lines changed

Some content is hidden

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

57 files changed

+231
-118
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ Guillaume Gomez <[email protected]>
255255
Guillaume Gomez <[email protected]> ggomez <[email protected]>
256256
Guillaume Gomez <[email protected]> Guillaume Gomez <[email protected]>
257257
Guillaume Gomez <[email protected]> Guillaume Gomez <[email protected]>
258+
258259
hamidreza kalbasi <[email protected]>
259260
260261

Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,26 @@ exclude = [
6262
[workspace.dependencies]
6363
# tidy-alphabetical-start
6464
bitflags = "2.9.3"
65+
derive-where = "1.6.0"
66+
either = "1.15.0"
67+
indexmap = "2.10.0"
6568
itertools = "0.12.1"
69+
# FIXME: Remove this pin once this rustix issue is resolved
70+
# https://github.com/bytecodealliance/rustix/issues/1496
71+
libc = "=0.2.174"
72+
measureme = "12.0.3"
6673
memchr = "2.7.5"
74+
odht = { version = "0.3.1", features = ["nightly"] }
75+
polonius-engine = "0.13.0"
76+
proc-macro2 = "1.0.101"
77+
quote = "1.0.40"
78+
rustc-demangle = "0.1.26"
79+
rustc-hash = "2.1.1"
6780
rustc-literal-escaper = "0.0.5"
81+
rustc_apfloat = "0.2.3"
82+
scoped-tls = "1.0.1"
83+
serde_json = "1.0.142"
84+
tempfile = "3.20.0"
6885
thin-vec = "0.2.14"
6986
tracing = "0.1.37"
7087
# tidy-alphabetical-end

compiler/rustc_abi/src/layout.rs

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -594,23 +594,13 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
594594
discr_range_of_repr: impl Fn(i128, i128) -> (Integer, bool),
595595
discriminants: impl Iterator<Item = (VariantIdx, i128)>,
596596
) -> LayoutCalculatorResult<FieldIdx, VariantIdx, F> {
597-
// Until we've decided whether to use the tagged or
598-
// niche filling LayoutData, we don't want to intern the
599-
// variant layouts, so we can't store them in the
600-
// overall LayoutData. Store the overall LayoutData
601-
// and the variant LayoutDatas here until then.
602-
struct TmpLayout<FieldIdx: Idx, VariantIdx: Idx> {
603-
layout: LayoutData<FieldIdx, VariantIdx>,
604-
variants: IndexVec<VariantIdx, LayoutData<FieldIdx, VariantIdx>>,
605-
}
606-
607597
let dl = self.cx.data_layout();
608598
// bail if the enum has an incoherent repr that cannot be computed
609599
if repr.packed() {
610600
return Err(LayoutCalculatorError::ReprConflict);
611601
}
612602

613-
let calculate_niche_filling_layout = || -> Option<TmpLayout<FieldIdx, VariantIdx>> {
603+
let calculate_niche_filling_layout = || -> Option<LayoutData<FieldIdx, VariantIdx>> {
614604
if repr.inhibit_enum_layout_opt() {
615605
return None;
616606
}
@@ -746,7 +736,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
746736
niche_start,
747737
},
748738
tag_field: FieldIdx::new(0),
749-
variants: IndexVec::new(),
739+
variants: variant_layouts,
750740
},
751741
fields: FieldsShape::Arbitrary {
752742
offsets: [niche_offset].into(),
@@ -762,7 +752,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
762752
randomization_seed: combined_seed,
763753
};
764754

765-
Some(TmpLayout { layout, variants: variant_layouts })
755+
Some(layout)
766756
};
767757

768758
let niche_filling_layout = calculate_niche_filling_layout();
@@ -1093,7 +1083,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
10931083
tag,
10941084
tag_encoding: TagEncoding::Direct,
10951085
tag_field: FieldIdx::new(0),
1096-
variants: IndexVec::new(),
1086+
variants: layout_variants,
10971087
},
10981088
fields: FieldsShape::Arbitrary {
10991089
offsets: [Size::ZERO].into(),
@@ -1109,18 +1099,16 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
11091099
randomization_seed: combined_seed,
11101100
};
11111101

1112-
let tagged_layout = TmpLayout { layout: tagged_layout, variants: layout_variants };
1113-
1114-
let mut best_layout = match (tagged_layout, niche_filling_layout) {
1102+
let best_layout = match (tagged_layout, niche_filling_layout) {
11151103
(tl, Some(nl)) => {
11161104
// Pick the smaller layout; otherwise,
11171105
// pick the layout with the larger niche; otherwise,
11181106
// pick tagged as it has simpler codegen.
11191107
use cmp::Ordering::*;
1120-
let niche_size = |tmp_l: &TmpLayout<FieldIdx, VariantIdx>| {
1121-
tmp_l.layout.largest_niche.map_or(0, |n| n.available(dl))
1108+
let niche_size = |l: &LayoutData<FieldIdx, VariantIdx>| {
1109+
l.largest_niche.map_or(0, |n| n.available(dl))
11221110
};
1123-
match (tl.layout.size.cmp(&nl.layout.size), niche_size(&tl).cmp(&niche_size(&nl))) {
1111+
match (tl.size.cmp(&nl.size), niche_size(&tl).cmp(&niche_size(&nl))) {
11241112
(Greater, _) => nl,
11251113
(Equal, Less) => nl,
11261114
_ => tl,
@@ -1129,16 +1117,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
11291117
(tl, None) => tl,
11301118
};
11311119

1132-
// Now we can intern the variant layouts and store them in the enum layout.
1133-
best_layout.layout.variants = match best_layout.layout.variants {
1134-
Variants::Multiple { tag, tag_encoding, tag_field, .. } => {
1135-
Variants::Multiple { tag, tag_encoding, tag_field, variants: best_layout.variants }
1136-
}
1137-
Variants::Single { .. } | Variants::Empty => {
1138-
panic!("encountered a single-variant or empty enum during multi-variant layout")
1139-
}
1140-
};
1141-
Ok(best_layout.layout)
1120+
Ok(best_layout)
11421121
}
11431122

11441123
fn univariant_biased<

compiler/rustc_ast/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ rustc_serialize = { path = "../rustc_serialize" }
1616
rustc_span = { path = "../rustc_span" }
1717
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
1818
thin-vec.workspace = true
19-
tracing = "0.1"
19+
tracing.workspace = true
2020
# tidy-alphabetical-end

compiler/rustc_borrowck/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
either = "1.5.0"
8+
either.workspace = true
99
itertools.workspace = true
10-
polonius-engine = "0.13.0"
10+
polonius-engine.workspace = true
1111
rustc_abi = { path = "../rustc_abi" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }
1313
rustc_errors = { path = "../rustc_errors" }

compiler/rustc_codegen_llvm/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ bitflags.workspace = true
1313
# by `rustc_codegen_ssa` via its `thorin-dwp` dependency.
1414
gimli = "0.31"
1515
itertools.workspace = true
16-
libc = "0.2"
17-
measureme = "12.0.1"
16+
libc.workspace = true
17+
measureme.workspace = true
1818
object = { version = "0.37.0", default-features = false, features = ["std", "read"] }
19-
rustc-demangle = "0.1.21"
19+
rustc-demangle.workspace = true
2020
rustc_abi = { path = "../rustc_abi" }
2121
rustc_ast = { path = "../rustc_ast" }
2222
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
@@ -38,7 +38,7 @@ rustc_span = { path = "../rustc_span" }
3838
rustc_symbol_mangling = { path = "../rustc_symbol_mangling" }
3939
rustc_target = { path = "../rustc_target" }
4040
serde = { version = "1", features = ["derive"] }
41-
serde_json = "1"
41+
serde_json.workspace = true
4242
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
4343
tracing.workspace = true
4444
# tidy-alphabetical-end

compiler/rustc_codegen_ssa/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ rustc_span = { path = "../rustc_span" }
3737
rustc_symbol_mangling = { path = "../rustc_symbol_mangling" }
3838
rustc_target = { path = "../rustc_target" }
3939
rustc_trait_selection = { path = "../rustc_trait_selection" }
40-
serde_json = "1.0.59"
40+
serde_json.workspace = true
4141
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
42-
tempfile = "3.2"
42+
tempfile.workspace = true
4343
thin-vec.workspace = true
4444
thorin-dwp = "0.9"
4545
tracing.workspace = true
@@ -48,7 +48,7 @@ wasm-encoder = "0.219"
4848

4949
[target.'cfg(unix)'.dependencies]
5050
# tidy-alphabetical-start
51-
libc = "0.2.50"
51+
libc.workspace = true
5252
# tidy-alphabetical-end
5353

5454
[dependencies.object]

compiler/rustc_const_eval/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
either = "1"
8+
either.workspace = true
99
rustc_abi = { path = "../rustc_abi" }
10-
rustc_apfloat = "0.2.0"
10+
rustc_apfloat.workspace = true
1111
rustc_ast = { path = "../rustc_ast" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }
1313
rustc_errors = { path = "../rustc_errors" }

compiler/rustc_data_structures/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ edition = "2024"
77
# tidy-alphabetical-start
88
arrayvec = { version = "0.7", default-features = false }
99
bitflags.workspace = true
10-
either = "1.0"
10+
either.workspace = true
1111
elsa = "1.11.0"
1212
ena = "0.14.3"
13-
indexmap = "2.4.0"
13+
indexmap.workspace = true
1414
jobserver_crate = { version = "0.1.28", package = "jobserver" }
15-
measureme = "12.0.1"
15+
measureme.workspace = true
1616
parking_lot = "0.12"
17-
rustc-hash = "2.0.0"
17+
rustc-hash.workspace = true
1818
rustc-stable-hash = { version = "0.1.0", features = ["nightly"] }
1919
rustc_arena = { path = "../rustc_arena" }
2020
rustc_graphviz = { path = "../rustc_graphviz" }
@@ -25,7 +25,7 @@ rustc_serialize = { path = "../rustc_serialize" }
2525
rustc_thread_pool = { path = "../rustc_thread_pool" }
2626
smallvec = { version = "1.8.1", features = ["const_generics", "union", "may_dangle"] }
2727
stacker = "0.1.17"
28-
tempfile = "3.2"
28+
tempfile.workspace = true
2929
thin-vec.workspace = true
3030
tracing.workspace = true
3131
# tidy-alphabetical-end
@@ -47,7 +47,7 @@ features = [
4747

4848
[target.'cfg(unix)'.dependencies]
4949
# tidy-alphabetical-start
50-
libc = "0.2"
50+
libc.workspace = true
5151
# tidy-alphabetical-end
5252

5353
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

compiler/rustc_driver_impl/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ rustc_span = { path = "../rustc_span" }
4949
rustc_target = { path = "../rustc_target" }
5050
rustc_trait_selection = { path = "../rustc_trait_selection" }
5151
rustc_ty_utils = { path = "../rustc_ty_utils" }
52-
serde_json = "1.0.59"
52+
serde_json.workspace = true
5353
shlex = "1.0"
5454
tracing.workspace = true
5555
# tidy-alphabetical-end
5656

5757
[target.'cfg(all(unix, any(target_env = "gnu", target_os = "macos")))'.dependencies]
5858
# tidy-alphabetical-start
59-
libc = "0.2"
59+
libc.workspace = true
6060
# tidy-alphabetical-end
6161

6262
[target.'cfg(windows)'.dependencies.windows]

0 commit comments

Comments
 (0)