diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs b/tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs index 1726cf82e..60790e297 100644 --- a/tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs +++ b/tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs @@ -1,8 +1,15 @@ // check-pass +#![feature(const_trait_impl)] -type I32Cmp = fn(&i32, &i32) -> core::cmp::Ordering; -pub const fn min_by_i32() -> fn(i32, i32, I32Cmp) -> i32 { - core::cmp::min_by +#[const_trait] +pub trait Test {} + +impl Test for () {} + +pub const fn test<T: ~const Test>() {} + +pub const fn min_by_i32() -> fn() { + test::<()> } fn main() {} |