@@ -1724,7 +1724,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1724
1724
// So it's safe to skip these.
1725
1725
ProjectionElem :: OpaqueCast ( _)
1726
1726
| ProjectionElem :: Subtype ( _)
1727
- | ProjectionElem :: Downcast ( _, _) => ( ) ,
1727
+ | ProjectionElem :: Downcast ( _, _)
1728
+ | ProjectionElem :: UnsafeBinderCast ( _, _) => ( ) ,
1728
1729
}
1729
1730
1730
1731
place_ty = place_ty. projection_ty ( tcx, elem) ;
@@ -1952,7 +1953,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1952
1953
ProjectionElem :: OpaqueCast ( _) |
1953
1954
ProjectionElem :: ConstantIndex { .. } |
1954
1955
// assigning to P[i] requires P to be valid.
1955
- ProjectionElem :: Downcast ( _/*adt_def*/ , _/*variant_idx*/ ) =>
1956
+ ProjectionElem :: Downcast ( _/*adt_def*/ , _/*variant_idx*/ ) |
1957
+ ProjectionElem :: UnsafeBinderCast ( ..) =>
1956
1958
// assigning to (P->variant) is okay if assigning to `P` is okay
1957
1959
//
1958
1960
// FIXME: is this true even if P is an adt with a dtor?
@@ -2341,7 +2343,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
2341
2343
| ProjectionElem :: Subslice { .. }
2342
2344
| ProjectionElem :: Subtype ( ..)
2343
2345
| ProjectionElem :: OpaqueCast { .. }
2344
- | ProjectionElem :: Downcast ( ..) => {
2346
+ | ProjectionElem :: Downcast ( ..)
2347
+ | ProjectionElem :: UnsafeBinderCast ( ..) => {
2345
2348
let upvar_field_projection = self . is_upvar_field_projection ( place) ;
2346
2349
if let Some ( field) = upvar_field_projection {
2347
2350
let upvar = & self . upvars [ field. index ( ) ] ;
0 commit comments