Skip to content

skip max_repr_align in Layout::eq_abi - #165066

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
RalfJung:abi-ice
Oct 29, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
RalfJung:abi-ice

Conversation

@RalfJung

Copy link
Copy Markdown
Member

We don't have to compare all fields of Layout. Some of them are irrelevant most of the time, only some special callconv adjustments use them. Given that we compare both PassMode and Layout, we will notice those differences in PassMode comparison. Comparing them also in Layout is too strict as the values can differ without actually resulting in a different ABI. For instance, max_repr_align: Some(1) is effectively the same as max_repr_align: None.

Fixes rust-lang/miri#5500
r? @oli-obk

@rustbot

rustbot commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

Some changes occurred to the CTFE machinery

cc @oli-obk, @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 28, 2026

@oli-obk oli-obk left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread compiler/rustc_abi/src/lib.rs Outdated
Comment on lines +2471 to +2473
// max_repr_align, unadjusted_abi_align, repr_c are not read directly by codegen
// backends. They are only used to compute `PassMode`. So we can ignore them here, any
// differences they may cause are picked up by the `PassMode` check.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preexisting: maybe exhaustively destructure either other or self and explicitly ignore the fields there, feels like a bug waiting to happen

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jup, tho subtle that the is_sized check isn't needed anymore 😅

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 28, 2026
@RalfJung

Copy link
Copy Markdown
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 28, 2026
@oli-obk

oli-obk commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e4f3f28 has been approved by oli-obk

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 28, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 28, 2026
skip max_repr_align in Layout::eq_abi

We don't have to compare all fields of `Layout`. Some of them are irrelevant most of the time, only some special callconv adjustments use them. Given that we compare both `PassMode` and `Layout`, we will notice those differences in `PassMode` comparison. Comparing them also in `Layout` is too strict as the values can differ without actually resulting in a different ABI. For instance, `max_repr_align: Some(1)`  is effectively the same as `max_repr_align: None`.

Fixes rust-lang/miri#5500
r? @oli-obk
rust-bors Bot pushed a commit that referenced this pull request Oct 28, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #165032 (stdarch subtree update)
 - #165072 (Submodule update of rustc-perf)
 - #144090 (Make `IoSlice` and `IoSliceMut` methods unstably const)
 - #162342 (More stdarch regression tests)
 - #163909 (std: Test the exit behavior of `abort` and `abort_immediate`)
 - #164766 (Unstably introduce MVP edition migration lint `unmarked_unchecked_type_aliases` together with bikeshed attribute `#[rustc_unchecked_type_alias]`)
 - #164916 (CI: rfl: move job forward to Linux v7.3)
 - #164924 (Remove `TypeKind` from `rustc_codegen_ssa`)
 - #164969 (perf: avoid allocating HashSet in is_distinct check on small SwitchInts)
 - #165083 (Gate `z` inline asm template modifier)
 - #165087 (Fix flaky CI test `named_temp_file_new_creates_file`)
 - #161131 (Check associated const binding types)
 - #161418 (give next-solver's `evaluate_const` its own `try_evaluate_const` logic)
 - #164315 (make powerpc `Complex` ABI GCC-compatible)
 - #164476 (Avoid ICE on None from prepare_vtable_segments)
 - #164981 (Reflection add TypeId::name)
 - #165003 (follow up for global-alloc-reentry test)
 - #165020 (Bless mir-opt panic-abort tests)
 - #165066 (skip max_repr_align in Layout::eq_abi)
 - #165080 (Syntactically allow C-variadics in parenthesized argument lists)
 - #165081 (move `#[rustc_allow_const_fn_unstable]` attr check to attr parsing stage)
 - #165082 (Remove stability note from `rust_splat`)
