Implement derives for Reborrow and CoerceShared#156338
Conversation
|
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
|
r? @tiif rustbot has assigned @tiif. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
c515771 to
1a83d37
Compare
This comment has been minimized.
This comment has been minimized.
1a83d37 to
8e2ead2
Compare
|
Reminder, once the PR becomes ready for a review, use |
8e2ead2 to
0d49f18
Compare
|
@rustbot ready |
| } | ||
|
|
||
| #[derive(Diagnostic)] | ||
| #[diag("`derive(CoerceShared)` requires exactly one `#[coerce_shared(Target)]` attribute", code = E0802)] |
There was a problem hiding this comment.
suggestion: I would've gone with derive(CoerceShared(Target)).
|
I don't have enough context to review this, so I will leave this to the compiler champion. r? @oli-obk |
|
Hi @oli-obk, no rush, but I wanted to check that this PR is still on your radar. I know about the usual two-week review window; I’m just making sure it did not get missed after the latest updates. Thanks! |
|
Oli seems to be very busy ATM so thus: Cc. @aapoalas |

This adds built-in derive support for the experimental
ReborrowandCoerceSharedmarker traits behind#![feature(reborrow)].The derives generate the same marker impls users would write manually, while preserving the existing coherence and structural validation path for the experimental reborrow traits.
Please note this impl:
CoerceSharedtarget type through the derive helper attribute.@rustbot label F-reborrow
Tracking: #145612