We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2952b99 + a44b180 commit c7a11f4Copy full SHA for c7a11f4
library/core/src/array/mod.rs
@@ -48,6 +48,7 @@ pub use iter::IntoIter;
48
/// assert_eq!(strings, ["Hello there!", "Hello there!"]);
49
/// ```
50
#[inline]
51
+#[must_use = "cloning is often expensive and is not expected to have side effects"]
52
#[stable(feature = "array_repeat", since = "CURRENT_RUSTC_VERSION")]
53
pub fn repeat<T: Clone, const N: usize>(val: T) -> [T; N] {
54
from_trusted_iterator(repeat_n(val, N))
0 commit comments