rust/library/core/tests
Dylan DPC 10aa3d3f89
Rollup merge of #76120 - LukasKalbertodt:add-as-slice-method-to-array, r=Mark-Simulacrum
Add `[T; N]::as_[mut_]slice`

Part of me trying to populate arrays with a couple of basic useful methods, like slices already have. The ability to add methods to arrays were added in #75212.  Tracking issue: #76118

This adds:

```rust
impl<T, const N: usize> [T; N] {
    pub fn as_slice(&self) -> &[T];
    pub fn as_mut_slice(&mut self) -> &mut [T];
}
```

These methods are like the ones on `std::array::FixedSizeArray` and in the crate `arraytools`.
2020-09-03 02:22:00 +02:00
..
fmt mv std libs to library/ 2020-07-27 19:51:13 -05:00
hash mv std libs to library/ 2020-07-27 19:51:13 -05:00
num flt2dec: properly handle uninitialized memory 2020-09-02 12:41:38 +02:00
alloc.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
any.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
array.rs Add drop check test & MaybeUninit::first_ptr_mut 2020-08-13 03:51:08 +00:00
ascii.rs enable align_to tests in Miri 2020-08-19 10:41:51 +02:00
atomic.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
bool.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
cell.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
char.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
clone.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
cmp.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
intrinsics.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
iter.rs Use min_specialization in libcore 2020-08-19 20:08:02 +01:00
lazy.rs Make OnceCell<T> transparent to dropck 2020-08-18 00:34:54 +02:00
lib.rs Fix tests using FixedSizeArray methods (which are now shadowed) 2020-08-30 21:08:18 +02:00
manually_drop.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
mem.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
nonzero.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
ops.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
option.rs Fix tests using FixedSizeArray methods (which are now shadowed) 2020-08-30 21:08:18 +02:00
pattern.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
ptr.rs enable align_to tests in Miri 2020-08-19 10:41:51 +02:00
result.rs Fix tests using FixedSizeArray methods (which are now shadowed) 2020-08-30 21:08:18 +02:00
slice.rs enable align_to tests in Miri 2020-08-19 10:41:51 +02:00
str_lossy.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
str.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
time.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
tuple.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00