about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-03-03 13:38:42 +0000
committerbors <bors@rust-lang.org>2020-03-03 13:38:42 +0000
commitd74229b97dfca686ebd56522340d501496d2d3f2 (patch)
treebd66b38f1813f1831e9766c8847069de0575e4bf /tests
parentb96c3ca811eae28e790c1b200be06a7d35862c6a (diff)
parent46ee6b1840b3ab3c06c9f8ba3bb097f25b5c174a (diff)
downloadrust-d74229b97dfca686ebd56522340d501496d2d3f2.tar.gz
rust-d74229b97dfca686ebd56522340d501496d2d3f2.zip
Auto merge of #5256 - JohnTitor:try-eval-usize, r=phansch
Use `try_eval_usize` over `eval_usize`

Fixes #5223

changelog: Fix ICE in evaluating usizes
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/crashes/ice-5223.rs18
1 files changed, 18 insertions, 0 deletions
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<T, const N: usize> {
+    arr: [T; N],
+}
+
+impl<T: std::clone::Clone, const N: usize> KotomineArray<T, N> {
+    pub fn ice(self) {
+        let _ = self.arr[..];
+        let _ = self.arr.iter().cloned().collect::<Vec<_>>();
+    }
+}
+
+fn main() {}