You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implementing Reborrow on invariant type has strange behavior. #157313
A-borrow-checkerArea: The borrow checkerA-varianceArea: Variance (https://doc.rust-lang.org/nomicon/subtyping.html)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.F-reborrow`#![feature(reborrow)]`; see #145612T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.
error[E0597]: `x` does not live long enough
--> src/lib.rs:10:21
|
9 | fn foo(x: MyMut) {
| -
| |
| binding `x` declared here
| has type `MyMut<'1>`
10 | let _y: MyMut = x;
| ^
| |
| borrowed value does not live long enough
| requires that `x` is borrowed for `'1`
11 | }
| - `x` dropped here while still borrowed
For more information about this error, try `rustc --explain E0597`.
A-borrow-checkerArea: The borrow checkerA-varianceArea: Variance (https://doc.rust-lang.org/nomicon/subtyping.html)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.F-reborrow`#![feature(reborrow)]`; see #145612T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.
Activity
Jules-Bertholet commentedon Sep 30, 2026
This now compiles
zanville commentedon Oct 5, 2026
@rustbot claim
Rollup merge of rust-lang#163847 - zanville:add-test-reborrow-type, r…
Rollup merge of rust-lang#163847 - zanville:add-test-reborrow-type, r…
Rollup merge of rust-lang#163847 - zanville:add-test-reborrow-type, r…
Unrolled build for #163847 in rollup 164928
Rollup merge of #163847 - zanville:add-test-reborrow-type, r=tiif
Rollup merge of #163847 - zanville:add-test-reborrow-type, r=tiif