summaryrefslogtreecommitdiffstats
path: root/library/alloc/tests/vec.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /library/alloc/tests/vec.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/alloc/tests/vec.rs')
-rw-r--r--library/alloc/tests/vec.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs
index 183dd8e6e..d44dcfbf6 100644
--- a/library/alloc/tests/vec.rs
+++ b/library/alloc/tests/vec.rs
@@ -2499,7 +2499,6 @@ fn test_into_flattened_size_overflow() {
let _ = v.into_flattened();
}
-#[cfg(not(bootstrap))]
#[test]
fn test_box_zero_allocator() {
use core::{alloc::AllocError, cell::RefCell};
@@ -2563,3 +2562,13 @@ fn test_box_zero_allocator() {
// Ensure all ZSTs have been freed.
assert!(alloc.state.borrow().0.is_empty());
}
+
+#[test]
+fn test_vec_from_array_ref() {
+ assert_eq!(Vec::from(&[1, 2, 3]), vec![1, 2, 3]);
+}
+
+#[test]
+fn test_vec_from_array_mut_ref() {
+ assert_eq!(Vec::from(&mut [1, 2, 3]), vec![1, 2, 3]);
+}