Stabilize slice::repeat (feature repeat_generic_slice)
This commit is contained in:
parent
7130fc54e0
commit
4a2ae451e3
2 changed files with 1 additions and 6 deletions
|
|
@ -411,20 +411,16 @@ impl<T> [T] {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(repeat_generic_slice)]
|
||||
/// assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]);
|
||||
/// ```
|
||||
///
|
||||
/// A panic upon overflow:
|
||||
///
|
||||
/// ```should_panic
|
||||
/// #![feature(repeat_generic_slice)]
|
||||
/// // this will panic at runtime
|
||||
/// b"0123456789abcdef".repeat(usize::max_value());
|
||||
/// ```
|
||||
#[unstable(feature = "repeat_generic_slice",
|
||||
reason = "it's on str, why not on slice?",
|
||||
issue = "48784")]
|
||||
#[stable(feature = "repeat_generic_slice", since = "1.40.0")]
|
||||
pub fn repeat(&self, n: usize) -> Vec<T> where T: Copy {
|
||||
if n == 0 {
|
||||
return Vec::new();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#![feature(exact_size_is_empty)]
|
||||
#![feature(option_flattening)]
|
||||
#![feature(pattern)]
|
||||
#![feature(repeat_generic_slice)]
|
||||
#![feature(trusted_len)]
|
||||
#![feature(try_reserve)]
|
||||
#![feature(unboxed_closures)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue