about summary refs log tree commit diff
path: root/tests/ui/consts/const-block-const-bound.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-block-const-bound.rs')
-rw-r--r--tests/ui/consts/const-block-const-bound.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/consts/const-block-const-bound.rs b/tests/ui/consts/const-block-const-bound.rs
new file mode 100644
index 00000000000..42aa0216b87
--- /dev/null
+++ b/tests/ui/consts/const-block-const-bound.rs
@@ -0,0 +1,25 @@
+#![allow(unused)]
+#![feature(const_trait_impl, inline_const, negative_impls)]
+
+use std::marker::Destruct;
+
+const fn f<T: ~const Destruct>(x: T) {}
+
+struct UnconstDrop;
+
+impl Drop for UnconstDrop {
+    fn drop(&mut self) {}
+}
+
+struct NonDrop;
+
+impl !Drop for NonDrop {}
+
+fn main() {
+    const {
+        f(UnconstDrop);
+        //~^ ERROR can't drop
+        f(NonDrop);
+        //~^ ERROR can't drop
+    }
+}