Skip to content

interpret: make validate_c_variadic_compatible_ty public - #161615

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:vararg-check
Aug 24, 2026
Merged

interpret: make validate_c_variadic_compatible_ty public#161615
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:vararg-check

Conversation

@RalfJung

Copy link
Copy Markdown
Member

Miri needs the same check for vararg shims, so let's make this function public so that Miri can reuse it.

r? @saethlin or @folkertdev

@rustbot

rustbot commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred to the CTFE machinery

cc @oli-obk, @lcnr

@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 Aug 23, 2026

@folkertdev folkertdev 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.

r=me when CI is green

View changes since this review

Comment on lines -832 to -840
// Types of different sizes can never be compatible.
if arg_mplace.layout.size != callee_type.size {
throw_ub_format!(
"va_arg type mismatch: requested `{}` is incompatible with next argument of type `{}`",
callee_ty,
caller_ty,
)
}

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.

I assume this is removed because it's also checked by validate_c_variadic_compatible_ty which is unconditionally called right below?

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.

Yes indeed.

@folkertdev

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c0d8828 has been approved by folkertdev

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 Aug 23, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 24, 2026
interpret: make validate_c_variadic_compatible_ty public

Miri needs the same check for vararg shims, so let's make this function public so that Miri can reuse it.

r? @saethlin or @folkertdev
rust-bors Bot pushed a commit that referenced this pull request Aug 24, 2026
Rollup of 24 pull requests

Successful merges:

 - #161586 (miri subtree update)
 - #161187 (add `Complex<T>` layout tests for straightforward targets)
 - #161524 (Put back `tests/rustdoc-gui/search-result-display.goml`)
 - #161592 (core: refactor tests/pattern.rs tests)
 - #161602 (Fix flakyness issue for `tests/rustdoc-gui/headers-color.goml`)
 - #152433 (Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`)
 - #155254 (Recover on attribute in use tree)
 - #158695 (Replace `CrateDump` with the Debug impl from `CStore`)
 - #159456 (Fix the reporting of layout normalization failures in transmute checks)
 - #159940 (Eliminate some buggy `unreachable!()`s in `expand_[option_]env()`)
 - #160452 (-Ctarget-feature is not unsafe (any more))
 - #161007 (tests/ui/union/union-nodrop.rs: fix typo "expressios")
 - #161166 (add crashtests [5/N], remove unused aux files )
 - #161294 (add crashtests [6/N])
 - #161552 (also trigger overflow FCW when going from overflow -> error)
 - #161569 (Bump cfg_aliases to 0.2.2)
 - #161573 (re-bless `pretty-std` on windows)
 - #161580 (Add codegen test for redundant bit mask after a range check)
 - #161588 (update eyre)
 - #161589 (std: reduce visibility of some internal OsStr related types)
 - #161598 ([Bootstrap] Pass exact CI `llvm-config` executable path)
 - #161601 (Path: use optimized is_empty() method)
 - #161604 (coretests: Add a few tests for backward multibyte predicate)
 - #161615 (interpret: make validate_c_variadic_compatible_ty public)
rust-bors Bot pushed a commit that referenced this pull request Aug 24, 2026
Rollup of 22 pull requests

Successful merges:

 - #161586 (miri subtree update)
 - #161187 (add `Complex<T>` layout tests for straightforward targets)
 - #161524 (Put back `tests/rustdoc-gui/search-result-display.goml`)
 - #161592 (core: refactor tests/pattern.rs tests)
 - #161602 (Fix flakyness issue for `tests/rustdoc-gui/headers-color.goml`)
 - #152433 (Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`)
 - #155254 (Recover on attribute in use tree)
 - #158695 (Replace `CrateDump` with the Debug impl from `CStore`)
 - #159456 (Fix the reporting of layout normalization failures in transmute checks)
 - #159940 (Eliminate some buggy `unreachable!()`s in `expand_[option_]env()`)
 - #160452 (-Ctarget-feature is not unsafe (any more))
 - #161007 (tests/ui/union/union-nodrop.rs: fix typo "expressios")
 - #161552 (also trigger overflow FCW when going from overflow -> error)
 - #161569 (Bump cfg_aliases to 0.2.2)
 - #161573 (re-bless `pretty-std` on windows)
 - #161580 (Add codegen test for redundant bit mask after a range check)
 - #161588 (update eyre)
 - #161589 (std: reduce visibility of some internal OsStr related types)
 - #161598 ([Bootstrap] Pass exact CI `llvm-config` executable path)
 - #161601 (Path: use optimized is_empty() method)
 - #161604 (coretests: Add a few tests for backward multibyte predicate)
 - #161615 (interpret: make validate_c_variadic_compatible_ty public)
