Skip to content

Add extra types to VaArgSafe - #162858

Open
clarfonthey wants to merge 1 commit into
rust-lang:mainfrom
clarfonthey:va-arg-refs
Open

clarfonthey wants to merge 1 commit into
rust-lang:mainfrom
clarfonthey:va-arg-refs

Conversation

@clarfonthey

@clarfonthey clarfonthey commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

View all comments

Option 3 as proposed by @RalfJung here: #162478 (comment)

This adds the following types to VaArgSafe:

  • Reference equivalents to the same pointers (it's still unsafe to get next_arg)
  • NonNull<T> (for similar reasons)
  • Option<NonNull<T>> (since it's ABI-compatible)
  • NonZero<T> (since it's ABI-compatible)
  • Option<NonZero<T>> (since it's ABI-compatible)

Additionally, as part of implementing this in the compiler, NonZero is promoted from a diagnostic item to a lang item. I'm under the impression this is fine since we're already doing a lang FCP (and none of the lang folks have chimed in yet) but it's worth mentioning.

Also have a Zulip thread for the compiler impl: #t-compiler/help > `VaArgSafe` change + random `Ty` questions @ 💬

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 16, 2026
@clarfonthey clarfonthey added the T-lang Relevant to the language team label Sep 16, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor Author

@rfcbot merge libs,lang

@rust-rfcbot

rust-rfcbot commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

@clarfonthey has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label Sep 16, 2026
@clarfonthey
clarfonthey marked this pull request as ready for review September 16, 2026 17:15
@rust-rfcbot rust-rfcbot added the disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. label Sep 16, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 16, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 16, 2026
@rustbot

rustbot commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

r? @Darksonn

rustbot has assigned @Darksonn.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from Darksonn, JohnTitor, Mark-Simulacrum, aapoalas, jhpratt

@clarfonthey clarfonthey changed the title Add thin references and pointers to VaArgSafe Add extra types to VaArgSafe Sep 16, 2026
@nia-e

nia-e commented Sep 16, 2026

Copy link
Copy Markdown
Member

The docs for VaArgSafe::next_arg currently say

Currently, all types implementing VaArgSafe also implement Copy, but this may change in the future.

this should also be adjusted, but otherwise yeah this makes sense.

@rfcbot reviewed

@clarfonthey
clarfonthey force-pushed the va-arg-refs branch 2 times, most recently from b020d39 to f84f398 Compare September 16, 2026 17:24
@clarfonthey

Copy link
Copy Markdown
Contributor Author

Updated docs to remove note on everything being Copy, also added NonZero and NonNull per discussion in lang meeting.

@clarfonthey clarfonthey added the I-lang-nominated Nominated for discussion during a lang team meeting. label Sep 16, 2026
@traviscross traviscross added P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang I-lang-radar Items that are on lang's radar and will need eventual work or consideration. labels Sep 16, 2026
@steffahn

Copy link
Copy Markdown
Member

The safety comments of next_arg would also need to be updated to cover all the new types.

@folkertdev folkertdev Sep 16, 2026

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.

Can you add tests for these in tests/ui/c-variadic/roundtrip.rs?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The result is very cursed but hopefully still achieves the desired result. Would appreciate an explicit review on those.

@rust-log-analyzer

This comment has been minimized.

Comment thread library/core/src/ffi/va_list.rs Outdated
Comment on lines +420 to +436
#[stable(feature = "c_variadic_nonzero", since = "CURRENT_RUSTC_VERSION")]
unsafe impl<T: ZeroablePrimitive + VaArgSafe> VaArgSafe for NonZero<T> {}
#[stable(feature = "c_variadic_nonzero", since = "CURRENT_RUSTC_VERSION")]
unsafe impl<T: ZeroablePrimitive + VaArgSafe> VaArgSafe for Option<NonZero<T>> {}

#[stable(feature = "c_variadic_nonnull", since = "1.99.0")]
unsafe impl<T> VaArgSafe for NonNull<T> {}
#[stable(feature = "c_variadic_nonnull", since = "1.99.0")]
unsafe impl<T> VaArgSafe for Option<NonNull<T>> {}
#[stable(feature = "c_variadic", since = "1.99.0")]
unsafe impl<T> VaArgSafe for *mut T {}
#[stable(feature = "c_variadic", since = "1.99.0")]
unsafe impl<T> VaArgSafe for *const T {}
#[stable(feature = "c_variadic_refs", since = "CURRENT_RUSTC_VERSION")]
unsafe impl<T> VaArgSafe for &mut T {}
#[stable(feature = "c_variadic_refs", since = "CURRENT_RUSTC_VERSION")]
unsafe impl<T> VaArgSafe for &T {}

@RalfJung RalfJung Sep 16, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume the intent is that e.g. NonNull<T> is compatible with *mut T. That will need adjustments in the docs and corresponding adjustments in the const-eval / Miri checking logic.

View changes since the review

@clarfonthey clarfonthey Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought that we already had this guarantee, but if we don't, I would rather not overcomplicate this PR and can remove it. (Note: this only needs to hold for sized pointees.)

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.

Rust guarantees they have the same layout, so it's just the docs of next_arg that should document that this equivalence applies here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same layout != same ABI.
But we also guarantee that they have the same ABI.

This applies to most of your additions, e.g. NonZero<i32> vs i32.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So, looking at the docs:

Unlike *mut T, the pointer must always be non-null, even if the pointer is never dereferenced. This is so that enums may use this forbidden value as a discriminant – Option<NonNull> has the same size as *mut T. However the pointer may still dangle if it isn’t dereferenced.

That feels pretty much like an explicit guarantee that *mut T, NonNull<T>, and Option<NonNull<T>> are layout-compatible, but I guess we should probably make it more explicit in the reference.

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.

From my understanding, variadic arguments simply require layout compatibility, since for example i32 and u32 are interchangeable in them.

If only :)

The comment on next_arg goes into detail on what it means for types to be compatible. It is much more subtle than layout compatibility. E.g. i32 and u32 are only compatible if the runtime value is representable in both types. (so like 3 is compatible but -3 is not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, yes, that is cursed.

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.

Morally the same is true for the nonzero types and references (which cannot be NULL), but those requirements are already captured by the type itself in these new cases.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The docs very explicitly say

The actual type of the argument U is compatible with T (as defined below).

So without changing the docs, if the caller uses NonZeroI32 and the callee uses next_arg::<i32>(), we very clearly have UB. (NonZeroI32 is not an "integer type". That term refers to primitive types, iN and uN.)

@clarfonthey clarfonthey Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I did explicitly go through and update the docs for those cases: the general rule for those is that if not all bit patterns are valid, you are guaranteeing that you have passed a valid bit pattern, at risk of UB.

@clarfonthey
clarfonthey force-pushed the va-arg-refs branch 2 times, most recently from 2d31c99 to ba1acb2 Compare September 16, 2026 17:55
@rust-log-analyzer

This comment has been minimized.

@theemathas

Copy link
Copy Markdown
Contributor

@theemathas

Copy link
Copy Markdown
Contributor

PR for destabilizing VaArgSafe: #162909

@Darksonn Darksonn 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 Sep 17, 2026
@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@clarfonthey
clarfonthey force-pushed the va-arg-refs branch 2 times, most recently from 6c40ebc to b8c0d1d Compare September 18, 2026 14:28
@rustbot

rustbot commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred in compiler/rustc_attr_ir

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Sep 18, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@RalfJung RalfJung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CTFE code looks good, thanks. :)
I think long-term it may make sense to harmonize this with the usual ABI compatibility rules but we can take baby steps here.

View changes since this review

Comment thread compiler/rustc_const_eval/src/interpret/intrinsics.rs Outdated
Comment thread compiler/rustc_const_eval/src/interpret/intrinsics.rs
Comment thread compiler/rustc_const_eval/src/interpret/intrinsics.rs
Comment thread compiler/rustc_const_eval/src/interpret/intrinsics.rs
Comment thread compiler/rustc_const_eval/src/interpret/intrinsics.rs Outdated
Comment thread library/core/src/ffi/va_list.rs Outdated
Comment thread library/core/src/ffi/va_list.rs Outdated
@clarfonthey

Copy link
Copy Markdown
Contributor Author

Because I'm feeling particularly spicy, is there a reason we shouldn't support char and NonZero<char> as well?

Since we're already allowing invalid bit patterns, might as well.

@steffahn

Copy link
Copy Markdown
Member

char is not even considered FFI safe to begin with

warning: `extern` fn uses type `char`, which is not FFI-safe
 --> src/lib.rs:3:20
  |
1 | extern "C" fn f(_: char) {} 
  |                    ^^^^ not FFI-safe
  |
  = help: consider using `u32` or `libc::wchar_t` instead
  = note: the `char` type has no C equivalent
  = note: `#[warn(improper_ctypes_definitions)]` on by default

@clarfonthey

Copy link
Copy Markdown
Contributor Author

Never mind, then. That makes that easy.

@rustbot

rustbot commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

@RalfJung RalfJung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Congrats, you managed to achieve what many thought was impossible -- you made me think "that feels almost like there's too many comments here now." ;)

(Not really, it's fine, just more than I wold have written.)

Also when comments are full sentences please end them in a period. Too often have I seen people add more sentences to such comments without adding the periods which makes for extremely confusing times.

View changes since this review

}

match self.tcx.tcx.as_lang_item(adt.did()) {
// `NonNull` is allowed as just a pointer with fewer an alid values

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// `NonNull` is allowed as just a pointer with fewer an alid values
// `NonNull` is allowed as just a pointer with fewer valid values.

I assume?

if self.layout_of(caller_type)?.size != self.layout_of(callee_type)?.size {
// All other cases require that the layout of the types match;
// in practice, since the only types that could get to this point are integers and pointers,
// the alignment check isn't necessary, but might as well verify

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// the alignment check isn't necessary, but might as well verify
// the alignment check isn't necessary, but might as well verify.

let is_c_char = |ty: Ty<'_>| matches!(ty.kind(), ty::Uint(UintTy::U8) | ty::Int(IntTy::I8));
// Since we've already checked for identical types and have narrowed down the layouts as
// being identical, we can filter out any non-integer, non-pointer types and similarly
// normalize integer and pointer types to make matching easier

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// normalize integer and pointer types to make matching easier
// normalize integer and pointer types to make matching easier.

Comment on lines +1004 to +1007
if (caller_target_ty.is_c_void(self.tcx.tcx)
|| callee_target_ty.is_c_void(self.tcx.tcx))
&& (caller_target_ty.is_byte_sized_integral()
|| callee_target_ty.is_byte_sized_integral())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the version with the && inside and the || outside would be easier to match up with the text from the C standard that we are quoting above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair; I mostly just wanted to cover the case where the types were the same but technically under this condition without having to do any recursion.

// Note: we already know that the layout is identical
if caller_signed == callee_signed {
// So, if the signedness is the same, this means that one of the types is
// `usize` or `isize`, which have the same ABI as their same-layout counterparts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// `usize` or `isize`, which have the same ABI as their same-layout counterparts
// `usize` or `isize`, which have the same ABI as their same-layout counterparts.

interp_ok(VarArgCompatible::Compatible)
} else {
// And if the signedness is different, this means that we're casting by changing
// the sign but not the size of the integer type, which is fine

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// the sign but not the size of the integer type, which is fine
// the sign but not the size of the integer type, which is fine.

// - "or, the type of the next argument is nullptr_t and type is a pointer type that has the same
// representation and alignment requirements as a pointer to a character type"
// This one does not have an equivalent form in Rust.
_ => interp_ok(VarArgCompatible::Incompatible),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The fallback arm still exists, you just reordered it wrt the comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, fair. I guess that my thought process was that the branch was covering more before, but, not really.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- [ui] tests/ui/c-variadic/roundtrip.rs stdout ----

error: test did not exit with success! code=None so test would pass with `run-crash`
status: signal: 6 (SIGABRT) (core dumped)
command: cd "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/c-variadic/roundtrip" && RUSTC="/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" RUST_TEST_THREADS="4" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/c-variadic/roundtrip/a"
stdout: none
--- stderr -------------------------------

thread 'main' (40062) panicked at /checkout/tests/ui/c-variadic/roundtrip.rs:33:5:
assertion failed: ap.next_arg::<u32>() == 0xAAAA_AAAA
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' (40062) panicked at library/core/src/panicking.rs:225:5:
panic in a function that cannot unwind
stack backtrace:
---
   4:     0xff746cd8c950 - std[ed984737de44978e]::panicking::default_hook
   5:     0xff746cd8cdc4 - std[ed984737de44978e]::panicking::panic_with_hook
   6:     0xff746cd65624 - std[ed984737de44978e]::panicking::panic_handler::{closure#0}
   7:     0xff746cd585dc - std[ed984737de44978e]::sys::backtrace::__rust_end_short_backtrace::<std[ed984737de44978e]::panicking::panic_handler::{closure#0}, !>
   8:     0xff746cd67444 - __rustc[58b66a6159f8e6fd]::rust_begin_unwind
   9:     0xff746cd48770 - core[60c3db2fddfd9e0]::panicking::panic_nounwind_fmt
  10:     0xff746cd48684 - core[60c3db2fddfd9e0]::panicking::panic_nounwind
  11:     0xff746cd48850 - core[60c3db2fddfd9e0]::panicking::panic_cannot_unwind
  12:     0xab99e1e328f4 - roundtrip[2ae0f7d716a9c1b5]::variadic::<core[60c3db2fddfd9e0]::option::Option<core[60c3db2fddfd9e0]::num::nonzero::NonZero<i32>>>
  13:     0xab99e1e332b8 - roundtrip[2ae0f7d716a9c1b5]::main
  14:     0xab99e1e33224 - std[ed984737de44978e]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  15:     0xab99e1e3323c - std[ed984737de44978e]::rt::lang_start::<()>::{closure#0}
  16:     0xff746cd8ae1c - std[ed984737de44978e]::rt::lang_start_internal
  17:     0xab99e1e35334 - main
  18:     0xff746cb1259c - <unknown>
---

978    |
979    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
980 
- error[E0080]: constructing invalid value of type [u8; 24]: at [8], encountered a pointer, but expected an integer
+ error[E0080]: constructing invalid value of type [u8; 32]: at [0], encountered a pointer, but expected an integer
982   --> $DIR/c-variadic-fail.rs:202:22
983    |
984 LL |             let ap = helper(1, 2, 3);


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args consts/const-eval/c-variadic-fail.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/consts/const-eval/c-variadic-fail.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-eval/c-variadic-fail" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-Zextra-const-ub-checks"
stdout: none
--- stderr -------------------------------
error[E0080]: more C-variadic arguments read than were passed
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:30:13
   |
LL |     const { read_n::<1>() }
   |             ^^^^^^^^^^^^^ evaluation of `read_too_many::{constant#2}` failed inside this call
   |
note: inside `read_n::<1>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:18:17
   |
LL |         let _ = ap.next_arg::<i32>();
   |                 ^^^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<i32>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:30:5
   |
LL |     const { read_n::<1>() }
   |     ^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:30:5
   |
LL |     const { read_n::<1>() }
   |     ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: more C-variadic arguments read than were passed
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:34:13
   |
LL |     const { read_n::<2>(1) }
   |             ^^^^^^^^^^^^^^ evaluation of `read_too_many::{constant#3}` failed inside this call
   |
note: inside `read_n::<2>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:18:17
   |
LL |         let _ = ap.next_arg::<i32>();
   |                 ^^^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<i32>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:34:5
   |
LL |     const { read_n::<2>(1) }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:34:5
   |
LL |     const { read_n::<2>(1) }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg value mismatch: value `-1_i32` cannot be represented by type `u32`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:74:13
   |
LL |     const { read_as::<u32>(-1i32) };
   |             ^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_numeric::{constant#12}` failed inside this call
   |
note: inside `read_as::<u32>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<u32>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:74:5
   |
LL |     const { read_as::<u32>(-1i32) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:74:5
   |
LL |     const { read_as::<u32>(-1i32) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg value mismatch: value `-2147483648_i32` cannot be represented by type `u32`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:76:13
   |
LL |     const { read_as::<u32>(i32::MIN) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_numeric::{constant#13}` failed inside this call
   |
note: inside `read_as::<u32>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<u32>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:76:5
   |
LL |     const { read_as::<u32>(i32::MIN) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:76:5
   |
LL |     const { read_as::<u32>(i32::MIN) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg value mismatch: value `4294967295_u32` cannot be represented by type `i32`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:78:13
   |
LL |     const { read_as::<i32>(u32::MAX) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_numeric::{constant#14}` failed inside this call
   |
note: inside `read_as::<i32>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<i32>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:78:5
   |
LL |     const { read_as::<i32>(u32::MAX) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:78:5
   |
LL |     const { read_as::<i32>(u32::MAX) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg value mismatch: value `2147483648_u32` cannot be represented by type `i32`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:80:13
   |
LL |     const { read_as::<i32>(i32::MAX as u32 + 1) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_numeric::{constant#15}` failed inside this call
   |
note: inside `read_as::<i32>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<i32>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:80:5
   |
LL |     const { read_as::<i32>(i32::MAX as u32 + 1) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:80:5
   |
LL |     const { read_as::<i32>(i32::MAX as u32 + 1) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg value mismatch: value `18446744073709551615_u64` cannot be represented by type `i64`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:82:13
   |
LL |     const { read_as::<i64>(u64::MAX) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_numeric::{constant#16}` failed inside this call
   |
note: inside `read_as::<i64>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<i64>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:82:5
   |
LL |     const { read_as::<i64>(u64::MAX) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:82:5
   |
LL |     const { read_as::<i64>(u64::MAX) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg value mismatch: value `9223372036854775808_u64` cannot be represented by type `i64`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:84:13
   |
LL |     const { read_as::<i64>(i64::MAX as u64 + 1) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_numeric::{constant#17}` failed inside this call
   |
note: inside `read_as::<i64>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<i64>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:84:5
   |
LL |     const { read_as::<i64>(i64::MAX as u64 + 1) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:84:5
   |
LL |     const { read_as::<i64>(i64::MAX as u64 + 1) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg type mismatch: requested `i32` is incompatible with next argument of type `u64`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:87:13
   |
LL |     const { read_as::<i32>(1u64) };
   |             ^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_numeric::{constant#18}` failed inside this call
   |
note: inside `read_as::<i32>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<i32>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:87:5
   |
LL |     const { read_as::<i32>(1u64) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:87:5
   |
LL |     const { read_as::<i32>(1u64) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg type mismatch: requested `f64` is incompatible with next argument of type `i32`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:90:13
   |
LL |     const { read_as::<f64>(1i32) };
   |             ^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_numeric::{constant#19}` failed inside this call
   |
note: inside `read_as::<f64>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<f64>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:90:5
   |
LL |     const { read_as::<f64>(1i32) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:90:5
   |
LL |     const { read_as::<f64>(1i32) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg type mismatch: requested `*const u16` is incompatible with next argument of type `*const c_void`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:113:13
   |
LL |     const { read_as::<*const u16>(ptr::dangling::<c_void>()) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_pointer::{constant#12}` failed inside this call
   |
note: inside `read_as::<*const u16>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<*const u16>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:113:5
   |
LL |     const { read_as::<*const u16>(ptr::dangling::<c_void>()) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:113:5
   |
LL |     const { read_as::<*const u16>(ptr::dangling::<c_void>()) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg type mismatch: requested `*const c_void` is incompatible with next argument of type `*const u16`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:115:13
   |
LL |     const { read_as::<*const c_void>(ptr::dangling::<u16>()) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_pointer::{constant#13}` failed inside this call
   |
note: inside `read_as::<*const c_void>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<*const c_void>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:115:5
   |
LL |     const { read_as::<*const c_void>(ptr::dangling::<u16>()) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:115:5
   |
LL |     const { read_as::<*const c_void>(ptr::dangling::<u16>()) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg type mismatch: requested `*const u16` is incompatible with next argument of type `*const i32`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:117:13
   |
LL |     const { read_as::<*const u16>(ptr::dangling::<i32>()) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_pointer::{constant#14}` failed inside this call
   |
note: inside `read_as::<*const u16>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<*const u16>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:117:5
   |
LL |     const { read_as::<*const u16>(ptr::dangling::<i32>()) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:117:5
   |
LL |     const { read_as::<*const u16>(ptr::dangling::<i32>()) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: va_arg type mismatch: requested `*const u8` is incompatible with next argument of type `usize`
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:120:13
   |
LL |     const { read_as::<*const u8>(1usize) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_pointer::{constant#15}` failed inside this call
   |
note: inside `read_as::<*const u8>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<*const u8>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:120:5
   |
LL |     const { read_as::<*const u8>(1usize) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:120:5
   |
LL |     const { read_as::<*const u8>(1usize) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: constructing invalid value of type NonNull<c_void>: at .pointer, encountered 0, but expected something greater or equal to 1
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:125:13
   |
LL |     const { read_as::<NonNull<c_void>>(ptr::null::<c_void>()) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_null::{constant#0}` failed inside this call
   |
note: inside `read_as::<NonNull<c_void>>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<NonNull<c_void>>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:125:5
   |
LL |     const { read_as::<NonNull<c_void>>(ptr::null::<c_void>()) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:125:5
   |
LL |     const { read_as::<NonNull<c_void>>(ptr::null::<c_void>()) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: constructing invalid value of type NonNull<c_void>: at .pointer, encountered 0, but expected something greater or equal to 1
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:127:13
   |
LL |     const { read_as::<NonNull<c_void>>(ptr::null_mut::<c_void>()) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_null::{constant#1}` failed inside this call
   |
note: inside `read_as::<NonNull<c_void>>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<NonNull<c_void>>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:127:5
   |
LL |     const { read_as::<NonNull<c_void>>(ptr::null_mut::<c_void>()) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:127:5
   |
LL |     const { read_as::<NonNull<c_void>>(ptr::null_mut::<c_void>()) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: constructing invalid value of type NonNull<c_void>: at .pointer, encountered 0, but expected something greater or equal to 1
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:129:13
   |
LL |     const { read_as::<NonNull<c_void>>(None::<NonNull<c_void>>) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast_null::{constant#2}` failed inside this call
   |
note: inside `read_as::<NonNull<c_void>>`
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:39:5
   |
LL |     ap.next_arg::<T>()
   |     ^^^^^^^^^^^^^^^^^^
note: inside `VaList::<'_>::next_arg::<NonNull<c_void>>`
  --> /rustc/FAKE_PREFIX/library/core/src/ffi/va_list.rs:544:17

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:129:5
   |
LL |     const { read_as::<NonNull<c_void>>(None::<NonNull<c_void>>) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:129:5
   |
LL |     const { read_as::<NonNull<c_void>>(None::<NonNull<c_void>>) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0080]: constructing invalid value of type NonNull<c_void>: at .pointer, encountered 0, but expected something greater or equal to 1
##[error]  --> /checkout/tests/ui/consts/const-eval/c-variadic-fail.rs:131:13
   |
LL |     const { read_as::<NonNull<c_void>>(None::<NonNull<c_void>>) };
---

---- [ui] tests/ui/consts/const-eval/c-variadic-fail.rs stdout end ----
---- [ui] tests/ui/consts/const-eval/c-variadic.rs stdout ----

error: test did not exit with success! code=None so test would pass with `run-crash`
status: signal: 11 (SIGSEGV) (core dumped)
command: cd "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-eval/c-variadic" && RUSTC="/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" RUST_TEST_THREADS="4" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-eval/c-variadic/a"
stdout: none
stderr: none

---- [ui] tests/ui/consts/const-eval/c-variadic.rs stdout end ----

/// - [`c_int`], [`c_long`] and [`c_longlong`]
/// - [`c_uint`], [`c_ulong`] and [`c_ulonglong`]
/// - [`c_double`]
/// - `*const T` and `*mut T`

@Mark-Simulacrum Mark-Simulacrum Sep 20, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should probably expand this with the new types we guarantee impls for.

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. I-lang-nominated Nominated for discussion during a lang team meeting. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. I-libs-nominated Nominated for discussion during a libs team meeting. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-lang Relevant to the language team T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.