about summary refs log tree commit diff
path: root/tests/ui/array-slice-vec
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-02-02 16:13:07 +0100
committerRalf Jung <post@ralfj.de>2025-02-02 16:13:07 +0100
commitf034a1544193a91fc03ced4a047fe8a3fa857b81 (patch)
treeb29ab119ebbd418e0a932c83dfe488f0b3ce9f35 /tests/ui/array-slice-vec
parentbf69458973ae5fc249ec06406669f4e1f547d3d0 (diff)
parent6dd75f0d6802f56564f5f9c947a85ded286d3986 (diff)
downloadrust-f034a1544193a91fc03ced4a047fe8a3fa857b81.tar.gz
rust-f034a1544193a91fc03ced4a047fe8a3fa857b81.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();
+}