rust/library/core/tests
Matthias Krüger a26b1d2259
Rollup merge of #89835 - jkugelman:must-use-expensive-computations, r=joshtriplett
Add #[must_use] to expensive computations

The unifying theme for this commit is weak, admittedly. I put together a list of "expensive" functions when I originally proposed this whole effort, but nobody's cared about that criterion. Still, it's a decent way to bite off a not-too-big chunk of work.

Given the grab bag nature of this commit, the messages I used vary quite a bit. I'm open to wording changes.

For some reason clippy flagged four `BTreeSet` methods but didn't say boo about equivalent ones on `HashSet`. I stared at them for a while but I can't figure out the difference so I added the `HashSet` ones in.

```rust
// Flagged by clippy.
alloc::collections::btree_set::BTreeSet<T>   fn difference<'a>(&'a self, other: &'a BTreeSet<T>) -> Difference<'a, T>;
alloc::collections::btree_set::BTreeSet<T>   fn symmetric_difference<'a>(&'a self, other: &'a BTreeSet<T>) -> SymmetricDifference<'a, T>
alloc::collections::btree_set::BTreeSet<T>   fn intersection<'a>(&'a self, other: &'a BTreeSet<T>) -> Intersection<'a, T>;
alloc::collections::btree_set::BTreeSet<T>   fn union<'a>(&'a self, other: &'a BTreeSet<T>) -> Union<'a, T>;

// Ignored by clippy, but not by me.
std::collections::HashSet<T, S>              fn difference<'a>(&'a self, other: &'a HashSet<T, S>) -> Difference<'a, T, S>;
std::collections::HashSet<T, S>              fn symmetric_difference<'a>(&'a self, other: &'a HashSet<T, S>) -> SymmetricDifference<'a, T, S>
std::collections::HashSet<T, S>              fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a, T, S>;
std::collections::HashSet<T, S>              fn union<'a>(&'a self, other: &'a HashSet<T, S>) -> Union<'a, T, S>;
```

Parent issue: #89692

r? ```@joshtriplett```
2021-10-31 09:20:24 +01:00
..
fmt Rollup merge of #86479 - exphp-forks:float-debug-exponential, r=yaahc 2021-10-20 04:35:10 +09:00
hash move object safety test to library/core 2021-08-15 13:00:25 -04:00
iter implement advance_(back_)_by on more iterators 2021-09-30 21:23:28 +02:00
num Auto merge of #88788 - falk-hueffner:speedup-int-log10-branchless, r=joshtriplett 2021-10-12 03:18:54 +00:00
ops Expand the docs for ops::ControlFlow a bit 2021-02-06 22:36:05 -08:00
alloc.rs
any.rs Add test for issue 84666. 2021-06-03 16:13:45 +02:00
array.rs Rollup merge of #90162 - WaffleLapkin:const_array_slice_from_ref_mut, r=oli-obk 2021-10-24 15:48:44 +02:00
ascii.rs Add #[must_use] to expensive computations 2021-10-12 23:27:17 -04:00
atomic.rs Make more From impls const 2021-10-18 19:19:28 +09:00
bool.rs Make ui test that are run-pass and do not test the compiler itself library tests 2020-11-30 02:47:32 +01:00
cell.rs Make more From impls const 2021-10-18 19:19:28 +09:00
char.rs Make more From impls const 2021-10-18 19:19:28 +09:00
clone.rs Fix borrow and deref 2021-03-03 11:23:29 +01:00
cmp.rs Make ui test that are run-pass and do not test the compiler itself library tests 2020-11-30 02:47:32 +01:00
const_ptr.rs Revert "Revert tests added by PR 81167." 2021-06-27 12:05:17 +02:00
intrinsics.rs move test to intergrated test in library/core 2020-09-24 14:46:57 +00:00
lazy.rs Make more From impls const 2021-10-18 19:19:28 +09:00
lib.rs Auto merge of #90042 - pietroalbini:1.56-master, r=Mark-Simulacrum 2021-10-25 11:31:47 +00:00
macros.rs Allow leading pipe in matches!() patterns. 2021-07-15 22:05:45 +03:00
manually_drop.rs Test ManuallyDrop::clone_from. 2021-07-05 11:55:45 +00:00
mem.rs Remove the deprecated core::raw and std::raw module. 2021-07-03 14:03:27 +08:00
nonzero.rs Make From impls of NonZero integer const. 2021-10-20 12:04:58 +09:00
ops.rs Expand the docs for ops::ControlFlow a bit 2021-02-06 22:36:05 -08:00
option.rs Make more From impls const 2021-10-18 19:19:28 +09:00
pattern.rs
pin.rs Make some methods of Pin<&mut T> unstable const 2020-09-18 19:23:50 +02:00
ptr.rs Bump cfgs 2021-04-04 14:57:05 -04:00
result.rs Make Result::as_mut const 2021-10-17 18:39:54 +09:00
slice.rs Rollup merge of #90162 - WaffleLapkin:const_array_slice_from_ref_mut, r=oli-obk 2021-10-24 15:48:44 +02:00
str.rs
str_lossy.rs
task.rs
time.rs Make Duration's Debug format pad to width 2021-09-16 03:09:31 +02:00
tuple.rs
unicode.rs Make ui test that are run-pass and do not test the compiler itself library tests 2020-11-30 02:47:32 +01:00