stabilize array repeat
This commit is contained in:
@@ -41,8 +41,6 @@ pub use iter::IntoIter;
|
|||||||
///
|
///
|
||||||
/// Creating multiple copies of a `String`:
|
/// Creating multiple copies of a `String`:
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// #![feature(array_repeat)]
|
|
||||||
///
|
|
||||||
/// use std::array;
|
/// use std::array;
|
||||||
///
|
///
|
||||||
/// let string = "Hello there!".to_string();
|
/// let string = "Hello there!".to_string();
|
||||||
@@ -50,7 +48,7 @@ pub use iter::IntoIter;
|
|||||||
/// assert_eq!(strings, ["Hello there!", "Hello there!"]);
|
/// assert_eq!(strings, ["Hello there!", "Hello there!"]);
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
#[unstable(feature = "array_repeat", issue = "126695")]
|
#[stable(feature = "array_repeat", since = "CURRENT_RUSTC_VERSION")]
|
||||||
pub fn repeat<T: Clone, const N: usize>(val: T) -> [T; N] {
|
pub fn repeat<T: Clone, const N: usize>(val: T) -> [T; N] {
|
||||||
from_trusted_iterator(repeat_n(val, N))
|
from_trusted_iterator(repeat_n(val, N))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
//@ compile-flags: -Copt-level=3
|
//@ compile-flags: -Copt-level=3
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(array_repeat)]
|
|
||||||
|
|
||||||
use std::array::repeat;
|
use std::array::repeat;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(iter_repeat_n)]
|
#![feature(iter_repeat_n)]
|
||||||
#![feature(array_repeat)]
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct NotCopy(u16);
|
pub struct NotCopy(u16);
|
||||||
|
|||||||
Reference in New Issue
Block a user