rust-bors Bot pushed a commit that referenced this pull request Oct 29, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #165032 (stdarch subtree update)
 - #165072 (Submodule update of rustc-perf)
 - #144090 (Make `IoSlice` and `IoSliceMut` methods unstably const)
 - #162342 (More stdarch regression tests)
 - #163909 (std: Test the exit behavior of `abort` and `abort_immediate`)
 - #164766 (Unstably introduce MVP edition migration lint `unmarked_unchecked_type_aliases` together with bikeshed attribute `#[rustc_unchecked_type_alias]`)
 - #164916 (CI: rfl: move job forward to Linux v7.3)
 - #164924 (Remove `TypeKind` from `rustc_codegen_ssa`)
 - #164969 (perf: avoid allocating HashSet in is_distinct check on small SwitchInts)
 - #165083 (Gate `z` inline asm template modifier)
 - #165087 (Fix flaky CI test `named_temp_file_new_creates_file`)
 - #161131 (Check associated const binding types)
 - #161418 (give next-solver's `evaluate_const` its own `try_evaluate_const` logic)
 - #164315 (make powerpc `Complex` ABI GCC-compatible)
 - #164476 (Avoid ICE on None from prepare_vtable_segments)
 - #164981 (Reflection add TypeId::name)
 - #165003 (follow up for global-alloc-reentry test)
 - #165020 (Bless mir-opt panic-abort tests)
 - #165066 (skip max_repr_align in Layout::eq_abi)
 - #165080 (Syntactically allow C-variadics in parenthesized argument lists)
 - #165081 (move `#[rustc_allow_const_fn_unstable]` attr check to attr parsing stage)
 - #165082 (Remove stability note from `rust_splat`)
rust-bors Bot pushed a commit that referenced this pull request Oct 29, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #165032 (stdarch subtree update)
 - #165072 (Submodule update of rustc-perf)
 - #144090 (Make `IoSlice` and `IoSliceMut` methods unstably const)
 - #162342 (More stdarch regression tests)
 - #163909 (std: Test the exit behavior of `abort` and `abort_immediate`)
 - #164766 (Unstably introduce MVP edition migration lint `unmarked_unchecked_type_aliases` together with bikeshed attribute `#[rustc_unchecked_type_alias]`)
 - #164916 (CI: rfl: move job forward to Linux v7.3)
 - #164924 (Remove `TypeKind` from `rustc_codegen_ssa`)
 - #164969 (perf: avoid allocating HashSet in is_distinct check on small SwitchInts)
 - #165083 (Gate `z` inline asm template modifier)
 - #165087 (Fix flaky CI test `named_temp_file_new_creates_file`)
 - #161131 (Check associated const binding types)
 - #161418 (give next-solver's `evaluate_const` its own `try_evaluate_const` logic)
 - #164315 (make powerpc `Complex` ABI GCC-compatible)
 - #164476 (Avoid ICE on None from prepare_vtable_segments)
 - #164981 (Reflection add TypeId::name)
 - #165003 (follow up for global-alloc-reentry test)
 - #165020 (Bless mir-opt panic-abort tests)
 - #165066 (skip max_repr_align in Layout::eq_abi)
 - #165080 (Syntactically allow C-variadics in parenthesized argument lists)
 - #165081 (move `#[rustc_allow_const_fn_unstable]` attr check to attr parsing stage)
 - #165082 (Remove stability note from `rust_splat`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 29, 2026
skip max_repr_align in Layout::eq_abi

We don't have to compare all fields of `Layout`. Some of them are irrelevant most of the time, only some special callconv adjustments use them. Given that we compare both `PassMode` and `Layout`, we will notice those differences in `PassMode` comparison. Comparing them also in `Layout` is too strict as the values can differ without actually resulting in a different ABI. For instance, `max_repr_align: Some(1)`  is effectively the same as `max_repr_align: None`.

Fixes rust-lang/miri#5500
r? @oli-obk
rust-bors Bot pushed a commit that referenced this pull request Oct 29, 2026
…uwer

Rollup of 23 pull requests

