diff options
Diffstat (limited to 'tests/ui/typeck/type-placeholder-fn-in-const.rs')
-rw-r--r-- | tests/ui/typeck/type-placeholder-fn-in-const.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/typeck/type-placeholder-fn-in-const.rs b/tests/ui/typeck/type-placeholder-fn-in-const.rs new file mode 100644 index 000000000..ab2e2d8c5 --- /dev/null +++ b/tests/ui/typeck/type-placeholder-fn-in-const.rs @@ -0,0 +1,14 @@ +struct MyStruct; + +trait Test { + const TEST: fn() -> _; + //~^ ERROR: the placeholder `_` is not allowed within types on item signatures for functions [E0121] + //~| ERROR: the placeholder `_` is not allowed within types on item signatures for constants [E0121] +} + +impl Test for MyStruct { + const TEST: fn() -> _ = 42; + //~^ ERROR: the placeholder `_` is not allowed within types on item signatures for functions [E0121] +} + +fn main() {} |