mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
784f04b367
C-variadic error improvements A couple improvements for c-variadic errors: 1. Fix the bad-c-variadic error being emitted multiple times. If a function incorrectly contains multiple `...` args, and is also not foreign or `unsafe extern "C"`, only emit the latter error once rather than once per `...`. 2. Explicitly reject `const` C-variadic functions. Trying to use C-variadics in a const function would previously fail with an error like "destructor of `VaListImpl<'_>` cannot be evaluated at compile-time". Add an explicit check for const C-variadics to provide a clearer error: "functions cannot be both `const` and C-variadic". This also addresses one of the concerns in https://github.com/rust-lang/rust/issues/44930: "Ensure that even when this gets stabilized for regular functions, it is still rejected on const fn." |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |