summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/issue-43197.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-eval/issue-43197.rs')
-rw-r--r--tests/ui/consts/const-eval/issue-43197.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/consts/const-eval/issue-43197.rs b/tests/ui/consts/const-eval/issue-43197.rs
new file mode 100644
index 000000000..145463f0a
--- /dev/null
+++ b/tests/ui/consts/const-eval/issue-43197.rs
@@ -0,0 +1,11 @@
+const fn foo(x: u32) -> u32 {
+ x
+}
+
+fn main() {
+ const X: u32 = 0 - 1;
+ //~^ ERROR constant
+ const Y: u32 = foo(0 - 1);
+ //~^ ERROR constant
+ println!("{} {}", X, Y);
+}