This requires the following changes.
- It moves parts of bitslice.rs into bitvec.rs: `bitwise()`,
`BitwiseOperator`, `bits_to_string()`.
- It changes `IdxSet` to just be a wrapper around `BitArray`.
- It changes `BitArray` and `BitVec` to use `usize` words instead of
`u128` words. (`BitSlice` and `IdxSet` already use `usize`.) Local
profiling showed `usize` was better.
- It moves some operations from `IdxSet` into `BitArray`:
`new_filled()`, `clear()`, `set_up_to()`, `trim_to()` (renamed
`clear_above()`), `words()` and `words_mut()`, `encode()` and
`decode(). The `IdxSet` operations now just call the `BitArray`
operations.
- It replaces `BitArray`'s iterator implementation with `IdxSet`'s,
because the latter is more concise. It also removes the buggy
`size_hint` function from `BitArray`'s iterator, which counted the
number of *words* rather than the number of *bits*. `IdxSet`'s
iterator is now just a thin wrapper around `BitArray`'s iterator.
- It moves some unit tests from `indexed_set.rs` to `bitvec.rs`.
resolve: Future proof derive helper attributes
Derive helpers no longer require going through recovery mode (fixes https://github.com/rust-lang/rust/issues/53481).
They also report an error if they are ambiguous with any other macro in scope, so we can resolve the question about their exact priority sometime later (cc https://github.com/rust-lang/rust/issues/52226).
Previously the code below would not be guaranteed to exit when the first
spawned thread took the `return, // already unparked` path because there
was no write to synchronize with a read in `park`.
```
use std::sync::atomic::{AtomicBool, Ordering};
use std:🧵:{current, spawn, park};
static FLAG: AtomicBool = AtomicBool::new(false);
fn main() {
let thread_0 = current();
spawn(move || {
FLAG.store(true, Ordering::Relaxed);
thread_0.unpark();
});
let thread_0 = current();
spawn(move || {
thread_0.unpark();
});
while !FLAG.load(Ordering::Relaxed) {
park();
}
}
```
Rollup of 15 pull requests
Successful merges:
- #52514 (Fix a few AMDGPU related issues)
- #53703 (Document .0 to unpack integer from Wrapping)
- #53777 (Implemented map_or_else for Result<T, E>)
- #54031 (A few cleanups and minor improvements to rustc_passes)
- #54046 (Update documentation for fill_buf in std::io::BufRead)
- #54064 (`&CStr`, not `CStr`, is the counterpart of `&str`)
- #54072 (Stabilization change for mod.rs)
- #54073 (docs: Use dollar sign for all bash prompts)
- #54074 (simplify ordering for Kind)
- #54085 (Remove documentation about proc_macro being bare-bones)
- #54087 (rustdoc: Remove generated blanket impls from trait pages)
- #54106 (Reexport CheckLintNameResult)
- #54107 (Fix typos in libstd hash map)
- #54136 (Update LLVM to fix GlobalISel dbg.declare)
- #54142 (Recover proper regression test for issue #16278.)
Failed merges:
r? @ghost