From 46ee6b1840b3ab3c06c9f8ba3bb097f25b5c174a Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 3 Mar 2020 21:39:45 +0900 Subject: [PATCH] Add regression test --- tests/ui/crashes/ice-5223.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/ui/crashes/ice-5223.rs diff --git a/tests/ui/crashes/ice-5223.rs b/tests/ui/crashes/ice-5223.rs new file mode 100644 index 00000000000..9bb2e227fc1 --- /dev/null +++ b/tests/ui/crashes/ice-5223.rs @@ -0,0 +1,18 @@ +// Regression test for #5233 + +#![feature(const_generics)] +#![allow(incomplete_features)] +#![warn(clippy::indexing_slicing, clippy::iter_cloned_collect)] + +pub struct KotomineArray { + arr: [T; N], +} + +impl KotomineArray { + pub fn ice(self) { + let _ = self.arr[..]; + let _ = self.arr.iter().cloned().collect::>(); + } +} + +fn main() {}