From dc328807315c15e1a20b3fdbd07174beb1cb11fe Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 29 Oct 2024 11:07:04 +0100 Subject: [PATCH] Add tests --- charon/tests/ui/pointers-in-consts.out | 9 +++++++++ charon/tests/ui/pointers-in-consts.rs | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 charon/tests/ui/pointers-in-consts.out create mode 100644 charon/tests/ui/pointers-in-consts.rs diff --git a/charon/tests/ui/pointers-in-consts.out b/charon/tests/ui/pointers-in-consts.out new file mode 100644 index 00000000..32e858f3 --- /dev/null +++ b/charon/tests/ui/pointers-in-consts.out @@ -0,0 +1,9 @@ +error: Unsupported constant: `ConstantExprKind::Cast {..}` + --> tests/ui/pointers-in-consts.rs:6:9 + | +6 | DISGUISED_INT => {} + | ^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + +ERROR Compilation encountered 1 errors diff --git a/charon/tests/ui/pointers-in-consts.rs b/charon/tests/ui/pointers-in-consts.rs new file mode 100644 index 00000000..caf7e792 --- /dev/null +++ b/charon/tests/ui/pointers-in-consts.rs @@ -0,0 +1,9 @@ +//@ known-failure +const DISGUISED_INT: *const () = 42 as _; + +fn bar() { + match 43 as *const () { + DISGUISED_INT => {} + _ => {} + } +}