summaryrefslogtreecommitdiffstats
path: root/src/test/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs')
-rw-r--r--src/test/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs b/src/test/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs
new file mode 100644
index 000000000..9b80664b0
--- /dev/null
+++ b/src/test/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs
@@ -0,0 +1,18 @@
+// run-pass
+
+#![allow(dead_code)]
+// Tests that even when a type parameter doesn't implement a required
+// super-builtin-kind of a trait, if the type parameter is never used,
+// the type can implement the trait anyway.
+
+// pretty-expanded FIXME #23616
+
+use std::marker;
+
+trait Foo : Send { }
+
+struct X<T> { marker: marker::PhantomData<T> }
+
+impl<T:Send> Foo for X<T> { }
+
+pub fn main() { }