about summary refs log tree commit diff
path: root/tests/ui/array-slice-vec
diff options
context:
space:
mode:
authorThe rustc-dev-guide Cronjob Bot <github-actions@github.com>2025-02-02 04:02:22 +0000
committerThe rustc-dev-guide Cronjob Bot <github-actions@github.com>2025-02-02 04:02:22 +0000
commit95665307cd848ec43f1604d8e0bd4e274d991809 (patch)
treeee8904db2a42ffe3ab1253f2d904a3f48e81b6e1 /tests/ui/array-slice-vec
parentf09de673565b88dd0c9f416e171f5c099073270e (diff)
parent4f5116e236843492998acfa42381d14db360f2ab (diff)
downloadrust-95665307cd848ec43f1604d8e0bd4e274d991809.tar.gz
rust-95665307cd848ec43f1604d8e0bd4e274d991809.zip
Merge from rustc
Diffstat (limited to 'tests/ui/array-slice-vec')
-rw-r--r--tests/ui/array-slice-vec/driftsort-off-by-one-issue-136103.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/array-slice-vec/driftsort-off-by-one-issue-136103.rs b/tests/ui/array-slice-vec/driftsort-off-by-one-issue-136103.rs
new file mode 100644
index 00000000000..42197ff102d
--- /dev/null
+++ b/tests/ui/array-slice-vec/driftsort-off-by-one-issue-136103.rs
@@ -0,0 +1,10 @@
+//@ run-pass
+// Ensures that driftsort doesn't crash under specific slice
+// length and memory size.
+// Based on the example given in https://github.com/rust-lang/rust/issues/136103.
+fn main() {
+    let n = 127;
+    let mut objs: Vec<_> =
+        (0..n).map(|i| [(i % 2) as u8; 125001]).collect();
+    objs.sort();
+}