about summary refs log tree commit diff
path: root/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs')
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs b/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs
new file mode 100644
index 00000000000..ae81421e9e1
--- /dev/null
+++ b/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs
@@ -0,0 +1,26 @@
+// check-pass
+
+#![feature(const_trait_impl)]
+
+#[const_trait]
+trait Tr {
+    fn req(&self);
+
+    fn default() {}
+}
+
+impl const Tr for u8 {
+    fn req(&self) {}
+}
+
+macro_rules! impl_tr {
+    ($ty: ty) => {
+        impl const Tr for $ty {
+            fn req(&self) {}
+        }
+    }
+}
+
+impl_tr!(u64);
+
+fn main() {}