mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
3e15f828f6
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