rust/library/core/src/slice
Matthias Krüger 95750ae439
Rollup merge of #89897 - jkugelman:must-use-core, r=joshtriplett
Add #[must_use] to remaining core functions

I've run out of compelling reasons to group functions together across crates so I'm just going to go module-by-module. This is everything remaining from the `core` crate.

Ignored by clippy for reasons unknown:

```rust
core::alloc::Layout   unsafe fn for_value_raw<T: ?Sized>(t: *const T) -> Self;
core::any             const fn type_name_of_val<T: ?Sized>(_val: &T) -> &'static str;
```

Ignored by clippy because of `mut`:

```rust
str   fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str);
```

<del>
Ignored by clippy presumably because a caller might want `f` called for side effects. That seems like a bad usage of `map` to me.

```rust
core::cell::Ref<'b, T>   fn map<U: ?Sized, F>(orig: Ref<'b, T>, f: F) -> Ref<'b, T>;
core::cell::Ref<'b, T>   fn map_split<U: ?Sized, V: ?Sized, F>(orig: Ref<'b, T>, f: F) -> (Ref<'b, U>, Ref<'b, V>);
```
</del>

Parent issue: #89692

r? ```@joshtriplett```
2021-10-31 09:20:26 +01:00
..
iter #[inline] slice::advance_by 2021-08-03 21:32:36 +02:00
ascii.rs Add #[must_use] to expensive computations 2021-10-12 23:27:17 -04:00
cmp.rs Remove pointer comparison from slice equality 2020-12-26 06:43:51 +00:00
index.rs Bump slice_index_with_ops_bound_pair to 1.53.0 2021-04-21 22:40:19 +02:00
iter.rs Rollup merge of #89897 - jkugelman:must-use-core, r=joshtriplett 2021-10-31 09:20:26 +01:00
memchr.rs Add #[must_use] to expensive computations 2021-10-12 23:27:17 -04:00
mod.rs track_caller for slice length assertions 2021-10-26 13:03:02 +01:00
raw.rs Apply changes proposed in the review 2021-10-29 23:45:09 +03:00
rotate.rs Add safety comments in private core::slice::rotate::ptr_rotate function 2021-07-14 15:31:12 +02:00
sort.rs Remove ignore-tidy-undocumented-unsafe from core::slice::sort 2021-08-27 21:38:49 -03:00
specialize.rs Remove size_of == 1 case from fill specialization. 2021-08-09 19:25:28 +02:00