mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
96e4153100
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: rust-lang/rust#145612 Co-authored by @dingxiangfei2009