Rollup of 18 pull requests#158923
Closed
JonathanBrouwer wants to merge 61 commits into
Closed
Conversation
I define the concept of "equivalent allocators", in order to be able
to talk about cloning allocators, and to give commonsense guarantees
about stdlib `Allocator` impls.
I define the concept of "invalidating a memory block" in order to be
able to talk about users not being allowed to use a block of allocated
memory after its allocator is "gone".
An `Allocator` implementation is now allowed to invalidate its
allocations when the allocator is mutated or when a lifetime in the
allocator type expires.
Mutation of an `Allocator` should sensibly be allowed to invalidate its
allocations. For example, the `bumpalo` crates has a `Bump::reset`
method that takes `&mut self` and invalidates all past allocations.
Accesses via `&` still must not invalidate past allocations since,
for example, `Box` provides `&` access to the allocator.
I still had the "allocator destructor" clause as a separate clause from
the `&mut` clause, to avoid questions about whether drop glue of types
that don't implement `Drop` but have fields that implement `Drop` counts
as creating a `&mut` to the whole thing.
The "lifetime expiry" clause closes a hole/ambiguity on when an
allocator is considered to be "dropped" if it does not have a
destructor. Additionally, this clause matches what is required for
`Box::into_pin` and `{Rc, Arc}::pin` to be sound. (Those methods have an
`A: 'static` bound to prevent allocating via a `&MyAllocator` and then
running `MyAllocator`'s destructor.)
This change prevents our lints from returning a span with stuff in it that isn't actually part of the doc comment. When that happens, it returns `None` instead.
It requires an allocation, and doesn't seem to help in practice. Fixes a nit found during review.
Co-authored-by: binarycat <binarycat@envs.net>
Co-authored-by: binarycat <binarycat@envs.net>
Co-authored-by: binarycat <binarycat@envs.net>
Starting with FreeBSD 16.0, powerpc64le switches to IEEE long double. 128 bit arithmetics are implemented in LLVM's compiler_rt, which is FreeBSD's libgcc. Link with it so that building on FreeBSD 16.0 succeeds - noop for earlier releases.
The docs stated that try_with will return an AccessError when the key has been destroyed. This is not guaranteed: on some platforms, TLS slots can be re-initialized during destruction, so the destroyed state cannot always be observed. Change 'will' to 'may' to accurately reflect the best-effort nature of the check.
…ure HRTB annotation
…r generation for memcpy. This moves a TA failure in the testcase from memcpy to a later location.
Contributor
Author
|
@bors r+ rollup=never p=5 |
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 7, 2026
…uwer Rollup of 18 pull requests Successful merges: - #157385 (Enable Enzyme on x86_64-apple) - #157561 (rustdoc: do not include extra stuff in span) - #158179 (std: unconditionally use `preadv`/`pwritev` on AArch64 macOS) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158621 (disallow `extern "custom"` on wasm and spirv targets) - #158690 (delegation: support mapping of all arguments with `Self` type) - #158696 (Rename some `body_id` to `body_def_id`) - #158697 (Fixes for QNX SDP 8) - #158760 (Clarify that `LocalKey::try_with` may return `AccessError`) - #157801 (Rewrite safety requirements for `Allocator` impls) - #158333 (Fix typetree generation for differentiated functions) - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - #158701 ( diagnostics: suggest type annotation for closure params on HRTB FnOnce mismatch) - #158791 (Avoid unused braces lint for macro generated arguments) - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - #158841 (Avoid final override ICE for RPITIT associated types) - #158889 (tests: catch up with LLVM returning f128 on the stack) - #158905 (delegation: add constraints to new generic args)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for e38cd22 failed: CI. Failed job:
|
Contributor
|
PR #157561, which is a member of this rollup, was unapproved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
preadv/pwritevon AArch64 macOS #158179 (std: unconditionally usepreadv/pwritevon AArch64 macOS)extern "custom"on wasm and spirv targets #158621 (disallowextern "custom"on wasm and spirv targets)Selftype #158690 (delegation: support mapping of all arguments withSelftype)body_idtobody_def_id#158696 (Rename somebody_idtobody_def_id)LocalKey::try_withmay returnAccessError#158760 (Clarify thatLocalKey::try_withmay returnAccessError)Allocatorimpls #157801 (Rewrite safety requirements forAllocatorimpls)ci-mirrorsinarmhf-gnufor {busybox, ubuntu rootfs} artifacts #158802 (Useci-mirrorsinarmhf-gnufor {busybox, ubuntu rootfs} artifacts)r? @ghost
Create a similar rollup