1
Fork 0

Auto merge of #111925 - Manishearth:rollup-z6z6l2v, r=Manishearth

Rollup of 5 pull requests

Successful merges:

 - #111741 (Use `ObligationCtxt` in custom type ops)
 - #111840 (Expose more information in `get_body_with_borrowck_facts`)
 - #111876 (Roll compiler_builtins to 0.1.92)
 - #111912 (Use `Option::is_some_and` and `Result::is_ok_and` in the compiler  )
 - #111915 (libtest: Improve error when missing `-Zunstable-options`)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2023-05-25 00:33:43 +00:00
commit 7664dfe433
115 changed files with 417 additions and 378 deletions

View file

@ -1544,7 +1544,7 @@ impl<T: Idx> GrowableBitSet<T> {
#[inline]
pub fn contains(&self, elem: T) -> bool {
let (word_index, mask) = word_index_and_mask(elem);
self.bit_set.words.get(word_index).map_or(false, |word| (word & mask) != 0)
self.bit_set.words.get(word_index).is_some_and(|word| (word & mask) != 0)
}
#[inline]
@ -1818,7 +1818,7 @@ impl<R: Idx, C: Idx> SparseBitMatrix<R, C> {
/// if the matrix represents (transitive) reachability, can
/// `row` reach `column`?
pub fn contains(&self, row: R, column: C) -> bool {
self.row(row).map_or(false, |r| r.contains(column))
self.row(row).is_some_and(|r| r.contains(column))
}
/// Adds the bits from row `read` to the bits from row `write`, and

View file

@ -248,7 +248,7 @@ impl<I: Idx> IntervalSet<I> {
fn check_invariants(&self) -> bool {
let mut current: Option<u32> = None;
for (start, end) in &self.map {
if start > end || current.map_or(false, |x| x + 1 >= *start) {
if start > end || current.is_some_and(|x| x + 1 >= *start) {
return false;
}
current = Some(*end);
@ -321,6 +321,6 @@ impl<R: Idx, C: Step + Idx> SparseIntervalMatrix<R, C> {
}
pub fn contains(&self, row: R, point: C) -> bool {
self.row(row).map_or(false, |r| r.contains(point))
self.row(row).is_some_and(|r| r.contains(point))
}
}