about summary refs log tree commit diff
path: root/tests/ui/repeat-expr/infer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/repeat-expr/infer.rs')
-rw-r--r--tests/ui/repeat-expr/infer.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/repeat-expr/infer.rs b/tests/ui/repeat-expr/infer.rs
new file mode 100644
index 00000000000..8197713b97e
--- /dev/null
+++ b/tests/ui/repeat-expr/infer.rs
@@ -0,0 +1,16 @@
+// check-pass
+
+#[derive(Clone, Default)]
+struct MaybeCopy<T>(T);
+
+impl Copy for MaybeCopy<u8> {}
+
+fn is_copy<T: Copy>(x: T) {
+    println!("{}", std::any::type_name::<T>());
+}
+
+fn main() {
+    is_copy(MaybeCopy::default());
+    [MaybeCopy::default(); 13];
+    // didn't work, because `Copy` was only checked in the mir
+}