Successful merges:

 - #165032 (stdarch subtree update)
 - #165072 (Submodule update of rustc-perf)
 - #144090 (Make `IoSlice` and `IoSliceMut` methods unstably const)
 - #162342 (More stdarch regression tests)
 - #163909 (std: Test the exit behavior of `abort` and `abort_immediate`)
 - #164766 (Unstably introduce MVP edition migration lint `unmarked_unchecked_type_aliases` together with bikeshed attribute `#[rustc_unchecked_type_alias]`)
 - #164916 (CI: rfl: move job forward to Linux v7.3)
 - #164924 (Remove `TypeKind` from `rustc_codegen_ssa`)
 - #164969 (perf: avoid allocating HashSet in is_distinct check on small SwitchInts)
 - #165083 (Gate `z` inline asm template modifier)
 - #165087 (Fix flaky CI test `named_temp_file_new_creates_file`)
 - #165123 (Temporarily drop macos-26 jobs)
 - #161131 (Check associated const binding types)
 - #161418 (give next-solver's `evaluate_const` its own `try_evaluate_const` logic)
 - #164315 (make powerpc `Complex` ABI GCC-compatible)
 - #164476 (Avoid ICE on None from prepare_vtable_segments)
 - #164981 (Reflection add TypeId::name)
 - #165003 (follow up for global-alloc-reentry test)
 - #165020 (Bless mir-opt panic-abort tests)
 - #165066 (skip max_repr_align in Layout::eq_abi)
 - #165080 (Syntactically allow C-variadics in parenthesized argument lists)
 - #165081 (move `#[rustc_allow_const_fn_unstable]` attr check to attr parsing stage)
 - #165082 (Remove stability note from `rust_splat`)
rust-bors Bot pushed a commit that referenced this pull request Oct 29, 2026
…uwer

Rollup of 23 pull requests

Successful merges:

 - #165032 (stdarch subtree update)
 - #165072 (Submodule update of rustc-perf)
 - #144090 (Make `IoSlice` and `IoSliceMut` methods unstably const)
 - #162342 (More stdarch regression tests)
 - #163909 (std: Test the exit behavior of `abort` and `abort_immediate`)
 - #164766 (Unstably introduce MVP edition migration lint `unmarked_unchecked_type_aliases` together with bikeshed attribute `#[rustc_unchecked_type_alias]`)
 - #164916 (CI: rfl: move job forward to Linux v7.3)
 - #164924 (Remove `TypeKind` from `rustc_codegen_ssa`)
 - #164969 (perf: avoid allocating HashSet in is_distinct check on small SwitchInts)
 - #165083 (Gate `z` inline asm template modifier)
 - #165087 (Fix flaky CI test `named_temp_file_new_creates_file`)
 - #165123 (Temporarily drop macos-26 jobs)
 - #161131 (Check associated const binding types)
 - #161418 (give next-solver's `evaluate_const` its own `try_evaluate_const` logic)
 - #164315 (make powerpc `Complex` ABI GCC-compatible)
 - #164476 (Avoid ICE on None from prepare_vtable_segments)
 - #164981 (Reflection add TypeId::name)
 - #165003 (follow up for global-alloc-reentry test)
 - #165020 (Bless mir-opt panic-abort tests)
 - #165066 (skip max_repr_align in Layout::eq_abi)
 - #165080 (Syntactically allow C-variadics in parenthesized argument lists)
 - #165081 (move `#[rustc_allow_const_fn_unstable]` attr check to attr parsing stage)
 - #165082 (Remove stability note from `rust_splat`)
