Update the future/task API
This change updates the future and task API as discussed in the stabilization RFC at https://github.com/rust-lang/rfcs/pull/2592.
Changes:
- Replacing UnsafeWake with RawWaker and RawWakerVtable
- Removal of LocalWaker
- Removal of Arc-based Wake trait
fix str mutating through a ptr derived from &self
Found by Miri: In `get_unchecked_mut` (also used by the checked variants internally) uses `str::as_ptr` to create a mutable reference, but `as_ptr` takes `&self`. This means the mutable references we return here got created from a shared reference, which violates the shared-references-are-read-only discipline!
For this by using a newly introduced `as_mut_ptr` instead.
Speed up the fast path for assert_eq! and assert_ne!
Currently, the panic!() calls directly borrow the value bindings. This
causes those bindings to always be initialized, i.e. they're initialized
even before the values are even compared. This causes noticeable
overhead in what should be a really cheap operation.
By performing a reborrow of the value in the call to panic!(), we allow
LLVM to optimize that code, so that the extra borrow only happens in the
error case.
We could achieve the same result by dereferencing the values passed to
panic!(), as the format machinery borrows them anyway, but this causes
assertions to fail to compile if one of the values is unsized, i.e. it
would be a breaking change.
Cosmetic improvements to doc comments
This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase).
r? @steveklabnik
Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
Require a list of features in `#[allow_internal_unstable]`
The blanket-permission slip is not great and will likely give us trouble some point down the road.
Rollup of 16 pull requests
Successful merges:
- #57259 (Update reference of rlibc crate to compiler-builtins crate)
- #57740 (Use `to_ne_bytes` for converting IPv4Addr to octets)
- #57926 (Tiny expansion to docs for `core::convert`.)
- #58157 (Add Cargo.lock automatically adding message)
- #58203 (rustdoc: display sugared return types for async functions)
- #58243 (Add trait alias support in rustdoc)
- #58262 (Add #[must_use] message to Fn* traits)
- #58295 (std::sys::unix::stdio: explain why we do into_raw)
- #58297 (Cleanup JS a bit)
- #58317 (Some writing improvement, conciseness of intro)
- #58324 (miri: give non-generic functions a stable address)
- #58332 (operand-to-place copies should never be overlapping)
- #58345 (When there are multiple filenames, print what got interpreted as filenames)
- #58346 (rpath computation: explain why we pop())
- #58350 (Fix failing tidy (line endings on Windows))
- #58352 (miri value visitor: use `?` in macro)
Failed merges:
r? @ghost
Tiny expansion to docs for `core::convert`.
This is not really significant, accept or reject as you wish. I just want to make sure I understand how the PR process works and that I'm doing it right before doing a bigger one for #33417.
libcore, liballoc: disable tests in Miri
I am going to run the libcore and liballoc unit test suites in Miri. Not all tests pass. This PR disables a whole bunch of tests when running in Miri, to get us to a baseline from which I can investigate failures.
Cc @SimonSapin @alexcrichton
Generate a documentation page for core::mem::transmute.
In `#[no_std]` environments, `std::mem::transmute` is unavailable. Searching for "core transmute" online only pulls up `core::intrinsics::transmute`, which is behind the (unstable) `core_intrinsics` feature flag. Users wishing to use transmute in `#[no_std]` environments typically should use `core::mem::transmute` instead, as it is stable. This documentation makes `core::mem::transmute` discoverable.
Instead of inlining the same logic into every number formatting implementation,
pull it out into a function that each of the number formatting impls call into.