Skip to content

Commit

Permalink
Stabilize slice::repeat (feature repeat_generic_slice)
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Oct 2, 2019
1 parent 7130fc5 commit 4a2ae45
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 1 addition & 5 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion src/liballoc/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 4a2ae45

Please sign in to comment.