Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7229824

Browse files
committedOct 29, 2024·
Auto merge of rust-lang#132307 - matthiaskrgr:rollup-xm136gd, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#130259 (Lower AST node id only once) - rust-lang#131441 (Add a new trait `proc_macro::ToTokens`) - rust-lang#132247 (stable_mir: Directly use types from rustc_abi) - rust-lang#132249 (compiler: Add rustc_abi dependence to the compiler) - rust-lang#132255 (Add `LayoutData::is_uninhabited` and use it) - rust-lang#132258 ([rustdoc] Unify variant struct fields margins with struct fields) - rust-lang#132260 (cg_llvm: Use a type-safe helper to cast `&str` and `&[u8]` to `*const c_char`) - rust-lang#132261 (refactor: cleaner check to return None) - rust-lang#132271 (Updating Fuchsia platform-support documentation) - rust-lang#132295 (fixed wast version was released, remove randomization exemption) r? `@ghost` `@rustbot` modify labels: rollup
2 parents a9d1762 + 94ee84f commit 7229824

File tree

82 files changed

+750
-342
lines changed

Some content is hidden

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

82 files changed

+750
-342
lines changed
 

‎Cargo.lock

+10
Original file line numberDiff line numberDiff line change
@@ -3621,6 +3621,7 @@ version = "0.0.0"
36213621
dependencies = [
36223622
"annotate-snippets 0.11.4",
36233623
"derive_setters",
3624+
"rustc_abi",
36243625
"rustc_ast",
36253626
"rustc_ast_pretty",
36263627
"rustc_data_structures",
@@ -3718,6 +3719,7 @@ name = "rustc_hir_analysis"
37183719
version = "0.0.0"
37193720
dependencies = [
37203721
"itertools",
3722+
"rustc_abi",
37213723
"rustc_arena",
37223724
"rustc_ast",
37233725
"rustc_attr",
@@ -3906,6 +3908,7 @@ dependencies = [
39063908
name = "rustc_lint"
39073909
version = "0.0.0"
39083910
dependencies = [
3911+
"rustc_abi",
39093912
"rustc_ast",
39103913
"rustc_ast_pretty",
39113914
"rustc_attr",
@@ -3980,6 +3983,7 @@ dependencies = [
39803983
"bitflags 2.6.0",
39813984
"libloading",
39823985
"odht",
3986+
"rustc_abi",
39833987
"rustc_ast",
39843988
"rustc_attr",
39853989
"rustc_data_structures",
@@ -4074,6 +4078,7 @@ version = "0.0.0"
40744078
dependencies = [
40754079
"polonius-engine",
40764080
"regex",
4081+
"rustc_abi",
40774082
"rustc_ast",
40784083
"rustc_data_structures",
40794084
"rustc_errors",
@@ -4095,6 +4100,7 @@ version = "0.0.0"
40954100
dependencies = [
40964101
"either",
40974102
"itertools",
4103+
"rustc_abi",
40984104
"rustc_arena",
40994105
"rustc_ast",
41004106
"rustc_attr",
@@ -4187,6 +4193,7 @@ dependencies = [
41874193
name = "rustc_passes"
41884194
version = "0.0.0"
41894195
dependencies = [
4196+
"rustc_abi",
41904197
"rustc_ast",
41914198
"rustc_ast_pretty",
41924199
"rustc_attr",
@@ -4213,6 +4220,7 @@ name = "rustc_pattern_analysis"
42134220
version = "0.0.0"
42144221
dependencies = [
42154222
"rustc-hash 2.0.0",
4223+
"rustc_abi",
42164224
"rustc_apfloat",
42174225
"rustc_arena",
42184226
"rustc_data_structures",
@@ -4352,6 +4360,7 @@ dependencies = [
43524360
"bitflags 2.6.0",
43534361
"getopts",
43544362
"libc",
4363+
"rustc_abi",
43554364
"rustc_ast",
43564365
"rustc_data_structures",
43574366
"rustc_errors",
@@ -4415,6 +4424,7 @@ version = "0.0.0"
44154424
dependencies = [
44164425
"punycode",
44174426
"rustc-demangle",
4427+
"rustc_abi",
44184428
"rustc_data_structures",
44194429
"rustc_errors",
44204430
"rustc_hir",

‎compiler/rustc_abi/src/layout.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ where
2828
VariantIdx: Idx,
2929
F: Deref<Target = &'a LayoutData<FieldIdx, VariantIdx>> + fmt::Debug,
3030
{
31-
let uninhabited = fields.iter().any(|f| f.abi.is_uninhabited());
31+
let uninhabited = fields.iter().any(|f| f.is_uninhabited());
3232
// We cannot ignore alignment; that might lead us to entirely discard a variant and
3333
// produce an enum that is less aligned than it should be!
3434
let is_1zst = fields.iter().all(|f| f.is_1zst());
@@ -681,7 +681,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
681681
let discr_type = repr.discr_type();
682682
let bits = Integer::from_attr(dl, discr_type).size().bits();
683683
for (i, mut val) in discriminants {
684-
if !repr.c() && variants[i].iter().any(|f| f.abi.is_uninhabited()) {
684+
if !repr.c() && variants[i].iter().any(|f| f.is_uninhabited()) {
685685
continue;
686686
}
687687
if discr_type.is_signed() {

0 commit comments

Comments
 (0)