Skip to content

Commit a44b180

Browse files
committed
add #[must_use] to array::repeat
1 parent 64a99db commit a44b180

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/array/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ pub use iter::IntoIter;
4848
/// assert_eq!(strings, ["Hello there!", "Hello there!"]);
4949
/// ```
5050
#[inline]
51+
#[must_use = "cloning is often expensive and is not expected to have side effects"]
5152
#[stable(feature = "array_repeat", since = "CURRENT_RUSTC_VERSION")]
5253
pub fn repeat<T: Clone, const N: usize>(val: T) -> [T; N] {
5354
from_trusted_iterator(repeat_n(val, N))

0 commit comments

Comments
 (0)