about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2019-04-18 00:30:27 +0100
committervarkor <github@varkor.com>2019-04-18 00:30:50 +0100
commit318a10e9067408b0010804fe80c9dc99f3ad8c65 (patch)
treeac44ee698b1ec34b6d4aab67482343c2cbd87760
parent15033a9ba74fbe585f5571cd82a1241cc2e865c2 (diff)
downloadrust-318a10e9067408b0010804fe80c9dc99f3ad8c65.tar.gz
rust-318a10e9067408b0010804fe80c9dc99f3ad8c65.zip
Add a test for unused const parameters
-rw-r--r--src/test/ui/const-generics/unused-const-param.rs8
-rw-r--r--src/test/ui/const-generics/unused-const-param.stderr6
2 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/unused-const-param.rs b/src/test/ui/const-generics/unused-const-param.rs
new file mode 100644
index 00000000000..ee98e5eb4a0
--- /dev/null
+++ b/src/test/ui/const-generics/unused-const-param.rs
@@ -0,0 +1,8 @@
+// run-pass
+
+#![feature(const_generics)]
+//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
+
+struct A<const N: usize>; // ok
+
+fn main() {}
diff --git a/src/test/ui/const-generics/unused-const-param.stderr b/src/test/ui/const-generics/unused-const-param.stderr
new file mode 100644
index 00000000000..0e7acfb673d
--- /dev/null
+++ b/src/test/ui/const-generics/unused-const-param.stderr
@@ -0,0 +1,6 @@
+warning: the feature `const_generics` is incomplete and may cause the compiler to crash
+  --> $DIR/unused-const-param.rs:3:12
+   |
+LL | #![feature(const_generics)]
+   |            ^^^^^^^^^^^^^^
+