summaryrefslogtreecommitdiffstats
path: root/src/test/ui/typeck/type-placeholder-fn-in-const.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/typeck/type-placeholder-fn-in-const.rs')
-rw-r--r--src/test/ui/typeck/type-placeholder-fn-in-const.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/typeck/type-placeholder-fn-in-const.rs b/src/test/ui/typeck/type-placeholder-fn-in-const.rs
new file mode 100644
index 000000000..ab2e2d8c5
--- /dev/null
+++ b/src/test/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() {}