rust-bors Bot pushed a commit that referenced this pull request Oct 29, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #165032 (stdarch subtree update)
 - #165123 (Temporarily drop macos-26 jobs)
 - #165072 (Submodule update of rustc-perf)
 - #144090 (Make `IoSlice` and `IoSliceMut` methods unstably const)
 - #162342 (More stdarch regression tests)
 - #163909 (std: Test the exit behavior of `abort` and `abort_immediate`)
 - #164766 (Unstably introduce MVP edition migration lint `unmarked_unchecked_type_aliases` together with bikeshed attribute `#[rustc_unchecked_type_alias]`)
 - #164916 (CI: rfl: move job forward to Linux v7.3)
 - #164924 (Remove `TypeKind` from `rustc_codegen_ssa`)
 - #164969 (perf: avoid allocating HashSet in is_distinct check on small SwitchInts)
 - #165083 (Gate `z` inline asm template modifier)
 - #165087 (Fix flaky CI test `named_temp_file_new_creates_file`)
 - #161131 (Check associated const binding types)
 - #161418 (give next-solver's `evaluate_const` its own `try_evaluate_const` logic)
 - #164315 (make powerpc `Complex` ABI GCC-compatible)
 - #164476 (Avoid ICE on None from prepare_vtable_segments)
 - #165003 (follow up for global-alloc-reentry test)
 - #165020 (Bless mir-opt panic-abort tests)
 - #165066 (skip max_repr_align in Layout::eq_abi)
 - #165080 (Syntactically allow C-variadics in parenthesized argument lists)
 - #165081 (move `#[rustc_allow_const_fn_unstable]` attr check to attr parsing stage)
 - #165082 (Remove stability note from `rust_splat`)
@rust-bors
rust-bors Bot merged commit ed65e0e into rust-lang:main Oct 29, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 29, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 29, 2026
Rollup merge of #165066 - RalfJung:abi-ice, r=oli-obk

skip max_repr_align in Layout::eq_abi

We don't have to compare all fields of `Layout`. Some of them are irrelevant most of the time, only some special callconv adjustments use them. Given that we compare both `PassMode` and `Layout`, we will notice those differences in `PassMode` comparison. Comparing them also in `Layout` is too strict as the values can differ without actually resulting in a different ABI. For instance, `max_repr_align: Some(1)`  is effectively the same as `max_repr_align: None`.

Fixes rust-lang/miri#5500
r? @oli-obk
hashcatHitman pushed a commit to hashcatHitman/miri that referenced this pull request Oct 30, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - rust-lang/rust#165032 (stdarch subtree update)
 - rust-lang/rust#165123 (Temporarily drop macos-26 jobs)
 - rust-lang/rust#165072 (Submodule update of rustc-perf)
 - rust-lang/rust#144090 (Make `IoSlice` and `IoSliceMut` methods unstably const)
 - rust-lang/rust#162342 (More stdarch regression tests)
 - rust-lang/rust#163909 (std: Test the exit behavior of `abort` and `abort_immediate`)
 - rust-lang/rust#164766 (Unstably introduce MVP edition migration lint `unmarked_unchecked_type_aliases` together with bikeshed attribute `#[rustc_unchecked_type_alias]`)
 - rust-lang/rust#164916 (CI: rfl: move job forward to Linux v7.3)
 - rust-lang/rust#164924 (Remove `TypeKind` from `rustc_codegen_ssa`)
 - rust-lang/rust#164969 (perf: avoid allocating HashSet in is_distinct check on small SwitchInts)
 - rust-lang/rust#165083 (Gate `z` inline asm template modifier)
 - rust-lang/rust#165087 (Fix flaky CI test `named_temp_file_new_creates_file`)
 - rust-lang/rust#161131 (Check associated const binding types)
 - rust-lang/rust#161418 (give next-solver's `evaluate_const` its own `try_evaluate_const` logic)
 - rust-lang/rust#164315 (make powerpc `Complex` ABI GCC-compatible)
 - rust-lang/rust#164476 (Avoid ICE on None from prepare_vtable_segments)
 - rust-lang/rust#165003 (follow up for global-alloc-reentry test)
 - rust-lang/rust#165020 (Bless mir-opt panic-abort tests)
 - rust-lang/rust#165066 (skip max_repr_align in Layout::eq_abi)
 - rust-lang/rust#165080 (Syntactically allow C-variadics in parenthesized argument lists)
 - rust-lang/rust#165081 (move `#[rustc_allow_const_fn_unstable]` attr check to attr parsing stage)
 - rust-lang/rust#165082 (Remove stability note from `rust_splat`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE passing a repr(align(1)) argument to FnOnce::call_once

3 participants