Uh oh!
There was an error while loading. Please reload this page.
Experiment: Reborrow traits - #151753
Conversation
This comment has been minimized.
This comment has been minimized.
e4c08f7 to
3b1957aCompare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rustbot
commented
Feb 2, 2026
Some changes occurred in cc @BoxyUwU Some changes occurred in match checking cc @Nadrieril This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @vakaras This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410 Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to constck cc @fee1-dead Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred to the CTFE machinery Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
aapoalas
commented
Feb 2, 2026
r? compiler |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
BoxyUwU
commented
Feb 3, 2026
Where can I read context on what CoerceShared is/why it exists, and what the design for reborrow traits is |
Uh oh!
There was an error while loading. Please reload this page.
aapoalas
commented
Feb 3, 2026
I added a link to the experiment tracking issue but put it very shortly: |
BoxyUwU
commented
Feb 3, 2026
I think I'll just |
aapoalas
commented
Feb 3, 2026
Thank you <3 my top secret plan (designed together with tmandry) was to get a compiler review and then reroll into types to that view as well so that works well :) |
jackh726
commented
Feb 3, 2026
Appreciated. |
Uh oh!
There was an error while loading. Please reload this page.
1e8bfae to
06b7ccdCompare
This comment has been minimized.
This comment has been minimized.
aapoalas
commented
May 6, 2026
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
oli-obk
commented
May 7, 2026
Ok, let's land this for experimentation and for making it easier to test whether we can perform reborrows of references via r=me after squashing @bors delegate+ |
4bfb701 to
2d88ee8Comparerustbot
commented
May 7, 2026
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
aapoalas
commented
May 7, 2026
@bors r=oli-obk Rebased and squashed. |
…uwer Rollup of 6 pull requests Successful merges: - #156061 (Support `-Cpanic=unwind` on WASI targets) - #151753 (Experiment: Reborrow traits) - #156280 (Add regression test for closure return ICE) - #152487 (core: drop unmapped ZSTs in array `map`) - #153759 (Add a suite of ChunkedBitSet union/subtract/intersect test scenarios) - #156198 (Add `sync` option to `-Z threads` to force synchronization on one thread)
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #151753 - aapoalas:aapoalas/reborrow-and-coerce-shared-first-version, r=oli-obk Experiment: Reborrow traits With this PR we now have basic functional Reborrow and CoerceShared traits. The current limitations are: 1. Reborrowable types can only have one lifetime parameter, so as to avoid having to figure out and store in rmeta the information of which lifetimes weaken during reborrowing. 2. Reborrowing of `&mut` wrappers is working (though I've not tested generic wrappers like `Option<&mut T>` yet), but CoerceShared of `&mut` wrappers currently causes an ICE. The remaining tasks to complete before I'd consider this PR mergeable are: - [x] Fix ICE on CoerceShared. Unfortunately this might require dipping into rmeta. - [x] Expand the tests to give a more complete view of the current state of the experiment. Reborrow traits experiment: #145612 Co-authored by @dingxiangfei2009
…uwer Rollup of 6 pull requests Successful merges: - rust-lang/rust#156061 (Support `-Cpanic=unwind` on WASI targets) - rust-lang/rust#151753 (Experiment: Reborrow traits) - rust-lang/rust#156280 (Add regression test for closure return ICE) - rust-lang/rust#152487 (core: drop unmapped ZSTs in array `map`) - rust-lang/rust#153759 (Add a suite of ChunkedBitSet union/subtract/intersect test scenarios) - rust-lang/rust#156198 (Add `sync` option to `-Z threads` to force synchronization on one thread)
View all comments
With this PR we now have basic functional Reborrow and CoerceShared traits. The current limitations are:
&mutwrappers is working (though I've not tested generic wrappers likeOption<&mut T>yet), but CoerceShared of&mutwrappers currently causes an ICE.The remaining tasks to complete before I'd consider this PR mergeable are:
Reborrow traits experiment: #145612
Co-authored by @dingxiangfei2009