diff options
Diffstat (limited to 'library/core/tests/array.rs')
| -rw-r--r-- | library/core/tests/array.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/library/core/tests/array.rs b/library/core/tests/array.rs index b3af1328c90..d10bb4bce3c 100644 --- a/library/core/tests/array.rs +++ b/library/core/tests/array.rs @@ -7,6 +7,11 @@ fn array_from_ref() { let value: String = "Hello World!".into(); let arr: &[String; 1] = array::from_ref(&value); assert_eq!(&[value.clone()], arr); + + const VALUE: &&str = &"Hello World!"; + const ARR: &[&str; 1] = array::from_ref(VALUE); + assert_eq!(&[*VALUE], ARR); + assert!(core::ptr::eq(VALUE, &ARR[0])); } #[test] |
