Skip to content

allocator: refactor for stabilisation - #157428

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
nia-e:allocator-refactor
Aug 14, 2026
Merged

allocator: refactor for stabilisation#157428
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
nia-e:allocator-refactor

Conversation

@nia-e

@nia-e nia-e commented Jun 4, 2026

Copy link
Copy Markdown
Member

View all comments

Adds my current proposal per the doc in #156882 and follow-up Zulip conversations (notably for dyn-compat) unstably.

r? libs

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 4, 2026
@nia-e nia-e added the A-allocators Area: Custom and system allocators label Jun 4, 2026
Comment thread library/core/src/alloc/mod.rs Outdated
@rust-log-analyzer

This comment has been minimized.

qaijuang

This comment was marked as resolved.

@rust-log-analyzer

This comment has been minimized.

@nia-e

nia-e commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

Note that the no-panic bounds introduced close #156490 and #155746. However, if we want to relax them in the future, we may need to adjust our collection types to be more resilient.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Comment thread library/alloc/src/str.rs Outdated
Comment thread library/core/src/alloc/mod.rs Outdated
Comment thread library/core/src/alloc/mod.rs Outdated
Comment thread library/core/src/alloc/mod.rs Outdated
Comment thread library/core/src/alloc/mod.rs Outdated
Comment thread library/core/src/alloc/mod.rs Outdated
Comment thread library/core/src/alloc/mod.rs Outdated
Comment thread library/core/src/alloc/mod.rs Outdated
Comment thread library/core/src/alloc/mod.rs Outdated
Comment thread library/core/src/alloc/mod.rs Outdated
Comment thread library/core/src/alloc/mod.rs Outdated
@clarfonthey

Copy link
Copy Markdown
Contributor

@rustbot author

