@@ -1728,7 +1728,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1728
1728
// So it's safe to skip these.
1729
1729
ProjectionElem :: OpaqueCast ( _)
1730
1730
| ProjectionElem :: Subtype ( _)
1731
- | ProjectionElem :: Downcast ( _, _) => ( ) ,
1731
+ | ProjectionElem :: Downcast ( _, _)
1732
+ | ProjectionElem :: UnsafeBinderCast ( _, _) => ( ) ,
1732
1733
}
1733
1734
1734
1735
place_ty = place_ty. projection_ty ( tcx, elem) ;
@@ -1956,7 +1957,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1956
1957
ProjectionElem :: OpaqueCast ( _) |
1957
1958
ProjectionElem :: ConstantIndex { .. } |
1958
1959
// assigning to P[i] requires P to be valid.
1959
- ProjectionElem :: Downcast ( _/*adt_def*/ , _/*variant_idx*/ ) =>
1960
+ ProjectionElem :: Downcast ( _/*adt_def*/ , _/*variant_idx*/ ) |
1961
+ ProjectionElem :: UnsafeBinderCast ( ..) =>
1960
1962
// assigning to (P->variant) is okay if assigning to `P` is okay
1961
1963
//
1962
1964
// FIXME: is this true even if P is an adt with a dtor?
@@ -2345,7 +2347,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
2345
2347
| ProjectionElem :: Subslice { .. }
2346
2348
| ProjectionElem :: Subtype ( ..)
2347
2349
| ProjectionElem :: OpaqueCast { .. }
2348
- | ProjectionElem :: Downcast ( ..) => {
2350
+ | ProjectionElem :: Downcast ( ..)
2351
+ | ProjectionElem :: UnsafeBinderCast ( ..) => {
2349
2352
let upvar_field_projection = self . is_upvar_field_projection ( place) ;
2350
2353
if let Some ( field) = upvar_field_projection {
2351
2354
let upvar = & self . upvars [ field. index ( ) ] ;
0 commit comments