@@ -1716,7 +1716,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1716
1716
// So it's safe to skip these.
1717
1717
ProjectionElem :: OpaqueCast ( _)
1718
1718
| ProjectionElem :: Subtype ( _)
1719
- | ProjectionElem :: Downcast ( _, _) => ( ) ,
1719
+ | ProjectionElem :: Downcast ( _, _)
1720
+ | ProjectionElem :: UnsafeBinderCast ( _, _) => ( ) ,
1720
1721
}
1721
1722
1722
1723
place_ty = place_ty. projection_ty ( tcx, elem) ;
@@ -1944,7 +1945,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1944
1945
ProjectionElem :: OpaqueCast ( _) |
1945
1946
ProjectionElem :: ConstantIndex { .. } |
1946
1947
// assigning to P[i] requires P to be valid.
1947
- ProjectionElem :: Downcast ( _/*adt_def*/ , _/*variant_idx*/ ) =>
1948
+ ProjectionElem :: Downcast ( _/*adt_def*/ , _/*variant_idx*/ ) |
1949
+ ProjectionElem :: UnsafeBinderCast ( ..) =>
1948
1950
// assigning to (P->variant) is okay if assigning to `P` is okay
1949
1951
//
1950
1952
// FIXME: is this true even if P is an adt with a dtor?
@@ -2330,7 +2332,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
2330
2332
| ProjectionElem :: Subslice { .. }
2331
2333
| ProjectionElem :: Subtype ( ..)
2332
2334
| ProjectionElem :: OpaqueCast { .. }
2333
- | ProjectionElem :: Downcast ( ..) => {
2335
+ | ProjectionElem :: Downcast ( ..)
2336
+ | ProjectionElem :: UnsafeBinderCast ( ..) => {
2334
2337
let upvar_field_projection = self . is_upvar_field_projection ( place) ;
2335
2338
if let Some ( field) = upvar_field_projection {
2336
2339
let upvar = & self . upvars [ field. index ( ) ] ;
0 commit comments