@rust-bors
rust-bors Bot merged commit 14e3364 into rust-lang:main Aug 24, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 24, 2026
Rollup merge of #161615 - RalfJung:vararg-check, r=folkertdev

interpret: make validate_c_variadic_compatible_ty public

Miri needs the same check for vararg shims, so let's make this function public so that Miri can reuse it.

r? @saethlin or @folkertdev
@RalfJung
RalfJung deleted the vararg-check branch August 24, 2026 12:32
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Aug 24, 2026
Rollup of 22 pull requests

Successful merges:

 - rust-lang/rust#161586 (miri subtree update)
 - rust-lang/rust#161187 (add `Complex<T>` layout tests for straightforward targets)
 - rust-lang/rust#161524 (Put back `tests/rustdoc-gui/search-result-display.goml`)
 - rust-lang/rust#161592 (core: refactor tests/pattern.rs tests)
 - rust-lang/rust#161602 (Fix flakyness issue for `tests/rustdoc-gui/headers-color.goml`)
 - rust-lang/rust#152433 (Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`)
 - rust-lang/rust#155254 (Recover on attribute in use tree)
 - rust-lang/rust#158695 (Replace `CrateDump` with the Debug impl from `CStore`)
 - rust-lang/rust#159456 (Fix the reporting of layout normalization failures in transmute checks)
 - rust-lang/rust#159940 (Eliminate some buggy `unreachable!()`s in `expand_[option_]env()`)
 - rust-lang/rust#160452 (-Ctarget-feature is not unsafe (any more))
 - rust-lang/rust#161007 (tests/ui/union/union-nodrop.rs: fix typo "expressios")
 - rust-lang/rust#161552 (also trigger overflow FCW when going from overflow -> error)
 - rust-lang/rust#161569 (Bump cfg_aliases to 0.2.2)
 - rust-lang/rust#161573 (re-bless `pretty-std` on windows)
 - rust-lang/rust#161580 (Add codegen test for redundant bit mask after a range check)
 - rust-lang/rust#161588 (update eyre)
 - rust-lang/rust#161589 (std: reduce visibility of some internal OsStr related types)
 - rust-lang/rust#161598 ([Bootstrap] Pass exact CI `llvm-config` executable path)
 - rust-lang/rust#161601 (Path: use optimized is_empty() method)
 - rust-lang/rust#161604 (coretests: Add a few tests for backward multibyte predicate)
 - rust-lang/rust#161615 (interpret: make validate_c_variadic_compatible_ty public)
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 28, 2026
Rollup of 22 pull requests

Successful merges:

 - rust-lang/rust#161586 (miri subtree update)
 - rust-lang/rust#161187 (add `Complex<T>` layout tests for straightforward targets)
 - rust-lang/rust#161524 (Put back `tests/rustdoc-gui/search-result-display.goml`)
 - rust-lang/rust#161592 (core: refactor tests/pattern.rs tests)
 - rust-lang/rust#161602 (Fix flakyness issue for `tests/rustdoc-gui/headers-color.goml`)
 - rust-lang/rust#152433 (Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`)
 - rust-lang/rust#155254 (Recover on attribute in use tree)
 - rust-lang/rust#158695 (Replace `CrateDump` with the Debug impl from `CStore`)
 - rust-lang/rust#159456 (Fix the reporting of layout normalization failures in transmute checks)
 - rust-lang/rust#159940 (Eliminate some buggy `unreachable!()`s in `expand_[option_]env()`)
 - rust-lang/rust#160452 (-Ctarget-feature is not unsafe (any more))
 - rust-lang/rust#161007 (tests/ui/union/union-nodrop.rs: fix typo "expressios")
 - rust-lang/rust#161552 (also trigger overflow FCW when going from overflow -> error)
 - rust-lang/rust#161569 (Bump cfg_aliases to 0.2.2)
 - rust-lang/rust#161573 (re-bless `pretty-std` on windows)
 - rust-lang/rust#161580 (Add codegen test for redundant bit mask after a range check)
 - rust-lang/rust#161588 (update eyre)
 - rust-lang/rust#161589 (std: reduce visibility of some internal OsStr related types)
 - rust-lang/rust#161598 ([Bootstrap] Pass exact CI `llvm-config` executable path)
 - rust-lang/rust#161601 (Path: use optimized is_empty() method)
 - rust-lang/rust#161604 (coretests: Add a few tests for backward multibyte predicate)
 - rust-lang/rust#161615 (interpret: make validate_c_variadic_compatible_ty public)
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.

4 participants