Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9053425
Add a mailmap entry for gnzlbg
tgross35 Jul 10, 2025
12b5794
Remove TmpLayout in layout_of_enum
zachs18 Aug 12, 2025
db4e716
std library: use execinfo library also on NetBSD.
he32 Aug 23, 2025
17c8667
fix(std): Add __my_thread_exit stub for QNX 8
rafaeling Jul 23, 2025
f9c765e
Test `instrument-mcount`
clubby789 Aug 26, 2025
7506000
Add an overlooked `tracing` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
12dc789
Add `libc` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
daf6fe2
Add `serde_json` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
d263d3a
Add `either` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
1ed5660
Add `proc-macro2` and `quote` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
ce02d34
Add `rustc_apfloat` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
77d2f0c
Add `tempfile` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
77b047a
Add `indexmap` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
2b26476
Add `rustc-hash` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
e692c97
Add `derive-where` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
8fc0813
Add `measureme` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
42359b7
Add `scoped-tls` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
20d0375
Add `odht` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
b16c66e
Add `polonius-engine` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
475c29d
Add `rustc-demangle` to `[workspace.dependencies]`.
nnethercote Aug 27, 2025
df802cc
fix `core::marker::Destruct` doc
neeko-cat Aug 28, 2025
1a33d62
implement Sum and Product for Saturating(u*)
Qelxiros Aug 28, 2025
2bd53b7
Rollup merge of #143713 - tgross35:mailmap, r=Mark-Simulacrum
Zalathar Aug 29, 2025
ef50370
Rollup merge of #144275 - Qelxiros:saturating-arithmetic, r=tgross35
Zalathar Aug 29, 2025
6ac6eb6
Rollup merge of #144354 - rafaeling:fix-142726-qnx8-link-fail, r=tgro…
Zalathar Aug 29, 2025
dd03ce8
Rollup merge of #145387 - zachs18:remove-tmplayout, r=cjgillot
Zalathar Aug 29, 2025
4b0933a
Rollup merge of #145793 - he32:netbsd-libexecinfo-fix, r=Mark-Simulacrum
Zalathar Aug 29, 2025
4ccf8ca
Rollup merge of #145884 - clubby789:test-mcount, r=Mark-Simulacrum
Zalathar Aug 29, 2025
2246dda
Rollup merge of #145947 - nnethercote:workspace-members-2, r=Kobzol
Zalathar Aug 29, 2025
5c0cd83
Rollup merge of #145972 - neeko-cat:patch-2, r=ibraheemdev
Zalathar Aug 29, 2025
a54567e
tests: Ignore basic-stepping.rs on riscv64
Aug 29, 2025
31eafaf
Rollup merge of #145977 - CaiWeiran:basic-stepping-test, r=jieyouxu
Zalathar Aug 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ Guillaume Gomez <[email protected]>
Guillaume Gomez <[email protected]> ggomez <[email protected]>
Guillaume Gomez <[email protected]> Guillaume Gomez <[email protected]>
Guillaume Gomez <[email protected]> Guillaume Gomez <[email protected]>
gnzlbg <[email protected]> <[email protected]>
hamidreza kalbasi <[email protected]>
Hanna Kruppe <[email protected]> <[email protected]>
Heather <[email protected]> <[email protected]>
Expand Down
17 changes: 17 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,26 @@ exclude = [
[workspace.dependencies]
# tidy-alphabetical-start
bitflags = "2.9.3"
derive-where = "1.6.0"
either = "1.15.0"
indexmap = "2.10.0"
itertools = "0.12.1"
# FIXME: Remove this pin once this rustix issue is resolved
# https://github.com/bytecodealliance/rustix/issues/1496
libc = "=0.2.174"
measureme = "12.0.3"
memchr = "2.7.5"
odht = { version = "0.3.1", features = ["nightly"] }
polonius-engine = "0.13.0"
proc-macro2 = "1.0.101"
quote = "1.0.40"
rustc-demangle = "0.1.26"
rustc-hash = "2.1.1"
rustc-literal-escaper = "0.0.5"
rustc_apfloat = "0.2.3"
scoped-tls = "1.0.1"
serde_json = "1.0.142"
tempfile = "3.20.0"
thin-vec = "0.2.14"
tracing = "0.1.37"
# tidy-alphabetical-end
Expand Down
39 changes: 9 additions & 30 deletions compiler/rustc_abi/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,23 +594,13 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
discr_range_of_repr: impl Fn(i128, i128) -> (Integer, bool),
discriminants: impl Iterator<Item = (VariantIdx, i128)>,
) -> LayoutCalculatorResult<FieldIdx, VariantIdx, F> {
// Until we've decided whether to use the tagged or
// niche filling LayoutData, we don't want to intern the
// variant layouts, so we can't store them in the
// overall LayoutData. Store the overall LayoutData
// and the variant LayoutDatas here until then.
struct TmpLayout<FieldIdx: Idx, VariantIdx: Idx> {
layout: LayoutData<FieldIdx, VariantIdx>,
variants: IndexVec<VariantIdx, LayoutData<FieldIdx, VariantIdx>>,
}

let dl = self.cx.data_layout();
// bail if the enum has an incoherent repr that cannot be computed
if repr.packed() {
return Err(LayoutCalculatorError::ReprConflict);
}

let calculate_niche_filling_layout = || -> Option<TmpLayout<FieldIdx, VariantIdx>> {
let calculate_niche_filling_layout = || -> Option<LayoutData<FieldIdx, VariantIdx>> {
if repr.inhibit_enum_layout_opt() {
return None;
}
Expand Down Expand Up @@ -746,7 +736,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
niche_start,
},
tag_field: FieldIdx::new(0),
variants: IndexVec::new(),
variants: variant_layouts,
},
fields: FieldsShape::Arbitrary {
offsets: [niche_offset].into(),
Expand All @@ -762,7 +752,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
randomization_seed: combined_seed,
};

Some(TmpLayout { layout, variants: variant_layouts })
Some(layout)
};

