From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../const-extern-fn-call-extern-fn.rs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs (limited to 'tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs') diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs b/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs new file mode 100644 index 000000000..eccda49db --- /dev/null +++ b/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs @@ -0,0 +1,23 @@ +#![feature(const_extern_fn)] + +extern "C" { + fn regular_in_block(); +} + +const extern "C" fn bar() { + unsafe { + regular_in_block(); + //~^ ERROR: cannot call non-const fn + } +} + +extern "C" fn regular() {} + +const extern "C" fn foo() { + unsafe { + regular(); + //~^ ERROR: cannot call non-const fn + } +} + +fn main() {} -- cgit v1.2.3