rust/src/librustc_data_structures
bors 1ef1563518 Auto merge of #48945 - clarcharr:iter_exhaust, r=Kimundi
Replace manual iterator exhaust with for_each(drop)

This originally added a dedicated method, `Iterator::exhaust`, and has since been replaced with `for_each(drop)`, which is more idiomatic.

<del>This is just shorthand for `for _ in &mut self {}` or `while let Some(_) = self.next() {}`. This states the intent a lot more clearly than the identical code: run the iterator to completion.

<del>At least personally, my eyes tend to gloss over `for _ in &mut self {}` without fully paying attention to what it does; having a `Drop` implementation akin to:

<del>`for _ in &mut self {}; unsafe { free(self.ptr); }`</del>

<del>Is not as clear as:

<del>`self.exhaust(); unsafe { free(self.ptr); }`

<del>Additionally, I've seen debate over whether `while let Some(_) = self.next() {}` or `for _ in &mut self {}` is more clear, whereas `self.exhaust()` is clearer than both.
2018-04-16 13:21:56 +00:00
..
control_flow_graph Fix docs for future pulldown migration 2018-01-01 14:44:12 +01:00
graph Implement some trivial size_hints for various iterators 2018-03-20 05:33:59 -04:00
obligation_forest Use num::NonZero* instead of NonZero<_> in rustc and tests 2018-03-17 23:07:40 +01:00
owning_ref Make metadata references Send + Sync 2018-03-07 01:56:59 +01:00
snapshot_map Generate documentation for auto-trait impls 2018-02-18 16:29:24 -05:00
accumulate_vec.rs Move RangeArguments to {core::std}::ops and rename to RangeBounds 2018-03-29 13:12:49 +02:00
array_vec.rs Auto merge of #48945 - clarcharr:iter_exhaust, r=Kimundi 2018-04-16 13:21:56 +00:00
base_n.rs Shorten names of some compiler generated artifacts. 2018-01-08 12:30:52 +01:00
bitslice.rs rustc_data_structures: add missing #[inline]. 2018-02-21 19:21:26 +02:00
bitvec.rs Implement some trivial size_hints for various iterators 2018-03-20 05:33:59 -04:00
Cargo.toml Bump ena 2018-03-01 08:04:26 -07:00
flock.rs Fix definitions of ULONG_PTR 2017-05-06 15:46:16 +01:00
fx.rs rustc: Remove some dead code 2017-08-19 13:27:16 +03:00
indexed_set.rs avoid IdxSets containing garbage above the universe length 2018-04-02 00:14:44 +03:00
indexed_vec.rs Move RangeArguments to {core::std}::ops and rename to RangeBounds 2018-03-29 13:12:49 +02:00
lib.rs Move deny(warnings) into rustbuild 2018-04-08 16:59:14 -06:00
sip128.rs rustc_data_structures: Add implementation of 128 bit SipHash. 2017-10-16 14:44:40 +02:00
small_vec.rs Fix typos & us spellings 2017-08-15 21:56:30 +02:00
stable_hasher.rs Move PROFQ_CHAN to a Session field 2018-03-09 08:04:31 +01:00
sync.rs Add a Once type for values which are only written once 2018-04-10 14:39:33 +02:00
transitive_relation.rs Make TransitiveRelation thread safe. Avoid locking by using get_mut in some cases. 2018-02-27 19:07:33 +01:00
tuple_slice.rs Add additional test cases to test all arities of tuple; And remove type suffix - i32 on integers 2016-06-11 22:31:24 +05:30