let niche_filling_layout = calculate_niche_filling_layout();
Expand Down Expand Up @@ -1093,7 +1083,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
tag,
tag_encoding: TagEncoding::Direct,
tag_field: FieldIdx::new(0),
variants: IndexVec::new(),
variants: layout_variants,
},
fields: FieldsShape::Arbitrary {
offsets: [Size::ZERO].into(),
Expand All @@ -1109,18 +1099,16 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
randomization_seed: combined_seed,
};

let tagged_layout = TmpLayout { layout: tagged_layout, variants: layout_variants };

let mut best_layout = match (tagged_layout, niche_filling_layout) {
let best_layout = match (tagged_layout, niche_filling_layout) {
(tl, Some(nl)) => {
// Pick the smaller layout; otherwise,
// pick the layout with the larger niche; otherwise,
// pick tagged as it has simpler codegen.
use cmp::Ordering::*;
let niche_size = |tmp_l: &TmpLayout<FieldIdx, VariantIdx>| {
tmp_l.layout.largest_niche.map_or(0, |n| n.available(dl))
let niche_size = |l: &LayoutData<FieldIdx, VariantIdx>| {
l.largest_niche.map_or(0, |n| n.available(dl))
};
match (tl.layout.size.cmp(&nl.layout.size), niche_size(&tl).cmp(&niche_size(&nl))) {
match (tl.size.cmp(&nl.size), niche_size(&tl).cmp(&niche_size(&nl))) {
(Greater, _) => nl,
(Equal, Less) => nl,
_ => tl,
Expand All @@ -1129,16 +1117,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
(tl, None) => tl,
};

// Now we can intern the variant layouts and store them in the enum layout.
best_layout.layout.variants = match best_layout.layout.variants {
Variants::Multiple { tag, tag_encoding, tag_field, .. } => {
Variants::Multiple { tag, tag_encoding, tag_field, variants: best_layout.variants }
}
Variants::Single { .. } | Variants::Empty => {
panic!("encountered a single-variant or empty enum during multi-variant layout")
}
};
Ok(best_layout.layout)
Ok(best_layout)
}

fn univariant_biased<
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec.workspace = true
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ edition = "2024"

[dependencies]
# tidy-alphabetical-start
either = "1.5.0"
either.workspace = true
itertools.workspace = true
polonius-engine = "0.13.0"
polonius-engine.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ bitflags.workspace = true
# by `rustc_codegen_ssa` via its `thorin-dwp` dependency.
gimli = "0.31"
itertools.workspace = true
libc = "0.2"
measureme = "12.0.1"
libc.workspace = true
measureme.workspace = true
object = { version = "0.37.0", default-features = false, features = ["std", "read"] }
rustc-demangle = "0.1.21"
rustc-demangle.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
Expand All @@ -38,7 +38,7 @@ rustc_span = { path = "../rustc_span" }
rustc_symbol_mangling = { path = "../rustc_symbol_mangling" }
rustc_target = { path = "../rustc_target" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_json.workspace = true
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing.workspace = true
# tidy-alphabetical-end
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ rustc_span = { path = "../rustc_span" }
rustc_symbol_mangling = { path = "../rustc_symbol_mangling" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
serde_json = "1.0.59"
serde_json.workspace = true
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tempfile = "3.2"
tempfile.workspace = true
thin-vec.workspace = true
thorin-dwp = "0.9"
tracing.workspace = true
Expand All @@ -48,7 +48,7 @@ wasm-encoder = "0.219"

[target.'cfg(unix)'.dependencies]
# tidy-alphabetical-start
libc = "0.2.50"
libc.workspace = true
# tidy-alphabetical-end

[dependencies.object]
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_const_eval/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ edition = "2024"

[dependencies]
# tidy-alphabetical-start
either = "1"
either.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_apfloat = "0.2.0"
rustc_apfloat.workspace = true
rustc_ast = { path = "../rustc_ast" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_data_structures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ edition = "2024"
# tidy-alphabetical-start
arrayvec = { version = "0.7", default-features = false }
bitflags.workspace = true
either = "1.0"
either.workspace = true
elsa = "1.11.0"
ena = "0.14.3"
indexmap = "2.4.0"
indexmap.workspace = true
jobserver_crate = { version = "0.1.28", package = "jobserver" }
measureme = "12.0.1"
measureme.workspace = true
parking_lot = "0.12"
rustc-hash = "2.0.0"
rustc-hash.workspace = true
rustc-stable-hash = { version = "0.1.0", features = ["nightly"] }
rustc_arena = { path = "../rustc_arena" }
rustc_graphviz = { path = "../rustc_graphviz" }
Expand All @@ -25,7 +25,7 @@ rustc_serialize = { path = "../rustc_serialize" }
rustc_thread_pool = { path = "../rustc_thread_pool" }
smallvec = { version = "1.8.1", features = ["const_generics", "union", "may_dangle"] }
stacker = "0.1.17"
tempfile = "3.2"
tempfile.workspace = true
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
Expand All @@ -47,7 +47,7 @@ features = [

[target.'cfg(unix)'.dependencies]
# tidy-alphabetical-start
libc = "0.2"
libc.workspace = true
# tidy-alphabetical-end

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_driver_impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
rustc_ty_utils = { path = "../rustc_ty_utils" }
serde_json = "1.0.59"
serde_json.workspace = true
shlex = "1.0"
tracing.workspace = true
# tidy-alphabetical-end

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

[target.'cfg(windows)'.dependencies.windows]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rustc_macros = { path = "../rustc_macros" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
serde = { version = "1.0.125", features = ["derive"] }
serde_json = "1.0.59"
serde_json.workspace = true
termcolor = "1.2.0"
termize = "0.2"
tracing.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_feature/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ rustc_data_structures = { path = "../rustc_data_structures" }
rustc_hir = { path = "../rustc_hir" }
rustc_span = { path = "../rustc_span" }
serde = { version = "1.0.125", features = ["derive"] }
serde_json = "1.0.59"
serde_json.workspace = true
# tidy-alphabetical-end
4 changes: 2 additions & 2 deletions compiler/rustc_fluent_macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ proc-macro = true
annotate-snippets = "0.11"
fluent-bundle = "0.16"
fluent-syntax = "0.12"
proc-macro2 = "1"
quote = "1"
proc-macro2.workspace = true
quote.workspace = true
syn = { version = "2", features = ["full"] }
unic-langid = { version = "0.9.0", features = ["macros"] }
# tidy-alphabetical-end
2 changes: 1 addition & 1 deletion compiler/rustc_fs_util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ edition = "2024"

[dependencies]
# tidy-alphabetical-start
tempfile = "3.7.1"
tempfile.workspace = true
# tidy-alphabetical-end
2 changes: 1 addition & 1 deletion compiler/rustc_hir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags.workspace = true
odht = { version = "0.3.1", features = ["nightly"] }
odht.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_arena = { path = "../rustc_arena" }
rustc_ast = { path = "../rustc_ast" }
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_index_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ proc-macro = true

[dependencies]
# tidy-alphabetical-start
proc-macro2 = "1"
quote = "1"
proc-macro2.workspace = true
quote.workspace = true
syn = { version = "2.0.9", features = ["full", "extra-traits"] }
# tidy-alphabetical-end

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2024"

[dependencies]
# tidy-alphabetical-start
libc = "0.2.73"
libc.workspace = true
# tidy-alphabetical-end

[build-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ proc-macro = true

[dependencies]
# tidy-alphabetical-start
proc-macro2 = "1"
quote = "1"
proc-macro2.workspace = true
quote.workspace = true
syn = { version = "2.0.9", features = ["full"] }
synstructure = "0.13.0"
# tidy-alphabetical-end
6 changes: 3 additions & 3 deletions compiler/rustc_metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2024"
# tidy-alphabetical-start
bitflags.workspace = true
libloading = "0.8.0"
odht = { version = "0.3.1", features = ["nightly"] }
odht.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
Expand All @@ -30,11 +30,11 @@ rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
tempfile = "3.7.1"
tempfile.workspace = true
tracing.workspace = true
# tidy-alphabetical-end

[target.'cfg(target_os = "aix")'.dependencies]
# tidy-alphabetical-start
libc = "0.2"
libc.workspace = true
# tidy-alphabetical-end
6 changes: 3 additions & 3 deletions compiler/rustc_middle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags.workspace = true
either = "1.5.0"
either.workspace = true
gsgdt = "0.1.2"
polonius-engine = "0.13.0"
polonius-engine.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_apfloat = "0.2.0"
rustc_apfloat.workspace = true
rustc_arena = { path = "../rustc_arena" }
rustc_ast = { path = "../rustc_ast" }
rustc_ast_ir = { path = "../rustc_ast_ir" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2024"
# tidy-alphabetical-start
itertools.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_apfloat = "0.2.0"
rustc_apfloat.workspace = true
rustc_arena = { path = "../rustc_arena" }
rustc_ast = { path = "../rustc_ast" }
rustc_data_structures = { path = "../rustc_data_structures" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_dataflow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2024"

[dependencies]
# tidy-alphabetical-start
polonius-engine = "0.13.0"
polonius-engine.workspace = true
regex = "1"
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2024"

[dependencies]
# tidy-alphabetical-start
either = "1"
either.workspace = true
itertools.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_arena = { path = "../rustc_arena" }
Expand Down
Loading
Loading