mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-03 17:48:43 +00:00
Fix const-eval of shared generic reborrows `Rvalue::Reborrow` const-eval now handles shared generic reborrows produced by `CoerceShared`. Those reborrows intentionally copy from the source ADT into a distinct same-layout target ADT, so the interpreter uses the transmute-capable copy path for `Mutability::Not`. Promotion is intentionally kept conservative: promotion candidates whose validated temporary graph contains `Rvalue::Reborrow` are rejected, so generic/user-defined reborrows are not promoted. Fixes rust-lang/rust#156313. cc @aapoalas Tracking: rust-lang/rust#145612 @rustbot label F-reborrow