about summary refs log tree commit diff
path: root/library/core/tests/array.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-24 14:12:10 +0000
committerbors <bors@rust-lang.org>2021-10-24 14:12:10 +0000
commit00d5e42e776da900049fe19087bc9b0057ec70cd (patch)
treef168b0920764af97f372d7faa608611cd3f09f79 /library/core/tests/array.rs
parented08a67566d7d1d9dd2ad928ff21c23e841a4345 (diff)
parenteee29fd34c9fdc9afddfc3108d8e36199854f0b3 (diff)
Auto merge of #90235 - matthiaskrgr:rollup-7pqtevk, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #89558 (Add rustc lint, warning when iterating over hashmaps)
 - #90100 (Skip documentation for tier 2 targets on dist-x86_64-apple-darwin)
 - #90155 (Fix alignment of method headings for scannability)
 - #90162 (Mark `{array, slice}::{from_ref, from_mut}` as const fn)
 - #90221 (Fix ICE when forgetting to `Box` a parameter to a `Self::func` call)
 - #90234 (Temporarily turn overflow checks off for rustc-rayon-core)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/core/tests/array.rs')
-rw-r--r--library/core/tests/array.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/library/core/tests/array.rs b/library/core/tests/array.rs
index 1d4307ca0fb..7dc071b7423 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]