diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs b/src/test/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs new file mode 100644 index 000000000..ae81421e9 --- /dev/null +++ b/src/test/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() {} |