From bc14b6bea6a410f11a7ea5db84ad753673b78150 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 12 Apr 2022 07:28:07 +0000 Subject: [PATCH] Add new repeat expr test. Also add repeat expr test folder and move all related tests to it --- src/test/ui/repeat-expr/infer.rs | 16 ++++++++++++++++ .../{ => repeat-expr}/repeat-expr-in-static.rs | 0 .../repeat-to-run-dtor-twice.rs | 0 .../repeat-to-run-dtor-twice.stderr | 0 src/test/ui/{ => repeat-expr}/repeat_count.rs | 0 .../ui/{ => repeat-expr}/repeat_count.stderr | 0 src/tools/tidy/src/ui_tests.rs | 2 +- 7 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/test/ui/repeat-expr/infer.rs rename src/test/ui/{ => repeat-expr}/repeat-expr-in-static.rs (100%) rename src/test/ui/{ => repeat-expr}/repeat-to-run-dtor-twice.rs (100%) rename src/test/ui/{ => repeat-expr}/repeat-to-run-dtor-twice.stderr (100%) rename src/test/ui/{ => repeat-expr}/repeat_count.rs (100%) rename src/test/ui/{ => repeat-expr}/repeat_count.stderr (100%) 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); + +impl Copy for MaybeCopy {} + +fn is_copy(x: T) { + println!("{}", std::any::type_name::()); +} + +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 similarity index 100% rename from src/test/ui/repeat-expr-in-static.rs rename to 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 similarity index 100% rename from src/test/ui/repeat-to-run-dtor-twice.rs rename to 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 similarity index 100% rename from src/test/ui/repeat-to-run-dtor-twice.stderr rename to 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 similarity index 100% rename from src/test/ui/repeat_count.rs rename to 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 similarity index 100% rename from src/test/ui/repeat_count.stderr rename to 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) {