(mostly so you can more clearly signal when you think things are ready; I've commented here already so I'll see any additional changes for review as they're made)

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 4, 2026
Comment thread library/core/src/alloc/mod.rs
@rust-log-analyzer

This comment has been minimized.

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 13, 2026
@rust-bors

rust-bors Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 34b13a0 failed: CI. Failed job:

@theemathas

Copy link
Copy Markdown
Contributor

Probably spurious.

@bors r=clarfonthey

@rust-bors

rust-bors Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 7cab1f0 has been approved by clarfonthey

It is now in the queue for this repository.

A failed build status on this PR was cleared due to the approval.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 13, 2026
…nthey

allocator: refactor for stabilisation

Adds my current proposal per the doc in rust-lang#156882 and follow-up Zulip conversations (notably for [dyn-compat](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Allocator.20dyn-safety/near/599555822)) unstably.

r? libs
rust-bors Bot pushed a commit that referenced this pull request Aug 13, 2026
…uwer

Rollup of 17 pull requests

Successful merges:

 - #161045 (stdarch subtree update)
 - #157428 (allocator: refactor for stabilisation)
 - #158918 (x86_64-win: Enable f128 on LLVM 23+)
 - #160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs)
 - #160440 (Couple of misc improvements to the unwind infrastructure)
 - #160441 (PowerPC inline ASM: Fix scalar floats being in the wrong vector lane on little endian)
 - #160896 (tidy: Update Python version requirements to 3.11)
 - #160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows)
 - #161040 (Optimize CStr backing slice bounds checks)
 - #160928 (check `mut`-restriction when tuple constructor is used as a value)
 - #160969 (give layout errors from `size_of_val` and `align_of_val` a span)
 - #161002 (disallow `#[cold]` on `extern "custom"` functions)
 - #161016 (Fix invalid suggestion from try unlabled block)
 - #161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`)
 - #161044 (rustc-dev-guide subtree update)
 - #161046 (Enable unrolling feature of bors)
 - #161054 (rustdoc: Fix link title attribute value when field of enum variants)
rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
Rollup of 23 pull requests

Successful merges:

 - #157428 (allocator: refactor for stabilisation)
 - #158918 (x86_64-win: Enable f128 on LLVM 23+)
 - #160077 (Don't compute FnAbi for LLVM intrinsics)
 - #160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs)
 - #160440 (Couple of misc improvements to the unwind infrastructure)
 - #160896 (tidy: Update Python version requirements to 3.11)
 - #160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows)
 - #160984 (Fix ICE on { _ } const args in bodies by tracking const-only infer args)
 - #161036 (Use `with_types_for_suggestion!` in `write_struct_like()`)
 - #161037 (std: don't clean up the main thread's altstack)
 - #161040 (Optimize CStr backing slice bounds checks)
 - #161065 (core: Fix a typo in funnel shift documentation)
 - #158885 (Add `core::num::Complex`)
 - #160928 (check `mut`-restriction when tuple constructor is used as a value)
 - #160969 (give layout errors from `size_of_val` and `align_of_val` a span)
 - #161002 (disallow `#[cold]` on `extern "custom"` functions)
 - #161016 (Fix invalid suggestion from try unlabled block)
 - #161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`)
 - #161044 (rustc-dev-guide subtree update)
 - #161046 (Enable unrolling feature of bors)
 - #161054 (rustdoc: Fix link title attribute value when field of enum variants)
 - #161055 (`offload!` function-like macro)
 - #161064 (Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable")
rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
Rollup of 23 pull requests

Successful merges:

 - #157428 (allocator: refactor for stabilisation)
 - #158918 (x86_64-win: Enable f128 on LLVM 23+)
 - #160077 (Don't compute FnAbi for LLVM intrinsics)
 - #160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs)
 - #160440 (Couple of misc improvements to the unwind infrastructure)
 - #160896 (tidy: Update Python version requirements to 3.11)
 - #160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows)
 - #160984 (Fix ICE on { _ } const args in bodies by tracking const-only infer args)
 - #161036 (Use `with_types_for_suggestion!` in `write_struct_like()`)
 - #161037 (std: don't clean up the main thread's altstack)
 - #161040 (Optimize CStr backing slice bounds checks)
 - #161065 (core: Fix a typo in funnel shift documentation)
 - #158885 (Add `core::num::Complex`)
 - #160928 (check `mut`-restriction when tuple constructor is used as a value)
 - #160969 (give layout errors from `size_of_val` and `align_of_val` a span)
 - #161002 (disallow `#[cold]` on `extern "custom"` functions)
 - #161016 (Fix invalid suggestion from try unlabled block)
 - #161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`)
 - #161044 (rustc-dev-guide subtree update)
 - #161046 (Enable unrolling feature of bors)
 - #161054 (rustdoc: Fix link title attribute value when field of enum variants)
 - #161055 (`offload!` function-like macro)
 - #161064 (Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable")
@rust-bors
rust-bors Bot merged commit b5bd618 into rust-lang:main Aug 14, 2026
13 of 14 checks passed
rust-timer added a commit that referenced this pull request Aug 14, 2026
Rollup merge of #157428 - nia-e:allocator-refactor, r=clarfonthey

allocator: refactor for stabilisation

Adds my current proposal per the doc in #156882 and follow-up Zulip conversations (notably for [dyn-compat](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Allocator.20dyn-safety/near/599555822)) unstably.

r? libs
@rustbot rustbot added this to the 1.99.0 milestone Aug 14, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
Rollup merge of #157428 - nia-e:allocator-refactor, r=clarfonthey

allocator: refactor for stabilisation

Adds my current proposal per the doc in #156882 and follow-up Zulip conversations (notably for [dyn-compat](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Allocator.20dyn-safety/near/599555822)) unstably.

r? libs
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (364c9de): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.5% [0.4%, 0.6%] 3
Regressions ❌
(secondary)
0.4% [0.3%, 0.6%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.6% [-0.6%, -0.6%] 1
All ❌✅ (primary) 0.5% [0.4%, 0.6%] 3

Max RSS (memory usage)

Results (secondary -2.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) - - 0

Cycles

Results (primary -3.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.7% [-3.7%, -3.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.7% [-3.7%, -3.7%] 1

Binary size

Results (primary 0.1%, secondary 0.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 3
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 3
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.0%, 0.2%] 5

Bootstrap: 455.615s -> 456.684s (0.23%)
Artifact size: 396.47 MiB -> 396.34 MiB (-0.03%)

@rustbot rustbot added the perf-regression Performance regression. label Aug 14, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor

Yeah, that just looks like noise to me.

@rustbot label perf-triaged

@rustbot

rustbot commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Error: Unknown labels: perf-triaged

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip.

@clarfonthey clarfonthey added the perf-regression-triaged The performance regression has been triaged. label Aug 14, 2026
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Aug 17, 2026
Rollup of 23 pull requests

Successful merges:

 - rust-lang/rust#157428 (allocator: refactor for stabilisation)
 - rust-lang/rust#158918 (x86_64-win: Enable f128 on LLVM 23+)
 - rust-lang/rust#160077 (Don't compute FnAbi for LLVM intrinsics)
 - rust-lang/rust#160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs)
 - rust-lang/rust#160440 (Couple of misc improvements to the unwind infrastructure)
 - rust-lang/rust#160896 (tidy: Update Python version requirements to 3.11)
 - rust-lang/rust#160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows)
 - rust-lang/rust#160984 (Fix ICE on { _ } const args in bodies by tracking const-only infer args)
 - rust-lang/rust#161036 (Use `with_types_for_suggestion!` in `write_struct_like()`)
 - rust-lang/rust#161037 (std: don't clean up the main thread's altstack)
 - rust-lang/rust#161040 (Optimize CStr backing slice bounds checks)
 - rust-lang/rust#161065 (core: Fix a typo in funnel shift documentation)
 - rust-lang/rust#158885 (Add `core::num::Complex`)
 - rust-lang/rust#160928 (check `mut`-restriction when tuple constructor is used as a value)
 - rust-lang/rust#160969 (give layout errors from `size_of_val` and `align_of_val` a span)
 - rust-lang/rust#161002 (disallow `#[cold]` on `extern "custom"` functions)
 - rust-lang/rust#161016 (Fix invalid suggestion from try unlabled block)
 - rust-lang/rust#161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`)
 - rust-lang/rust#161044 (rustc-dev-guide subtree update)
 - rust-lang/rust#161046 (Enable unrolling feature of bors)
 - rust-lang/rust#161054 (rustdoc: Fix link title attribute value when field of enum variants)
 - rust-lang/rust#161055 (`offload!` function-like macro)
 - rust-lang/rust#161064 (Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable")
renovate-bot pushed a commit to renovate-bot/rust-lang-_-compiler-builtins that referenced this pull request Aug 17, 2026
Rollup of 23 pull requests

Successful merges:

 - rust-lang/rust#157428 (allocator: refactor for stabilisation)
 - rust-lang/rust#158918 (x86_64-win: Enable f128 on LLVM 23+)
 - rust-lang/rust#160077 (Don't compute FnAbi for LLVM intrinsics)
 - rust-lang/rust#160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs)
 - rust-lang/rust#160440 (Couple of misc improvements to the unwind infrastructure)
 - rust-lang/rust#160896 (tidy: Update Python version requirements to 3.11)
 - rust-lang/rust#160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows)
 - rust-lang/rust#160984 (Fix ICE on { _ } const args in bodies by tracking const-only infer args)
 - rust-lang/rust#161036 (Use `with_types_for_suggestion!` in `write_struct_like()`)
 - rust-lang/rust#161037 (std: don't clean up the main thread's altstack)
 - rust-lang/rust#161040 (Optimize CStr backing slice bounds checks)
 - rust-lang/rust#161065 (core: Fix a typo in funnel shift documentation)
 - rust-lang/rust#158885 (Add `core::num::Complex`)
 - rust-lang/rust#160928 (check `mut`-restriction when tuple constructor is used as a value)
 - rust-lang/rust#160969 (give layout errors from `size_of_val` and `align_of_val` a span)
 - rust-lang/rust#161002 (disallow `#[cold]` on `extern "custom"` functions)
 - rust-lang/rust#161016 (Fix invalid suggestion from try unlabled block)
 - rust-lang/rust#161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`)
 - rust-lang/rust#161044 (rustc-dev-guide subtree update)
 - rust-lang/rust#161046 (Enable unrolling feature of bors)
 - rust-lang/rust#161054 (rustdoc: Fix link title attribute value when field of enum variants)
 - rust-lang/rust#161055 (`offload!` function-like macro)
 - rust-lang/rust#161064 (Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable")
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 18, 2026
…nthey

Assorted allocator nitpicks

Small things that got missed in rust-lang#157428, doc language cleanup for allocator, and a rename that closes rust-lang#158344. cc @rust-lang/wg-allocators. pending libs bikeshed decision on the naming of `into_raw_parts_with_alloc`

r? clarfonthey
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 19, 2026
…nthey

Assorted allocator nitpicks

Small things that got missed in rust-lang#157428, doc language cleanup for allocator, and a rename that closes rust-lang#158344. cc @rust-lang/wg-allocators. pending libs bikeshed decision on the naming of `into_raw_parts_with_alloc`

r? clarfonthey
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 19, 2026
…nthey

Assorted allocator nitpicks

Small things that got missed in rust-lang#157428, doc language cleanup for allocator, and a rename that closes rust-lang#158344. cc @rust-lang/wg-allocators. pending libs bikeshed decision on the naming of `into_raw_parts_with_alloc`

r? clarfonthey
rust-bors Bot pushed a commit that referenced this pull request Aug 19, 2026
Rollup merge of #161115 - nia-e:allocator-nitpicks, r=clarfonthey

Assorted allocator nitpicks

Small things that got missed in #157428, doc language cleanup for allocator, and a rename that closes #158344. cc @rust-lang/wg-allocators. pending libs bikeshed decision on the naming of `into_raw_parts_with_alloc`

r? clarfonthey
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Aug 19, 2026
Assorted allocator nitpicks

Small things that got missed in rust-lang/rust#157428, doc language cleanup for allocator, and a rename that closes rust-lang/rust#158344. cc @rust-lang/wg-allocators. pending libs bikeshed decision on the naming of `into_raw_parts_with_alloc`

r? clarfonthey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocators Area: Custom and system allocators perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet