summaryrefslogtreecommitdiffstats
path: root/tests/ui/variance/variance-regions-unused-direct.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/variance/variance-regions-unused-direct.rs')
-rw-r--r--tests/ui/variance/variance-regions-unused-direct.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/variance/variance-regions-unused-direct.rs b/tests/ui/variance/variance-regions-unused-direct.rs
new file mode 100644
index 000000000..2afe012bd
--- /dev/null
+++ b/tests/ui/variance/variance-regions-unused-direct.rs
@@ -0,0 +1,15 @@
+// Test that disallow lifetime parameters that are unused.
+
+use std::marker;
+
+struct Bivariant<'a>; //~ ERROR parameter `'a` is never used
+
+struct Struct<'a, 'd> { //~ ERROR parameter `'d` is never used
+ field: &'a [i32]
+}
+
+trait Trait<'a, 'd> { // OK on traits
+ fn method(&'a self);
+}
+
+fn main() {}