diff options
Diffstat (limited to 'tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs')
-rw-r--r-- | tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs new file mode 100644 index 000000000..52984fb6b --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs @@ -0,0 +1,16 @@ +#![feature(const_trait_impl)] + +struct S; +#[const_trait] +trait T { + fn foo(); +} + +fn non_const() {} + +impl const T for S { + fn foo() { non_const() } + //~^ ERROR cannot call non-const fn +} + +fn main() {} |