about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/Linker.cpp
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-10-30 17:33:17 +0100
committerGitHub <noreply@github.com>2023-10-30 17:33:17 +0100
commit784f04b36751c0659292ab4f372105b4eab96331 (patch)
treed941492f18e69a9fd85348bd29de13d5a19bd95e /compiler/rustc_llvm/llvm-wrapper/Linker.cpp
parent5ac999f1339adedd359eca1e0f5425fa63ee624a (diff)
parentf91b5ceaf2568c38afc5a4b7c82459ca3d857998 (diff)
downloadrust-784f04b36751c0659292ab4f372105b4eab96331.tar.gz
rust-784f04b36751c0659292ab4f372105b4eab96331.zip
Rollup merge of #117370 - nicholasbishop:bishop-better-c-variadic-errors, r=oli-obk
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."
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/Linker.cpp')
0 files changed, 0 insertions, 0 deletions