about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-04-12 07:28:07 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-04-28 09:20:27 +0000
commitbc14b6bea6a410f11a7ea5db84ad753673b78150 (patch)
tree709d348d5ad6a0eba695a41995058c7fa620193d
parent4e6e68e27a36f38da58dcbadd31c8f5d591f4571 (diff)
downloadrust-bc14b6bea6a410f11a7ea5db84ad753673b78150.tar.gz
rust-bc14b6bea6a410f11a7ea5db84ad753673b78150.zip
Add new repeat expr test.
Also add repeat expr test folder and move all related tests to it
-rw-r--r--src/test/ui/repeat-expr/infer.rs16
-rw-r--r--src/test/ui/repeat-expr/repeat-expr-in-static.rs (renamed from src/test/ui/repeat-expr-in-static.rs)0
-rw-r--r--src/test/ui/repeat-expr/repeat-to-run-dtor-twice.rs (renamed from src/test/ui/repeat-to-run-dtor-twice.rs)0
-rw-r--r--src/test/ui/repeat-expr/repeat-to-run-dtor-twice.stderr (renamed from src/test/ui/repeat-to-run-dtor-twice.stderr)0
-rw-r--r--src/test/ui/repeat-expr/repeat_count.rs (renamed from src/test/ui/repeat_count.rs)0
-rw-r--r--src/test/ui/repeat-expr/repeat_count.stderr (renamed from src/test/ui/repeat_count.stderr)0
-rw-r--r--src/tools/tidy/src/ui_tests.rs2
7 files changed, 17 insertions, 1 deletions
diff --git a/src/test/ui/repeat-expr/infer.rs b/src/test/ui/repeat-expr/infer.rs
new file mode 100644
index 00000000000..8197713b97e
--- /dev/null
+++ b/src/test/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
+}
diff --git a/src/test/ui/repeat-expr-in-static.rs b/src/test/ui/repeat-expr/repeat-expr-in-static.rs
index 0b895379330..0b895379330 100644
--- a/src/test/ui/repeat-expr-in-static.rs
+++ b/src/test/ui/repeat-expr/repeat-expr-in-static.rs
diff --git a/src/test/ui/repeat-to-run-dtor-twice.rs b/src/test/ui/repeat-expr/repeat-to-run-dtor-twice.rs
index 0cd8eceefc5..0cd8eceefc5 100644
--- a/src/test/ui/repeat-to-run-dtor-twice.rs
+++ b/src/test/ui/repeat-expr/repeat-to-run-dtor-twice.rs
diff --git a/src/test/ui/repeat-to-run-dtor-twice.stderr b/src/test/ui/repeat-expr/repeat-to-run-dtor-twice.stderr
index fd64ce8bcea..fd64ce8bcea 100644
--- a/src/test/ui/repeat-to-run-dtor-twice.stderr
+++ b/src/test/ui/repeat-expr/repeat-to-run-dtor-twice.stderr
diff --git a/src/test/ui/repeat_count.rs b/src/test/ui/repeat-expr/repeat_count.rs
index 96abff4ab41..96abff4ab41 100644
--- a/src/test/ui/repeat_count.rs
+++ b/src/test/ui/repeat-expr/repeat_count.rs
diff --git a/src/test/ui/repeat_count.stderr b/src/test/ui/repeat-expr/repeat_count.stderr
index 59bcd954a1f..59bcd954a1f 100644
--- a/src/test/ui/repeat_count.stderr
+++ b/src/test/ui/repeat-expr/repeat_count.stderr
diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs
index 1f6f2336481..6b715f727b2 100644
--- a/src/tools/tidy/src/ui_tests.rs
+++ b/src/tools/tidy/src/ui_tests.rs
@@ -7,7 +7,7 @@ use std::path::Path;
 
 const ENTRY_LIMIT: usize = 1000;
 // FIXME: The following limits should be reduced eventually.
-const ROOT_ENTRY_LIMIT: usize = 980;
+const ROOT_ENTRY_LIMIT: usize = 977;
 const ISSUES_ENTRY_LIMIT: usize = 2278;
 
 fn check_entries(path: &Path, bad: &mut bool) {