Skip to content

Commit

Permalink
Auto merge of #86982 - GuillaumeGomez:rollup-7sbye3c, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
Rollup of 8 pull requests

Successful merges:

 - #84961 (Rework SESSION_GLOBALS API)
 - #86726 (Use diagnostic items instead of lang items for rfc2229 migrations)
 - #86789 (Update BTreeSet::drain_filter documentation)
 - #86838 (Checking that function is const if marked with rustc_const_unstable)
 - #86903 (Fix small headers display)
 - #86913 (Document rustdoc with `--document-private-items`)
 - #86957 (Update .mailmap file)
 - #86971 (mailmap: Add alternative addresses for myself)

Failed merges:

 - #86869 (Account for capture kind in auto traits migration)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jul 8, 2021
2 parents 0106300 + 1668e9c commit ce9c138
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,18 +940,20 @@ impl<T> BTreeSet<T> {
BTreeSet { map: self.map.split_off(key) }
}

/// Creates an iterator which uses a closure to determine if a value should be removed.
/// Creates an iterator that visits all values in ascending order and uses a closure
/// to determine if a value should be removed.
///
/// If the closure returns true, then the value is removed and yielded.
/// If the closure returns false, the value will remain in the list and will not be yielded
/// by the iterator.
/// If the closure returns `true`, the value is removed from the set and yielded. If
/// the closure returns `false`, or panics, the value remains in the set and will
/// not be yielded.
///
/// If the iterator is only partially consumed or not consumed at all, each of the remaining
/// values will still be subjected to the closure and removed and dropped if it returns true.
/// If the iterator is only partially consumed or not consumed at all, each of the
/// remaining values is still subjected to the closure and removed and dropped if it
/// returns `true`.
///
/// It is unspecified how many more values will be subjected to the closure
/// if a panic occurs in the closure, or if a panic occurs while dropping a value, or if the
/// `DrainFilter` itself is leaked.
/// It is unspecified how many more values will be subjected to the closure if a
/// panic occurs in the closure, or if a panic occurs while dropping a value, or if
/// the `DrainFilter` itself is leaked.
///
/// # Examples
///
Expand Down

0 comments on commit ce9c138

Please sign in to comment.